Run linter on MediaSnippet. (#67)

1 file changed
tree: f51f9b690fa980b04a1fac6360f8c4cf97e6bff5
  1. gradle/
  2. src/
  3. .gitignore
  4. build.gradle
  5. CONTRIBUTING.md
  6. gradle.properties
  7. gradlew
  8. LICENSE
  9. README.md
README.md

Mobly Bundled Snippets is a set of Snippets to allow Mobly tests to control Android devices by exposing a simplified verison of the public Android API suitable for testing.

We are adding more APIs as we go. If you have specific needs for certain groups of APIs, feel free to file a request in Issues.

Note: this is not an official Google product.

Usage

  1. Compile and install the bundled snippets

    ./gradlew assembleDebug
    adb install -d -r -g ./build/outputs/apk/mobly-bundled-snippets-debug.apk
    
  2. Use the Mobly snippet shell to interact with the bundled snippets

    snippet_shell.py com.google.android.mobly.snippet.bundled
    >>> print(s.help())
    Known methods:
      bluetoothDisable() returns void  // Disable bluetooth with a 30s timeout.
    ...
      wifiDisable() returns void  // Turns off Wi-Fi with a 30s timeout.
      wifiEnable() returns void  // Turns on Wi-Fi with a 30s timeout.
    ...
    
  3. To use these snippets within Mobly tests, load it on your AndroidDevice objects after registering android_device module:

    def setup_class(self):
      self.ad = self.register_controllers(android_device, min_number=1)[0]
      self.ad.load_snippet('api', 'com.google.android.mobly.snippet.bundled')
    
    def test_enable_wifi(self):
      self.ad.api.wifiEnable()
    

Other resources