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

Jump to navigation Jump to search
Line 86: Line 86:
*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


*Test setup should read in details from vars.py
*Test setup should read in details from conftest.py


*Test Case names should always show the intent of the test case.
*Test Case names should always show the intent of the test case.
Line 92: Line 92:
<pre class="brush:py;toolbar:false;">
<pre class="brush:py;toolbar:false;">
     # Good
     # Good
     def test_that_advanced_search_doesnt_find_item(self):
     def test_that_advanced_search_doesnt_find_item(self, testsetup):


     # Bad
     # Bad
Line 98: Line 98:
</pre>
</pre>


**CAVEAT: setUp and tearDown are exceptions to the rule as they are needed for unittest
 


*Tests should handle the asserts not the Page objects
*Tests should handle the asserts not the Page objects
*Every Test module will have an main() function caller
<pre class="brush:py;toolbar:false;">
        if __name__ == "__main__":
            unittest.main()
</pre>
Confirmed users
753

edits

Navigation menu