fix: prevent flake in environment-editor JSON input#9956
Conversation
There was a problem hiding this comment.
Pull request overview
This PR stabilizes the “manage environment” Playwright smoke test by changing how JSON is entered into the Environment Editor’s CodeMirror-based JSON modal, avoiding fill() (which can bypass CodeMirror’s key handling and lead to incorrect saved content).
Changes:
- Replace cursor movement +
locator.fill()with “select all” +page.keyboard.type()to ensure CodeMirror processes the input via key events. - Ensure the full JSON object (including braces) is typed into the JSON editor modal.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
✅ Circular References ReportGenerated at: 2026-05-28T04:31:32.737Z Summary
Click to view all circular references in PR (18)Click to view all circular references in base branch (18)Analysis✅ No Change: This PR does not introduce or remove any circular references. This report was generated automatically by comparing against the |
1452e1b to
0b833e8
Compare
fiosman
left a comment
There was a problem hiding this comment.
https://github.com/Kong/insomnia/actions/runs/26440164941/job/77887439182 on the latest CI run it appears that this e2e test is still failing
|
@fiosman I ran it 20 times before this change and it failed 5 times, I ran it 40 times after this change and it failed once. |
….type instead of fill .fill() bypasses CodeMirror's key event handlers, causing the JSON to be saved incorrectly when cursor position isn't exactly right. Select-all + keyboard.type() writes the complete valid JSON via key events that CodeMirror processes correctly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0b833e8 to
d315067
Compare
Summary
environment-editor-interactions.test.ts— "manage environment"bodyEditor.fill()bypassing CodeMirror's key event handlers; replacing it withControlOrMeta+a+page.keyboard.type()makes the JSON edit path behave like a real user editRationale
Test plan
🤖 Generated with Claude Code