-
-
Notifications
You must be signed in to change notification settings - Fork 9
test: setup E2E testing via Playwright and implement some tests #88
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
base: main
Are you sure you want to change the base?
Conversation
This reverts commit a0a79dd.
✅ Deploy Preview for eslint-code-explorer ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Thanks for getting this started. I don't have time to dig in right now. I'm also not super familiar with this kind of setup, so could use some advice from the rest of the team. @eslint/eslint-team |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 51 out of 52 changed files in this pull request and generated no comments.
Files not reviewed (1)
- package.json: Language not supported
Comments suppressed due to low confidence (2)
src/components/ui/popover.tsx:27
- [nitpick] Verify that the use of role 'dialog' on PopoverContent is semantically correct for a popover component; if the component is used to display menus or tips rather than modal dialogs, a different role may be more appropriate.
role="dialog"
src/components/tree-entry.tsx:109
- Ensure that the li element is nested within a ul or ol element to maintain proper HTML semantics.
<li className="flex items-center gap-3">
I'm familiar with such setup, will review this pr |
@snitin315 friendly ping to not forget about this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pkerschbaum Are we not running Docker in CI? If that's the case, it kind of defeats the purpose of using Docker, since the CI environment would always be inconsistent.
It is always - locally and in CI - running via Docker. |
@pkerschbaum can you take a look at the merge conflicts? |
I tried running this locally and got this error: > [email protected] test:e2e
> cross-env PW_TEST_CONNECT_WS_ENDPOINT=ws://127.0.0.1:3000/ playwright test
[WebServer] Unable to find image 'mcr.microsoft.com/playwright:v1.51.1-noble' locally
[WebServer] v1.51.1-noble:
[WebServer] Pulling from playwright
[WebServer] 107a4fb0af38: Pulling fs layer
[WebServer] 8c401718c984: Pulling fs layer
[WebServer] 39224aba52ce: Pulling fs layer
[WebServer] 08d1cdd3adad: Pulling fs layer
[WebServer] 08d1cdd3adad: Waiting
[WebServer] 39224aba52ce:
[WebServer] Verifying Checksum
[WebServer] 39224aba52ce: Download complete
[WebServer] 107a4fb0af38:
[WebServer] Verifying Checksum
[WebServer] 107a4fb0af38: Download complete
[WebServer] 8c401718c984: Download complete
[WebServer] 107a4fb0af38: Pull complete
[WebServer] 8c401718c984:
[WebServer] Pull complete
[WebServer] 39224aba52ce:
[WebServer] Pull complete
Error: Timed out waiting 60000ms from config.webServer.
To open last HTML report run:
npx playwright show-report I'm running Windows 11. |
reporter: process.env.CI ? [["html"], ["github"]] : "html", | ||
|
||
use: { | ||
baseURL: `http://${process.env.CI ? "localhost" : "host.docker.internal"}:5173`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need a more specific check because env vars are always string values.
baseURL: `http://${process.env.CI ? "localhost" : "host.docker.internal"}:5173`, | |
baseURL: `http://${process.env.CI === "true" ? "localhost" : "host.docker.internal"}:5173`, |
Also as per this check we are running locally on CI and docker in local dev
Prerequisites checklist
What is the purpose of this pull request?
Introduces End-to-End (E2E) testing using Playwright to prevent regressions and increase confidence during development and refactoring.
What changes did you make? (Give an overview)
toHaveScreenshot
.Is there anything you'd like reviewers to focus on?
Notes on using Docker
The new requirement, having Docker installed, is quite heavy...
Thing is that otherwise, screenshots created by screenshot assertions (
toHaveScreenshot
) are not consistent, leading to flaky behavior.As noted by Playwright:
Alternatives to Docker considered:
Notes on using Playwright compared to other options
expect
APIs of Playwright are just great; Playwright produces a great report which is expecially useful in CI, ...)Successful CI run: https://github.com/eslint/code-explorer/actions/runs/14296315788