WebDriver/Marionette: Difference between revisions

Jump to navigation Jump to search
Line 104: Line 104:
         self.assertEquals(0.4, marionette.execute_script("return navigator.mozBattery.level;"))
         self.assertEquals(0.4, marionette.execute_script("return navigator.mozBattery.level;"))
</pre>
</pre>
To run emulator tests, you should pass the --emulator and --homedir parameters to runtests.py; --homedir is the B2G homedir.  Then runtests.py will launch the emulator and connect to it before running tests.
    python runtests.py --emulator --homedir=/path/to/B2G_HOME <test path>


This test checks the current battery state, then tells the emulator to set the battery to 40 percent capacity, and then verifies that the change is detected by content. This test will run with marionette right now, but we may add helper wrappers for the webAPI calls, so you wouldn't have to inject your own scripts to retrieve the value.
This test checks the current battery state, then tells the emulator to set the battery to 40 percent capacity, and then verifies that the change is detected by content. This test will run with marionette right now, but we may add helper wrappers for the webAPI calls, so you wouldn't have to inject your own scripts to retrieve the value.
Confirmed users
1,905

edits

Navigation menu