setNetworkConnection
Set network connection.
Types:
- airplane mode
- wifi on
- data on
These properties behave like a bitmask so if you set the network connection to 0
everything will get turned off. However if you for example set the network connection
to 4 it will disable the airplane mode and turn off the wifi so that only data will
be enabled. WebdriverIO provides a simplified interface to set these values without
calculating bitmasks.
Note: if you have airplane mode enabled you can’t have wifi or data be enabled too
(for obvious reasons)
Usage
| 1
 | browser.setNetworkConnection();
 | 
Example
setNetworkConnection.js| 12
 3
 4
 5
 6
 7
 
 | it('should emulate network connection', function () {browser.setNetworkConnection(0)
 browser.setNetworkConnection(1)
 browser.setNetworkConnection(2)
 browser.setNetworkConnection(4)
 browser.setNetworkConnection(6)
 });
 
 | 
 
Support
