B2G/QA/Automation/Style Guide: Difference between revisions

(→‎Use of Libraries: remove content)
 
(8 intermediate revisions by 2 users not shown)
Line 3: Line 3:
<br>
<br>
<br>
<br>
It is also recommended to review Geo's draft of [https://github.com/geoelectric/ui_auto_best_practice/blob/master/uiabp.md automation best practices], which gives a theoretical overview of writing automation tests.


= [[B2G/QA/Automation/Style Guide/General Concepts|General Concepts]] =  
== General Disclaimer ==
= [[B2G/QA/Automation/Style Guide/Howtos| How-Tos ]] =
As we develop more knowledge some tests might fall behind the standards in this style guide. It can be tempting to want to fix all of the outdated style but in order to keep patches/pulls small (see above!) we are happy to have new and old standards of code sit side by side. As we regularly review and update tests the project will be brought completely up to our current standards.


= [[B2G/QA/Automation/Style_Guide/Python_Script_Style|Python Script Style Guide]] =
Or if you prefer, file a [https://bugzilla.mozilla.org/enter_bug.cgi?product=Firefox%20OS&component=Gaia%3A%3AUI%20Tests Bugzilla issue] to have a section of code addressed separately to the job you are doing.


= [[B2G/QA/Automation/Style Guide/Best Practices|Best Practices]] =
== Outside Test Consumers ==
* Be aware if you change or remove the Gaia UI test API, that outside consumers might get broken.


= Use of Libraries =
Current outside consumers of Gaiatest are:
* [https://github.com/Mozilla-TWQA/MTBF-Driver MTBF]
* [https://github.com/mozilla-b2g/gaia/tree/master/tests/python/gaia-ui-tests/gaiatest/tests/accessibility a11y]
* [https://github.com/JonHylands/power-tests Power-tests]
* [https://github.com/mozilla/marketplace-tests-gaia/tree/master/marketplacetests Marketplace tests]
* [https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/Run_ImageMagick_Tool_with_Python_Marionette Imagecompare] tests
* [https://arewefastyet.com/#machine=26 awfy]


= Submitting and Reviewing Patches =
== [[B2G/QA/Automation/Style Guide/General Concepts|General Concepts]] ==
== Submission ==  
== [[B2G/QA/Automation/Style Guide/Howtos| How-Tos ]] ==
To make sure that we can review your patch as quickly and efficiently as possibly we would like patches to have a single test in them and the necessary changes to the page objects. This also limits the chances of merge conflicts later.
 
<br>
== [[B2G/QA/Automation/Style_Guide/Python_Script_Style|Python Script Style Guide]] ==
Please refer to [https://developer.mozilla.org/en-US/Firefox_OS/Developing_Gaia/Submitting_a_Gaia_patch this page] for gaia patch submission steps.
 
== Review ==
== [[B2G/QA/Automation/Style Guide/Best Practices|Best Practices]] ==
First of all, make sure above mentioned guidelines are not violated, and check for the following:
 
<br>
== [[B2G/QA/Automation/Style_Guide/Avoiding_Duplication|Avoiding Duplication]] ==
=== Look for transitions that are not waited on ===
 
TBD - jlorenzo
== [[B2G/QA/Automation/Style_Guide/Submission_Review|Submission and Review]] ==
=== Check for change/removal of methods ===  
 
In order to make sure that the change is cascaded, `git grep` is your friend.
== [https://github.com/geoelectric/ui_auto_best_practice/blob/master/uiabp.md Further Reading] ==
TBD - jlorenzo
=== Are the locators correct? Could they be improved?  ===
TBD - jlorenzo
=== Are the locators/methods used that were added? ===  
TBD - mwargers
A linter would also help to enforce it, see: https://bugzilla.mozilla.org/show_bug.cgi?id=1186388
=== Are workarounds explained in the code file? ===  
TBD - jlorenzo
352

edits