You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make Playwright template navigation deterministic - #7604
The Playwright template now fulfills its sample pages with browser route interception. Navigation, title and link assertions, clicking, and URL assertions still run in a real browser, without depending on playwright.dev availability or load time. The template snapshot is updated to match.
The Playwright template test now uses a local test page instead of navigating to an external website. The page includes the title and “Get Started” link checked by the test, so those assertions continue to run against consistent content.
Review was skipped as selected files did not have any reviewable changes.
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 4e5b329f-9916-4bb2-8e93-04b353d114f0
Commits
Reviewing files that changed from the base of the PR and between 8593196 and e21e7d2.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The Playwright template test now intercepts requests to a local test domain and serves static HTML. It navigates to that domain instead of playwright.dev. The verified snapshot records the same change. Existing assertions remain unchanged.
Changes: Playwright template test
Layer / File(s)
Summary
Serve and verify the local test page src/TUnit.Templates/content/TUnit.Playwright/Tests.cs, tests/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Playwright._.verified/TUnit.Playwright/Tests.cs
The test serves static HTML for requests to https://tunit-playwright.test/** and navigates to the local URL. The snapshot reflects the change. Existing title, link, click, and URL assertions remain unchanged.
The template navigation is deterministic, with no identified merge-blocking issue.
Pre-merge checks: 5
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "Make Playwright template navigation deterministic" matches the main change. The PR makes the Playwright template use browser route interception to serve a local HTML page at https://tunit-p…
Linked Issues check
Directly linked issue #7601 requires deterministic Playwright template validation that does not depend on the public playwright.dev website. It also asks that the template keep useful examples, for ex…
Out of Scope Changes check
The whole-PR diff against the merge base changes two files only. These are the Playwright template test source and its instantiation snapshot. Both changes implement #7601. The route interception, loc…
Docstring Coverage
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Title check
Explanation
The title "Make Playwright template navigation deterministic" matches the main change. The PR makes the Playwright template use browser route interception to serve a local HTML page at https://tunit-playwright.test/**, so navigation no longer depends on the availability or load time of playwright.dev. The linked issue #7601 and the commit message describe the same goal.
Full details: Linked Issues check
Explanation
Directly linked issue #7601 requires deterministic Playwright template validation that does not depend on the public playwright.dev website. It also asks that the template keep useful examples, for example by serving local content. At head, src/TUnit.Templates/content/TUnit.Playwright/Tests.cs registers Page.RouteAsync("https://tunit-playwright.test/**", ...). The route fulfills requests with local HTML that has the title TUnit Playwright and a Get Started link with href="/docs/intro". Page.GotoAsync now targets https://tunit-playwright.test/, not https://playwright.dev. The retained checks match the template's examples. They check the title contains Playwright, the link href equals /docs/intro, the link click works, and the URL matches .*intro. The click target /docs/intro falls under the ** route, so the URL assertion still holds on the local content. The template snapshot file tests/TUnit.Templates.Tests/Snapshots/InstantiationTest.TUnit.Playwright._.verified/TUnit.Playwright/Tests.cs has the same diff as the template source, so it matches. The requirements are coding requirements. No public-website dependency remains in the changed test path. Test execution results reported in the PR description were not independently rerun.
Full details: Out of Scope Changes check
Explanation
The whole-PR diff against the merge base changes two files only. These are the Playwright template test source and its instantiation snapshot. Both changes implement #7601. The route interception, local HTML body, and new navigation URL replace the public-website navigation. The snapshot change keeps the verified output in sync with the template. No unrelated files or behavior changes appear in the diff. The other template files (GlobalSetup.cs, Hooks.cs, TwoContextFixtureTests.cs, TestProject.csproj) are unchanged.
Full details: Docstring Coverage
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files.
Finishing Touches
Generate docstrings
Commit to this branch
Create a new PR
Generate unit tests (beta)
Commit to this branch
Create a new PR
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.
A rabbit checks the page with care, A local link is waiting there. The title shines, the button too, No public site is needed to view. The rabbit hops; the tests run through.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: f8c6e51b-d307-4086-8090-54b0f7c0436b
Commits
Reviewing files that changed from the base of the PR and between 5cb7601 and 8593196.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.
The template test no longer depends on playwright.dev. Route interception serves the page, so the title, attribute, click and URL assertions still run in a real browser.
I checked that the click on /docs/intro resolves to https://tunit-playwright.test/docs/intro. The ** glob matches it, so the same HTML is served and the .*intro URL assertion passes. The snapshot matches the source file exactly.
Two optional suggestions:
The .test TLD is reserved (RFC 2606), so the URL can never collide with a real host. A one-line comment saying so would stop someone from 'fixing' it later.
Users copying this template may not realise it is a sandboxed example. The existing comment covers that well enough, so I'd leave it as is.
Both Claude and Codex approved head 85931965d886d7d3ae8348c56f7c33f4239bda49; there are no inline findings or review threads. Claude’s optional comment suggestion needs no code change because the existing comment already explains the sandboxed example.
Marked ready for review with the head unchanged. Waiting for the promotion-triggered Claude review run https://github.com/thomhurst/TUnit/actions/runs/41906608681 and CI. Auto-merge must be armed after that review passes and its findings are checked.
This makes the Playwright template test deterministic by routing https://tunit-playwright.test/** to an in-browser fulfilled page. I traced the flow:
The title assertion matches TUnit Playwright.
The href="/docs/intro" attribute assertion matches.
The click navigates to /docs/intro. The same ** route fulfills that request, so ToHaveURLAsync(.*intro) passes.
The template source and the verified snapshot are identical, as expected.
Minor, non-blocking: the template now teaches route mocking rather than a basic GotoAsync. The comment explains why, which is enough. If you want users to see a real-site example, you could mention in the comment that they can replace the route with a real URL.
The earlier blocker is cleared: Claude run 41906608681 passed, and the promoted head had positive Claude and Codex verdicts with no blocking findings or review threads.
Windows engine job 126842834984 in run 41906608124 instead reproduced #7554: reflection-mode Run and InstanceMethodDataSource_DoesNotReuseEnumerationInstance remained active for over seven minutes, and the deadline dump ended the child without a TRX report. This is unrelated to the two template files changed here. Main now includes #7606, which isolates the full passing session from sibling engine children and passed hosted Windows validation.
Rebased onto that fresh main in e21e7d2e7eb8cbd0c8e22268645ad1e783bdb302 without conflicts and pushed with an explicit lease. The Playwright template instantiation snapshot test passed (1/1, net10.0), and git diff --check passed. Engine.Tests were not run locally, as repository instructions require CI for them. Fresh CI and reviews must validate the new head before auto-merge is armed; earlier-head approvals are not reused. The existing body still closes #7601; no prerequisite or human decision remains to park this PR behind.
Routing the sample pages through Page.RouteAsync removes the dependency on playwright.dev. The test still exercises real navigation, locators, the click and URL assertion. The glob https://tunit-playwright.test/** also matches /docs/intro, so the click navigates to a routed page and ToHaveURLAsync(.*intro) passes. The .test TLD is reserved, so it can never resolve to a real host. The raw string literal indentation is valid, and the snapshot matches the template source.
Optional nit: the template is a starting point for users, so the comment could say that real tests would normally navigate to their own app and drop the routing. It's fine as is.
Run 41906608681 completed successfully; that earlier wait is cleared. Current head e21e7d2e7eb8cbd0c8e22268645ad1e783bdb302 has a positive Codex summary and Claude LGTM from run 41923402810. All review surfaces were checked: no inline findings or review threads, and Greptile/CodeRabbit have no blocking findings. Claude's optional comment suggestion needs no change: the existing comment already explains that the sample serves pages in the browser without a public website.
All current CI checks passed (including both hosted engine modes/platform jobs); the mechanical merge gate passed. No remaining prerequisite, replacement PR, or human decision is needed. Proceeding with the squash merge, which closes #7601.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Playwright template now fulfills its sample pages with browser route interception. Navigation, title and link assertions, clicking, and URL assertions still run in a real browser, without depending on playwright.dev availability or load time. The template snapshot is updated to match.
Validation:
Closes #7601
Summary by CodeRabbit