hello!
Consider this scenario:
Is there a way to wait for the test in the first file to end before starting the test in the second file, knowing that i cant put them together in the same describe?
This thread is trying to answer question "Is there a way to wait for the test in the first file to end before starting the test in the second file without combining them into the same describe?"
I don't know of a way to serialize tests that aren't in the same file, and it's generally not a good practice to have tests dependent on each other.
Could you use mocking for these tests? For example, you could make it so that the admin user isn't actually modifying the state, and the other user opens the page that is mocked to look like what the admin created. If you did this, you'd want a unit test to make sure that the admin can make the change as expected.
if you can't put them together in the same describe, you can join it in one test file and just add 2 test.describe
one for creation and the second one is a check for creation.
so you have this in one test file
`test.describe.configure({ mode: 'serial' });
test.describe("Creation", () => { }
test.describe("Check for Creation", () => { }`
i haven't tested this, but you should try it if this fix your problem
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].