Hello guys.
Help me with sharing fixtures in my case. Please look at the pictures and help me to figure out why my fixtures are not shared between the backend and the homepage. It looks like it's stuck on the backend page and not sharing with homePage
// Do not pass test('Login via API @api', async ({ backend, homePage }) => { await backend.login(process.env.EMAIL, process.env.PASSWORD) await homePage.open() })
// works well test('Login via UI @regression', async ({ homePage, sighInPage }) => { await sighInPage.open() await sighInPage.loginAsUser(process.env.EMAIL, process.env.PASSWORD)
await homePage.pageIsPresent()
})
This thread is trying to answer question "Why are my fixtures not shared between the backend and the homepage?"
I've also tried this approach.
export class ApiSupport { constructor(public page: Page, public request: APIRequestContext, public context: BrowserContext) { }
await this.context.addCookies([ { "name": "sessionid", "value": sessionIdMatch, "domain": process.env.BASE_URL, "path": "/", "httpOnly": true, "secure": true, "sameSite": "None" } ])
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].