mozilla/gaia-ui-tests — pull request #647 by davehunt (2013-04-11 11:16:10+00:00)
Title: Identify online/offline tests, and clarify usage of lan tests

This is a rather large pull request (sorry) but these changes are all related (and mostly interdependent). The initial reason for this was to create an 'offline' test type so when running B2G desktop tests we can skip tests that require no connection. I soon discovered that our tests have a strong dependency on WiFi where they shouldn't. Some tests just require a network connection, and cell data should suffice. I have therefore created an 'online' test type and modified the tests so they can use either WiFi or cell data.

Here is a detailed breakdown of the changes:

1. Added a 'Test Types' section to the README to explain the manifest keys in use
* Renamed `enable_cell_data` and `enableCellData` to `connect_to_cell_data` and `connectToCellData` as this more accurately describes what's happening
* Fixed `disableCellData` so that it will only be skipped if cell data is already enabled, rather than if cell data is connected. In some cases this was causing cell data to still be enabled
* Pass test variables to GaiaDataLayer so they don't need to be passed for the WiFi methods
* Added `is_cell_data_enabled` and `is_wifi_enabled` properties
* Brought single line of JavaScript inline for `is_cell_data_connected`
* The `connect_to_wifi` method will now enable WiFi if needed, and will default to the network from test variables
* Similarly, `is_wifi_connected` will default to the network from test variables
* Added a `has_wifi` property to GaiaDevice to indicate that the target device has WiFi.
* Disable cell data roaming in `cleanUp`
* Added `connect_to_network` when we just want to connect (will try WiFi first, and then cell data)
* Added `connect_to_local_area_network` when we specifically want to connect to a network other than cell data (will try WiFi)
* Added 'online' test type to indicate a test requires any kind of connection, and removed 'lan' when it was being used for this purpose
* Added 'offline' test type to indicate a test requires no connection. This is required because tests run on desktop B2G will likely always have a connection
* Removed disabling WiFi in test `tearDown` as it is taken care of in `cleanUp`
* Split `test_carrier_settings.py` into two test files so they can have distinct test types

Not that there are a few TODOs in this code. These do not indicate that this isn't ready, as they equally apply to our current code. We currently have no reliable way to determine if we have a network connection.