Created
July 28, 2022 18:06
-
-
Save kfatehi/302fde5b7812699c132f9480749bda8b to your computer and use it in GitHub Desktop.
Playwright parallel independent sessions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { test, expect } from '../helper/test.mjs'; | |
import { signInProcess} from '../helper/sign_in_helper.mjs' | |
test('test', async ({ page, bpd, playwright }) => { | |
await Promise.all([ | |
(async ()=>{ | |
const browser2 = await playwright.chromium.launch(); | |
const context2 = await browser2.newContext(); | |
const page2 = await context2.newPage(); | |
const pc2 = await bpd.createCompanyWithUsersContacts(); | |
await signInProcess(page2)(pc2.company, pc2.user); | |
})(), | |
(async ()=>{ | |
const pc1 = await bpd.createCompanyWithUsersContacts(); | |
await signInProcess(page)(pc1.company, pc1.user); | |
})() | |
]) | |
await page.locator('#foo').click(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment