Thanks to visit codestin.com
Credit goes to github.com

Skip to content

More robust playwright tests#13457

Open
jjspace wants to merge 6 commits into
mainfrom
more-robust-playwright
Open

More robust playwright tests#13457
jjspace wants to merge 6 commits into
mainfrom
more-robust-playwright

Conversation

@jjspace
Copy link
Copy Markdown
Contributor

@jjspace jjspace commented Apr 30, 2026

Description

While prepping for the release and running the e2e tests I got nerd sniped again by wishing they were more robust and reproducible. This PR includes a handful of changes, mostly to the sandcastle specs, that made the snapshots much more consistent on my machine. This is a slight follow up to #13381

  • swapped to --use-gl=vulkan as I believe most, if not all, of the team said this works cross platform and was annoying to continually do on linux where it was actually needed
  • Updated localstorage to hide the default cesium viewer controls so snapshots actually highlight the test itself
  • Added waiting for the sandcastle viewer page to be loaded before starting a spec
  • added special loading logic for sandcastles we know are slow to load or have fast animations
  • Fixed a handful of sandcastles themselves for errors or warnings in the console

These changes are still not perfect but in my testing only a small handful of specs actually fail or need re-run with these changes. So much so that I'm planning to open another PR right after this to actually commit snapshots to the repo as a reference point. No more "generate against the previous release" during the release! 🎉

Issue number and link

Testing plan

  • Run npm run test-e2e -- --ui and test running a number of specs of different types
  • Test the list of sandcastles with special handling in the specs file
  • Tests should consistently complete/pass and have the same snapshot (generated the first time you run if you didn't have one)

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 donmccurdy and jjhembd April 30, 2026 22:02
@github-actions
Copy link
Copy Markdown
Contributor

Thank you for the pull request, @jjspace!

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

@jjspace jjspace force-pushed the more-robust-playwright branch from b23a739 to af59516 Compare April 30, 2026 22:25
@jjspace jjspace changed the base branch from main to no-search-on-standalone April 30, 2026 22:27
Base automatically changed from no-search-on-standalone to main May 1, 2026 14:33
@jjspace
Copy link
Copy Markdown
Contributor Author

jjspace commented May 1, 2026

I noticed during the release that the sandcastle specs don't ignore development only sandcastles which may not exist. This can happen during release since npm run make-zip will exclude them. Probably need a flag for that or maybe a check to conditionally skip dev sandcastles if it detects it can't load. something to consider

Copy link
Copy Markdown
Member

@donmccurdy donmccurdy left a comment

Choose a reason for hiding this comment

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

After running npm run build-sandcastle I tried:

npm run test-e2e -- -g "3d-tiles-1.1-cdb-yemen|3d-tiles-gaussian-splatting|3d-tiles-gaussian-splats-with-lod|callback-position-property|callback-property|custom-primitive-dev|czml-path|manually-controlled-animation|material-with-custom-glsl|relative-paths|moon|multi-part-czml|particle-system|time-dynamic-wheels"

Result:

Image

Of the failures, about half exceeded the 100,000ms timeout. The other half had small (3–12%) pixel differences. I don't necessarily feel that any of this should block the PR if it's an improvement over current status, but wasn't sure if it was expected.

I also noticed that workers are disabled in playwright.config.js without. My results on these tests were similar (but faster) with workers turned back on — do we know of any reason that couldn't be on by default?

Comment thread Specs/e2e/models.spec.js
Comment on lines +84 to +86
await cesiumPage.page.clock.runFor(1000);
await cesiumPage.page.clock.runFor(1000);
await cesiumPage.page.clock.runFor(1000);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this different from runFor(3000)?

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.

The await should allow any completed promises to resolve. I believe simply sleeping the thread does not do so.

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.

The playwright runFor function is a little weird. It claims to "fast forward" any timing based functions. It seems like it should work with the viewer to process data but in my testing it's still a little flaky and doesn't actually advance time. Maybe it would work with a single 3000 instead of multiple, multiple were there before so I just kept it as I was tweaking things.

Comment thread Specs/e2e/sandcastle.spec.js
Comment thread Specs/e2e/sandcastle.spec.js
@jjspace
Copy link
Copy Markdown
Contributor Author

jjspace commented May 11, 2026

Of the failures, about half exceeded the 100,000ms timeout

@donmccurdy As long as the system is set up correctly I wouldn't expect any tests to hit the max timeout. Can you check the troubleshooting steps from the testing guide to make sure you're running them with the gpu?

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