Skip to content
Discussion options

You must be logged in to vote

Follow the model for using a custom tearDown() in tests: https://github.com/seleniumbase/SeleniumBase/blob/master/examples/boilerplates/base_test_case.py

class BaseTestCase(BaseCase):

    def tearDown(self):
        self.save_teardown_screenshot()  # If test fails, or if "--screenshot"
        if self.has_exception():
            # <<< Run custom code if the test failed. >>>
            pass
        else:
            # <<< Run custom code if the test passed. >>>
            pass
        # (Wrap unreliable tearDown() code in a try/except block.)
        # <<< Run custom tearDown() code BEFORE the super().tearDown() >>>
        super().tearDown()

Inside the super().tearDown() section, the …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mdmintz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants