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

Quiz

Screenshots

Check yourself

  1. 1.What's the difference between page.screenshot() and expect(page).toHaveScreenshot()?
  2. 2.How do you capture a screenshot of the entire page, including content below the fold?
  3. 3.You want to capture only a specific region of the page — for example, a 400×200 pixel rectangle starting at coordinates (100, 50). Which option do you pass to page.screenshot()?
  4. 4.How do you take a screenshot of a single element (e.g., a card component) rather than the whole page?
  5. 5.Your page has a dynamic user avatar image that changes with every test run, causing visual regression tests to fail. How do you prevent the avatar from appearing in the screenshot?
  6. 6.How do you configure Playwright to automatically save a screenshot only when a test fails?
  7. 7.Visual regression tests pass on your Mac but fail on the CI Linux runner due to slightly different font rendering. What is the recommended fix?
  8. 8.You update a UI component intentionally and now toHaveScreenshot() fails because the golden image is outdated. How do you update the golden images?