feat: support in-memory file uploads

Merged
WE
2d ago
+521-67

What and why

  • Accept an in-memory file payload or payload array in locator.setInputFiles, preserving paths and empty-array clearing.
  • Reject combined payloads of 50 MiB or more as INVALID_ARGUMENT; larger files can use paths.
  • Keep the original engine action intact. The web engine declares the payload action explicitly and requires @e2e-dev/core 0.25.0 or later below 1.0, with the same minimum for its optional e2e peer. The SPI v1 action list stays frozen so older engines do not advertise payload support. Include types, migration docs, consumer skill, and changeset.
await screen.getByLabel('Receipt').setInputFiles({
  name: 'receipt.txt',
  mimeType: 'text/plain',
  buffer: Buffer.from('Receipt total: 12.00'),
});

Issue

Part of #1855, Locators and actions: locator.setInputFiles({ name, mimeType, buffer }). Assigned in https://github.com/e2e-inc/e2e/issues/1855#issuecomment-6951485642.

Verified

Ran it locally: yes, macOS arm64, Node 25.8.1.

  • Built CLI against the testbed: e2e run tests/set-input-files.e2e.ts --grep in-memory --video. Checks filename, MIME type, binary contents, empty files, chooser buttons, and clearing. Recording retained locally: GitHub CLI attachment upload requires upstream write access, unavailable for this fork contribution.
  • On a0974fe4: pnpm check, 194 core/schema tests, 19 web compatibility/upload tests, and all 24 built-CLI upload tests pass. This includes the upstream shadow-DOM event case and oversized-upload recovery.
  • Full pnpm test and the deterministic web benchmark (93 tests) passed on a0974fe4.
  • On 313b9f89: pnpm check, 280 core/MCP tests, 60 web unit/integration tests, and 242 mobile tests pass.
  • On a3b65c43: pnpm check, 76 locator tests, and all 24 built-CLI upload tests pass. Fresh-context review found no actionable issues.
Test Files  1 passed (1)
     Tests  24 passed (24)
  • On d2f621ca with current main: pnpm check, 280 focused tests, and all 24 upload tests on the built CLI pass.

Existing path-upload scenarios preserve behavior in the main-versus-branch comparison. Two pairs were measured; timing remains unresolved, with no performance claim.

Existing path uploadsmainthis branch
Multiple file input and chooser buttonpasspass