IntermediatePW-FILE-00125 minutesPlaywright

Upload a valid CSV

A tester uploads synthetic customer data through the native file input.

  • files
  • forms

Objective

What to automate

Upload a valid CSV and verify its accepted filename and content classification.

Preconditions and test data

Preconditions

  • Use a fresh isolated Practice Lab browser context.
  • Open the fixture identified by FX-FILE-001.

Test data

  • filename: customers.csv
  • content: name,email\nAsha,asha@example.test

Expected result

The upload is accepted and the filename customers.csv is displayed.

Progressive hints

Hint 1

Create the file payload in memory.

Hint 2

Use setInputFiles on the native input.

Hint 3

Assert the accepted status and filename.

I’ve tried it — show solution
  1. Create the file payload in memory.
  2. Use setInputFiles on the native input.
  3. Assert the accepted status and filename.