Lately, we have come across an issue in our application, where two users filled in the form details and clicked submit to find summary with information swapped. I am looking to simulate the scenario where two PlayWriht tests run parallel but the last step/action execute at once.
test.describe.configure({mode: 'parallel'})
test('first test', async({})=>{
step1..
step2..
step3..
step4..
})
test('second test', async({})=>{
step1..
step2..
step3..
step4..
step5..
})
I run the script in parallel with two workers i.e., ‘npx playwright test –workers=2’ command. I want to ensure ‘first test-step4’ and ‘second test-step5’ are executed at the same time.
I have tried below workers api documentation but found no luck. From my research, I think nodejs ‘worker threads’ and events may be helpful. Any help or guidance will be greatly appreciated.
https://playwright.dev/docs/api/class-worker#worker-evaluate
tuljavikas is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.