fix: update @playwright/test to 1.59.1 and fix e2e tests#381
fix: update @playwright/test to 1.59.1 and fix e2e tests#381
Conversation
✅ Deploy Preview for eslint-code-explorer ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR updates Playwright to @playwright/test@1.59.1 and refactors e2e tests to interact with the CodeMirror editor more reliably after the upgrade.
Changes:
- Bumped
@playwright/test(and lockfile-resolvedplaywright/playwright-core) to1.59.1. - Added a shared CodeMirror editor helper for e2e tests.
- Updated affected e2e tests to replace editor contents via
fill()rather than keyboard-driven select-all/delete.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| package.json | Updates @playwright/test devDependency version to ^1.59.1. |
| package-lock.json | Aligns resolved Playwright packages (@playwright/test, playwright, playwright-core) to 1.59.1. |
| e2e-tests/helpers/code-editor.ts | Introduces shared helpers to locate and replace CodeMirror editor content in tests. |
| e2e-tests/persistence.test.ts | Uses the shared helper to reliably set/assert editor content during hash/localStorage persistence flows. |
| e2e-tests/code-editing-and-ast-interaction.test.ts | Uses the shared helper for deterministic editor updates during AST + ESQuery interactions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| .getByRole("textbox") | ||
| .last(); |
There was a problem hiding this comment.
getCodeEditor() currently selects the last textbox within the "Code Editor Panel" region. Since the panel already contains multiple textboxes (e.g. the ESQuery selector) and could gain more over time, this selector is brittle and may start pointing at the wrong element. Prefer selecting the editor by its accessible name (the CodeMirror component sets aria-label="Code Editor"), e.g. query the textbox with name "Code Editor" (optionally still scoped to the region).
| .getByRole("textbox") | |
| .last(); | |
| .getByRole("textbox", { name: "Code Editor" }); |
Prerequisites checklist
AI acknowledgment
What is the purpose of this pull request?
This PR updates
@playwright/testto 1.59.1 and fixes the e2e tests that became unreliable after the upgrade.The failing tests were using keyboard-driven select-all and delete behavior inside the CodeMirror editor. After the Playwright update, that interaction no longer behaved consistently across browsers, especially in WebKit, so the default sample code was not always fully replaced before assertions ran.
What changes did you make? (Give an overview)
@playwright/testto1.59.1fill()instead of relying onCtrl/Cmd+Afollowed byBackspace.Related Issues
#380
Is there anything you'd like reviewers to focus on?