← Back to Discord Forum

Run actions after test, not using AfterEach but make a global actions to be run after each test


I need to be able to execute code section that have access to the "page" object - after test finished. I tried to do it using fixtures, but in case that test fail, the code after use(page) is not executed. Does anyone have any idea how to do it? I don't want to write it in the test level, but write it once globally and make it run after each test (no matter of failure/success)

This thread is trying to answer question "How can code be executed after each test, globally and without being affected by test failures?"

0 replies
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.