This page hasn't finished yet.
Your feedback to email@example.com would be greatly appreciated.
Your contribution is a big step to us! You may reference this page. I will brief out something here since that page is having some similiar topics as this MDN document.
You can find related programming guide for marionette. This shows the basic layout and how you would write a test on gaia-ui-tests. Also, you will find we strictly go accord to PEP8 style except the 80 characters, E501. But, we do want to keep it within 100 charaters or so. If you are using Ubuntu, you can install a basic check program for PEP8 by doing:
sudo apt-get install pep8
and, then you can check your program style by doing this command:
pep8 --ignore=E501 <your test file location and name>
After you finished writing the test(s), you can then send a pull request from your branch to the branch in Mozilla that you want to contribute to! We also sometime open issues in github of Mozilla gaia-ui-tests to dicuss in advance. In that case, we can understand if our contribution was finished, if there are better suggestion, and if this contribution worth a million!
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from gaiatest import GaiaTestCase class TestTemplate(GaiaTestCase): def setUp(self): # you should do something here to set up the environment GaiaTestCase.setUp(self) def test_template_1(self): # your first test regarding for this category of test ''' (description of where this test case is from, you may put a MozTrap link here)''' def test_template_2(self): # your second test regarding for this category of test ''' (description of where this test case is from, you may put a MozTrap link here)''' def tearDown(self): # you should do something here to clean the environment GaiaTestCase.tearDown(self)
At this point of time, we change codes dramatically everyday. We will try to come out a real gaia-ui-test mthods overview soon. But, before that comes into reality, you may take marionette methods page for reference. Furthermore, please do notice that marionette methods page has some out-of-date stuffs, too. Please kindly help us to correct them if possible.
Another few good reference is to dig into the code to know the common libraries we are using in gaia UI tests. I suggests that you can start with gaia_test.py. Moreover, you can look into gaia_data_layer.js and gaia_apps.js. Also, all the files under apps/ folder are other good-to-know stuffs.
TODO: Gaia-UI-Tests functions/methods/attributes reference
Everytime when you have no idea to start with in Gaia-UI-Tests, you can write so and run it.
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from gaiatest import GaiaTestCase class TestDebug(GaiaTestCase): def setUp(self): GaiaTestCase.setUp(self) def test_debug(self): import pdb; pdb.set_trace() def tearDown(self): GaiaTestCase.tearDown(self)
CSS and XPath Locators