-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Closed
Description
Context:
- Playwright Version: 1.29.1
- Browser: Chromium
System:
- OS: Windows 10 10.0.19044
- Memory: 16.72 GB / 31.75 GB
Binaries:
- Node: 19.0.1 - C:\Program Files\nodejs\node.EXE
- npm: 8.19.2 - C:\Program Files\nodejs\npm.CMD
Code Snippet
My test depends on the environment and some users have to be added manually or we should test them only when they are available. So I added this skip call according to how it's described in the documentation: https://playwright.dev/docs/api/class-test#test-describe-skip
test.beforeAll(async ({ browser }) => {
userModel = await usersApiClient.getUserByName(userName);
test.skip(userModel === null, `User for this test (${userName}) is not available`);
}If I use this approach:
- next steps of beforeAll hook are skipped - good.
- test is skipped - good
- afterAll\afterEach hook is running and fails because
userModelis null and it tries to clean up the user.
So even if test is skipped from beforeAll hook, I have also to add condition to afterAll hook
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels