QA/Execution/Web Testing/Docs/Automation/StyleGuide: Difference between revisions

no edit summary
(Created page with "The goal of the style guide is to try write code that looks the same no matter what project. It is a guide and is always up for discussion by the team. I have created templates (...")
 
No edit summary
Line 1: Line 1:
The goal of the style guide is to try write code that looks the same no matter what project. It is a guide and is always up for discussion by the team. I have created templates (https://github.com/AutomatedTester/mozwebqa-test-templates) based on the details below and will update as the discussion goes on.
The goal of the style guide is to try provide rules to write code that looks the same no matter what project. It is a guide and is always up for discussion by the team. I have created [https://github.com/AutomatedTester/mozwebqa-test-templates templates] () based on the details below.
All Files
 
File headers
=All Files=
==File headers==


     At the top of each file should have python file header  #!/usr/bin/env python
     At the top of each file should have python file header  #!/usr/bin/env python
Line 29: Line 30:
     Bad: class test_this_site(unittest.TestCase):
     Bad: class test_this_site(unittest.TestCase):


Page Object Style Guide
==Page Object Style Guide==


     All Page Objects should inherit from Page in page.py
     All Page Objects should inherit from Page in page.py
Line 72: Line 73:
     BAD: def report_length(length)
     BAD: def report_length(length)


Test Style Guide
==Test Style Guide==


     Module names should be called test_ and then behavioural areas. E.g. test_search_positive.py
     Module names should be called test_ and then behavioural areas. E.g. test_search_positive.py
Confirmed users
753

edits