Skip to content

Port Playwright's route, request-fallback and request-fulfill tests (Refs #1060) - #1071

Merged
kblok merged 8 commits into
mainfrom
issue-1060-network-routes
Nov 5, 2026
Merged

kblok merged 8 commits into
mainfrom
issue-1060-network-routes

Conversation

@kblok

@kblok kblok commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Tests that hold, redirect or answer requests need a test server that does more than serve files. This PR ports the rest of upstream's routes.mjs (/echo, /status, /slow, /never, /redirect, /download, /set-cookie, /respond, /cors-echo, /bounce, /count, /options, /options-log, /upload, /binary, /download-stall, /sse, and the /ws upgrade) into the testbed, and ports three network test files on top of it. The testbed now also listens on localhost (the cross-origin CROSS host) and serves these routes without blocking its accept loop, because several of them hold a request open.

Stacked on #1064 (base is its branch until it merges).

Upstream change ported

tester-army/e2e#1505, commit bdf769b: apps/testbed/app/playwright/routes.mjs, route.e2e.ts (39 it + the 4-method loop), request-fallback.e2e.ts (6), request-fulfill.e2e.ts (16). Directories Route/, RequestFallback/, RequestFulfill/, one class per describe. The other group D files follow in the next PR.

Not ported

Each is named in the class summary, as upstream's "Not ported" header: dataURL goto, setExtraHTTPHeaders, abort(errorCode), fallback({ ... }), times, allHeaders(), request.response(), service workers, URLPattern, WebKit-only, buffer/response/HAR/gzip fulfill, headerValue set-cookie.

  • Expected failure (upstream fail): "should not support ? in glob pattern" (? in a route glob matches one character), via ExpectedToFailAsync.
  • [Ignore], as upstream skip: "should fulfill with multiple set-cookie" and "should fulfill with fetch response that has multiple set-cookie" (fulfill refuses a newline in a header value).
  • "should fall back after exception" triggers the exception with a body plus json together, since C# has no unknown response option.

.NET-only symbols

  • Helpers: CROSS, Asset, Deferred, WithHeaders, Served, Contain, AllAsync (test helpers for Promise.all, { ...headers }, /cors-echo JSON).
  • Testbed.ServePlaywrightRoutesAsync: runs each route off the accept loop (HttpListener is a single loop).
  • PlaywrightRoutes.HeldRequestLimit: HttpListener has no close event, so /never, /sse, /download-stall and /ws release after 2 minutes.
  • PlaywrightRoutes.UpgradeAsync is upstream's upgrade, called from HandleAsync since HttpListener has one entry point.

No src/ change, so no real-model run and no docs change.

Refs #1060

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ls2e1yaZFgZ3FEJkYScfkK

kblok and others added 3 commits November 4, 2026 18:40
…t tests (Refs #1060)

The testbed gets the /content route and Playwright's test assets (with its LICENSE and NOTICE), and the first four of upstream's Playwright page test files run against them.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ls2e1yaZFgZ3FEJkYScfkK
…nce of expected failures (Refs #1060)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ls2e1yaZFgZ3FEJkYScfkK
…nd the rest of routes.mjs (Refs #1060)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ls2e1yaZFgZ3FEJkYScfkK
@coderabbitai

coderabbitai Bot commented Nov 4, 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 17 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 ee824be and f30a380.

Files selected for processing: 10

  • tests/E2E.Agent.Tests/PlaywrightRoutes.cs
  • tests/E2E.NUnit.Tests/Helpers/Helpers.cs
  • tests/E2E.NUnit.Tests/RequestFallback/PageRequestFallbackTests.cs
  • tests/E2E.NUnit.Tests/RequestFulfill/PageRequestFulfillTests.cs
  • tests/E2E.NUnit.Tests/Route/PageRouteTests.cs
  • tests/E2E.NUnit.Tests/Testbed/playwright/assets/global-var.html
  • tests/E2E.NUnit.Tests/Testbed/playwright/assets/one-style.css
  • tests/E2E.NUnit.Tests/Testbed/playwright/assets/one-style.html
  • tests/E2E.NUnit.Tests/Testbed/playwright/assets/preload.html
  • tests/E2E.NUnit.Tests/Testbed/playwright/assets/title.html
  • 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

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ls2e1yaZFgZ3FEJkYScfkK
@kblok

kblok commented Nov 4, 2026

Copy link
Copy Markdown
Member Author

Review round: fixed AllAsync to fail fast when the action fails. Declined: flag-after-continue ordering, Number returning 0 for bad input, the unbounded multipart parsing, the 2-minute hold and Route_method_should_throw_if_called_twice ordering. They keep upstream's behavior and order (routes.mjs, route.e2e.ts); the hold limit is the .NET-only bound named in the PR.

Base automatically changed from issue-1060-playwright-page-tests to main November 4, 2026 22:24
…utes

# Conflicts:
#	tests/E2E.Agent.Tests/PlaywrightRoutes.cs
#	tests/E2E.Agent.Tests/Testbed.cs
#	tests/E2E.NUnit.Tests/Helpers/Helpers.cs
@kblok

kblok commented Nov 4, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

…utes

# Conflicts:
#	tests/E2E.Agent.Tests/PlaywrightRoutes.cs
#	tests/E2E.Agent.Tests/Testbed.cs
#	tests/E2E.NUnit.Tests/Helpers/Helpers.cs
@kblok

kblok commented Nov 4, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

…utes

# Conflicts:
#	tests/E2E.Agent.Tests/PlaywrightRoutes.cs
#	tests/E2E.Agent.Tests/Testbed.cs
@kblok

kblok commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@kblok
kblok merged commit ce1d008 into main Nov 5, 2026
4 checks passed
@kblok
kblok deleted the issue-1060-network-routes branch November 5, 2026 13:32
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.

1 participant