IKivan-kozenko -aqa
Try yourself as a QA tester
Back to topic

Quiz

Global setup and teardown

Check yourself

  1. 1.You set up a globalSetup function that logs in, saves storageState, and also starts tracing to capture what happens during login. But when login fails in CI, you get no trace file. Why?
  2. 2.Why does the documentation recommend project dependencies over globalSetup for the login-once pattern?
  3. 3.What does await page.context().storageState({ path: authFile }) save?
  4. 4.In playwright.config.ts, how do you make the 'chromium' project run only after the 'setup' project finishes?
  5. 5.You use globalSetup to seed a test database and store the seed IDs in process.env. Will the tests be able to read those environment variables?
  6. 6.You're debugging a single test that depends on the 'setup' project. You know the storageState file already exists from the last run. How do you run just that test without re-running the login setup?
  7. 7.The 'setup' project has a teardown: 'cleanup' option. When does the cleanup project run?
  8. 8.You run npx playwright test --grep 'checkout' to filter tests. The checkout tests depend on the 'setup' project. Does the setup project still run?