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?"
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].