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

Jump to navigation Jump to search
Line 73: Line 73:
==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


    Selenium setup should read in details from vars.py
*Test setup should read in details from vars.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.


    GOOD: def test_that_advanced_search_doesnt_find_item(self):
**GOOD: def test_that_advanced_search_doesnt_find_item(self):
**BAD: def test_advanced_search(self):
**CAVEAT: setUp and tearDown are exceptions to the rule as they are needed for unittest


    BAD: def test_advanced_search(self):
*Tests should handle the asserts not the Page objects


    CAVEAT: setUp and tearDown are exceptions to the rule as they are needed for unittest
*Every Test module will have an main() function caller
 
    Tests should handle the asserts not the Page objects
 
    Every Test module will have an main() function caller


         if __name__ == "__main__":
         if __name__ == "__main__":
             unittest.main()
             unittest.main()
Confirmed users
753

edits

Navigation menu