Skip to content

Fail web setInputFiles on a missing path as INVALID_ARGUMENT before clicking (tester-army/e2e#2039) - #2188

Merged
kblok merged 1 commit into
mainfrom
fix/2171-setinputfiles-missing-path
Nov 23, 2026
Merged

kblok merged 1 commit into
mainfrom
fix/2171-setinputfiles-missing-path

Conversation

@kblok

@kblok kblok commented Nov 23, 2026

Copy link
Copy Markdown
Member

Web setInputFiles now stats every path first and throws INVALID_ARGUMENT (a test error) before anything is clicked, for a path that does not exist or sits under a directory the runner cannot search. Before, a missing path surfaced late as an engine failure, after a chooser-opening button had already been clicked.

Closes #2171

Upstream parity

Port of e2e-inc/e2e@6fdb1c2 (#2039). Verdict: complete, with the justified exceptions below.

  • statPath (support.ts) -> WebSupport.StatPath; uploadFiles check -> WebEngine.UploadFilesAsync; requireFile in route-options.ts now uses the shared helper -> RouteOptions.
  • Message is setInputFiles path does not exist or is under a directory the runner cannot search: <runtime message>. The runtime text is .NET's, not Node's ENOENT text.
  • Docs: Screen.cs XML doc, skills/e2e-dotnet/SKILL.md, references/writing-tests.md, api/E2E/Locator.md (edited by hand, as npm run api needs net11, which this environment lacks).
  • No .changeset here (the port has none).
  • Port-only symbols: UploadPage.TryLockDirectory, UnlockDirectory, MissingPaths, StatFailure (test helpers). StatPath returns Exception? plus an out isFile instead of Stats | Error.

Upstream tests and local match

Upstream Local
upload-actions fails a path that does not exist ... (element and locator targets) ThroughTheElementTargetTests / ThroughTheLocatorTargetTests Fails_a_path_that_does_not_exist_as_INVALID_ARGUMENT_before_it_touches_a_file_input_or_a_button_over_a_hidden_input
upload-actions fails a path under a directory it may not search ... Fails_a_path_under_a_directory_it_may_not_search_as_INVALID_ARGUMENT in both classes
actions.test.ts (real temp file for uploads) DispatchLocatorActionTests already uses a real file (UploadPage.AvatarFile)

Not ported / caveats

  • Upstream skips the EACCES test on Windows and as root. xUnit v2 has no runtime skip, so the port returns early there; it ran as a no-op in this environment (root). Nothing was left unported, so no follow-up issue was needed.
  • Real-model tests were not run (no Copilot login here). The change touches only the web engine's upload path. I ran UploadActions, DispatchLocatorAction and Route* tests (212 passed) with net10 only.

Generated by Claude Code

@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 48 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 2b958f8 and c34bdcb.

Files selected for processing: 10

  • docs-site/src/content/docs/api/E2E/Locator.md
  • skills/e2e-dotnet/SKILL.md
  • skills/e2e-dotnet/references/writing-tests.md
  • src/E2E/Engine/WebEngine.cs
  • src/E2E/Engine/WebSupport.cs
  • src/E2E/Internal/RouteOptions.cs
  • src/E2E/Locator/Screen.cs
  • tests/E2E.Tests/UploadActions/ThroughTheElementTargetTests.cs
  • tests/E2E.Tests/UploadActions/ThroughTheLocatorTargetTests.cs
  • tests/E2E.Tests/UploadActions/UploadPage.cs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@kblok
kblok merged commit fc27198 into main Nov 23, 2026
5 checks passed
@kblok
kblok deleted the fix/2171-setinputfiles-missing-path branch November 23, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upstream: fail web setInputFiles on a missing path as INVALID_ARGUMENT before clicking (tester-army/e2e#2039)

2 participants