Skip to content

Switch playwright over to the new sandcastle#13381

Merged
lukemckinstry merged 2 commits intomainfrom
new-sandcastle-e2e
Apr 10, 2026
Merged

Switch playwright over to the new sandcastle#13381
lukemckinstry merged 2 commits intomainfrom
new-sandcastle-e2e

Conversation

@jjspace
Copy link
Copy Markdown
Contributor

@jjspace jjspace commented Apr 8, 2026

Description

Switches the sandcastle e2e tests over to use the new Sandcastle's standalone page.

  • Finds sandcastles in the gallery and loads them by id/slug in the standard standalone page
  • For ease of configuration it is not currently possible to run e2e tests and the local dev server at the same time. There's a couple ways it might be possible to enable this but it felt beyond the scope of this change
  • Included a config update for chromium to account for the new chromium headless mode. We've already been running this version because playwright doesn't do semver fully. (Fix issues with end-to-end tests #12653)

There is still a potential for inconsistencies between test runs or on different systems. There's many more things we could probably do to improve the e2e tests overall but that was beyond the scope of this PR. If cused only on switching to the new Sandcastle and gallery which is the only remaining blocker for removing the legacy sandcastle

Issue number and link

Part of #12894

Testing plan

  • Run npm run test-e2e and make sure the sandcastle tests are running and (hopefully) passing
    • You may need to run npm run test-e2e-update to generate snapshots if you don't already have some saved
  • You can also run npx playwright test -c Specs/e2e/playwright.config.js --project=chromium --ui to have a more interactive

Author checklist

  • I have submitted a Contributor License Agreement
  • I have added my name to CONTRIBUTORS.md
  • I have updated CHANGES.md with a short summary of my change
  • I have added or updated unit tests to ensure consistent code coverage
  • I have updated the inline documentation, and included code examples where relevant
  • I have performed a self-review of my code

AI acknowledgment

  • I used AI to generate content in this PR
  • If yes, I have reviewed the AI-generated content before submitting

If yes, I used the following Tools(s) and/or Service(s):

If yes, I used the following Model(s):

@jjspace jjspace requested review from jjhembd and lukemckinstry April 8, 2026 17:24
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 8, 2026

Thank you for the pull request, @jjspace!

✅ We can confirm we have a CLA on file for you.

@jjhembd
Copy link
Copy Markdown
Contributor

jjhembd commented Apr 8, 2026

@jjspace I still get this:
3d-models-coloring-renders-1-chromium-linux

@lukemckinstry
Copy link
Copy Markdown
Contributor

lukemckinstry commented Apr 8, 2026

@jjspace I still get this:

I tried adding these troubleshooting steps shared with me during the last release to the testing guide
https://github.com/CesiumGS/cesium/pull/13358/changes#diff-8f9a48894d3ae00fc7ec84434881fa4868c4f1fb451a4cf995f3b1ae86cdad46R358

I believe these apply to you @jjhembd as well using Linux Chrome.

@jjhembd
Copy link
Copy Markdown
Contributor

jjhembd commented Apr 8, 2026

@lukemckinstry I get the same result with that config.
Also, if the current config doesn't work for me or you (without modification), is it the right config?
If we can't get a config that works for everyone, I think we need to confirm that the starting config is the one that works for the most common setups.

Copy link
Copy Markdown
Contributor

@lukemckinstry lukemckinstry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The e2e tests generate correctly. A few questions and suggestions.

Comment thread Documentation/Contributors/TestingGuide/README.md Outdated
- `--project="webkit"` - Test only webkit. Can also use `chromium` or `firefox` to test against those browsers.
- `-g <grep>` or `--grep <grep>` - Run only tests that match a regular expression.
- `--grep-invert <grep>` - Run only tests that don't match a regular expression.
- `--ui` - Launch a test browser to view and run specific tests. Note it's not perfect with dynamic canvases but it's still helpful
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npx playwright test -c Specs/e2e/playwright.config.js --project=chromium --ui seems to be a blank controller for me

Image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to click the Play triangle on a test to run them, individually or a whole nested section in the tree on the left.

name: "chromium",
use: {
...devices["Desktop Chrome"],
channel: "chromium",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to set this to chrome (in addition to swapping in args: ["--use-angle=vulkan"], for args: ["--use-angle=gl"], for the tests to generate correctly

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want this to be chromium for the new headless mode. If that's not working for you for some reason we should track down why

// Check if hardware acceleration is enabled. Without it, our tests will be much slower.
test("GPU hardware acceleration", async ({ page }) => {
await page.goto(chromeGpu);
test("Hardware accelleration check - Chrome", async ({ page }, testInfo) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these changes tied to the playwright update?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is just an updated version of this helper script that can be used to debug the playwright setup itself

@lukemckinstry lukemckinstry self-requested a review April 10, 2026 18:37
Copy link
Copy Markdown
Contributor

@lukemckinstry lukemckinstry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and works as expected 👍

@lukemckinstry lukemckinstry added this pull request to the merge queue Apr 10, 2026
Merged via the queue into main with commit 768b78e Apr 10, 2026
8 of 9 checks passed
@lukemckinstry lukemckinstry deleted the new-sandcastle-e2e branch April 10, 2026 18:38
@jjspace jjspace mentioned this pull request Apr 13, 2026
8 tasks
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.

3 participants