Conversation
|
Build successful! 🎉 |
|
Build successful! 🎉 |
LFDanLu
left a comment
There was a problem hiding this comment.
Happy to merge it in as is, we can discuss how specifics like run cadence, CI, and what tests to use this for after playing around with more test scenarios. Also curious if this easily extends to the more classic kind of browser tests where we send it to a page/build instead of calling render on our own written test case
| "start:mcp": "yarn workspace @react-spectrum/s2-docs generate:md && yarn build:mcp && node packages/dev/mcp/s2/dist/index.js && node packages/dev/mcp/react-aria/dist/index.js", | ||
| "test:mcp": "yarn build:s2-docs && yarn build:mcp && node packages/dev/mcp/scripts/smoke-list-pages.mjs", | ||
| "test": "cross-env STRICT_MODE=1 VIRT_ON=1 yarn jest", | ||
| "test:browser": "vitest --config=vitest.browser.config.ts", |
There was a problem hiding this comment.
looks like we need to run yarn playwright install to download chromium and other browsers before this works. I assume we'd want to be as up to date as possible (and thus download fresh on every run?) but track what versions failed when that happens for browser specific bug logging. Alternatively we could store the browser builds somewhere I'd imagine and update only when desired
There was a problem hiding this comment.
a bit unfortunate that we still have to mock/dispatch events here
There was a problem hiding this comment.
I noticed that the tests were being run at a mobile device screen resolution, would be nice to have it run in desktop widths as well automatically. Also I assume there is the ability to run headless as well?
Adds setup for using Vitest Browser Mode to run certain tests in real browsers (Chromium, Firefox, and WebKit).
Tests with the
*.browser.test.{ts,tsx}pattern get run when runningyarn test:browser.Notes:
jsdom. We can still rely on Chromatic for basic browser rendering.DropZone.browser.test.tsxto get us started. Unfortunately, I noticed our drag and drop events don't work withuserEvent.dragAndDropin Chromium because of how Playwright interfaces with Chromium, so I made a utility that falls back to manually firing the DragEvents in the expected order. Hopefully we don't have too many things like this to custom handle.✅ Pull Request Checklist:
📝 Test Instructions:
Run
yarn test:browseroryarn test:browser runto run without watch mode.🧢 Your Project: