Playwright / Quiz

Files Crossing the Browser Boundary

Reason about event ordering, temporary downloads, and locator-based uploads from concrete test fragments.

Difficulty
Medium
Format
Quiz
Points
150
Estimate
8 min

// MISSION BRIEF

Your Mission

Files make browser tests cross process and filesystem boundaries. Inspect the order of operations in download and upload snippets, then identify which code actually waits for the browser action it claims to test.

// FIRST CONTACT

Battle teaser

Which repair correctly captures a download from this flaky test? await page.getByRole("button", { name: "Export CSV" }).click(); const download = await page.waitForEvent("download");

  1. ACreate downloadPromise = page.waitForEvent("download") before the click, click, then await downloadPromise
  2. BCall page.download() after clicking
  3. CAdd waitForTimeout after the click, then keep waiting for the event
  4. DRead the Downloads folder directly without observing the page event
Answers, scoring, hints, and the full battle stay sealed.

// SKILL TAGS

playwright-filesdownloadsuploadsplaywright