-
Notifications
You must be signed in to change notification settings - Fork 0
Writer Helper
With in the tests folder is the writer_helper.py file. This file contains a class that's only purpose is to make writing new test methods easier.
Pytest does not require test classes to inherent any Base Test class. Fixtures replace the need for such things. A drawback to this is that when developing new test methods, the test class that contains them does not have access to the Page Objects. Without this recall the IDE can not suggest or autocomplete the methods in those objects.
I created a workaround for this by creating a Writing class that initializes the various Page Objects to be used by the Test classes.
Examples:
With Out the Writer Helper
No suggestions are given
With the Writer Helper
Suggested methods are listed
This saves time having to write out each method and reduces errors from spelling mistakes or just not remembering the exact wording. Also lets you see the parameters for the methods.
Pytest will fail to collect the tests if the Test class is inheriting any other classes.
class TestClass: when running class TestClass(Writer): when developing.