-
Notifications
You must be signed in to change notification settings - Fork 30
Playwright tests use POST endpoints #14421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
+261
−127
Conversation
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
…log tests which passes live=true param
Ensures correct value is set for Edition from the forceful setting of the GU_EDITION cookie.
- rename article to feFixture in load-page - undo playwright.config changes used for testing - set local workers to 2 to improve stability
685a410
to
ff579ba
Compare
JamieB-gu
approved these changes
Aug 20, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this change?
We wish to remove the GET endpoints from the prod server as they aren't used in production and we don't use them for manual testing.
Background
Prod
In production Frontend will POST a JSON payload to DCR to render.
In production no GET endpoints are used.
Dev
The dev server configures both GET and POST handlers for each endpoint.
The GET endpoints allow us to conveniently load any page in a browser with a GET request such as:
http://localhost:3030/Article/https://www.theguardian.com/world/2025/aug/19/the-big-church-move-sweden-kiruna-kyrka
The GET endpoints will fetch the required payload from Frontend via the middleware
getContentFromURLMiddleware
and pass on to the normal rendering flow to render the page.dotcom-rendering/dotcom-rendering/src/server/server.dev.ts
Lines 92 to 125 in 1957de2
dotcom-rendering/dotcom-rendering/src/server/lib/get-content-from-url.ts
Lines 62 to 98 in 1957de2
Playwright
The Playwright tests use:
The Playwright tests (and previously Cypress) relied on the GET endpoints which offloaded the responsibility of fetching the Frontend JSON payload to DCR.
In order to remove the GET endpoints from the prod server, the Playwright tests now need to use the POST endpoints instead which are available on both the dev and prod servers.
This requires the Playwright utility
load-page.ts
to fetch the required content payload from Frontend itself and then POST to DCR.Why?
Reduce prod server surface area