-
Notifications
You must be signed in to change notification settings - Fork 0
Test Suite Classes
Your next step should be to create a class with methods that represent each one of the tests you want to run in your application and be linked as a test suite. In order to do so, create a Python file that contains a class that extends the class unittest.TestCase: Also, if your application always starts with the same window/activity it is encouraged to overwrite the method setUp and tearDown: -> setUp: Here we create a class attribute and equal it to a newly created object of the class that represents that first activity/window. This way, we don't have to replicate that object in every test method and also we start the recording process of the video for our test earlier -> tearDown: We call to the attribute with the object that represent the first window/activity of our app and class the object method destroy, this method stops the recording session and closes our app. This way, we don't have to replicate this code in every test method:
So a test suite class will look like this:
class className(unittest.TestCase):
def tearDown(self):
self._attribute_.destroy()
time.sleep(60)
def setUp(self) -> None:
self._attribute_ = _PageWindowClass_()
def test_method_name_(self):
...
A good example is this class