Rayrun
← Back to Discord Forum

Can we use playwright fixtures as a precondition even to methods?

rakeshsmathposted in #help-playwright
Open in Discord

as we know we can use the fixtures inside the tests or test.beforeeach method. test.beforeEach(async ({ pageManager: PageManager }, testInfo: TestInfo ) => { console.log(Running ${testInfo.title}); await pageManager.page.goto("/"); });

can we use the pageManager Fixture to even methods also. something like this?

async performUserLogin() {pageManager: PageManager}{

}

is this possible or is there any way to do this?

This thread is trying to answer question "Can Playwright fixtures be used as preconditions in methods other than tests or beforeEach?"

1 reply

Can we use playwright fixtures as a precondition even to methods?

Related Discord Threads

TwitterGitHubLinkedIn
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 [email protected].