Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to reduce E2E flakiness in packages/app by replacing timing-based waits and force clicks with more deterministic polling/assertions and more resilient UI interaction helpers.
Changes:
- Refactors multiple E2E specs to use
expect.poll(...), stronger visibility/selection assertions, and more stable locators. - Updates shared E2E helpers (
actions.ts) to improve menu/popover opening behavior and session waiting. - Aligns E2E selectors with current UI attributes (e.g., model variant control
data-action).
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/app/e2e/thinking-level.spec.ts | Makes model-variant cycling deterministic by selecting an explicit next option instead of “text changed”. |
| packages/app/e2e/terminal/terminal-tabs.spec.ts | Adds state-based polling and stronger selection assertions to reduce terminal tab flake. |
| packages/app/e2e/terminal/terminal-init.spec.ts | Ensures focus is restored to the prompt before keybind-driven terminal creation. |
| packages/app/e2e/status/status-popover.spec.ts | Adds a polling-based tab picker to avoid races when switching status popover tabs. |
| packages/app/e2e/settings/settings.spec.ts | Introduces helpers for localStorage/CSS reads and replaces fixed delays with polling/assertions. |
| packages/app/e2e/settings/settings-keybinds.spec.ts | Refactors repeated keybind-setting logic into helpers and replaces fixed delays with polling/assertions. |
| packages/app/e2e/session/session-model-persistence.spec.ts | Increases timeout and adds a poll to ensure model changes are observed before assertions. |
| packages/app/e2e/session/session-composer-dock.spec.ts | Refactors permission-flow tests to rely on reloads and removes a prior “pending resolved” sync hook. |
| packages/app/e2e/selectors.ts | Updates the model variant selector to match current UI data-action. |
| packages/app/e2e/projects/workspaces.spec.ts | Removes forced menu clicks in favor of improved menu interaction helper behavior. |
| packages/app/e2e/projects/workspace-new-session.spec.ts | Removes forced click and adds readiness waits to stabilize post-session creation interactions. |
| packages/app/e2e/projects/projects-switch.spec.ts | Removes forced clicks for switching projects/sessions. |
| packages/app/e2e/projects/projects-close.spec.ts | Removes forced click when closing a project from its menu. |
| packages/app/e2e/files/file-open.spec.ts | Uses an explicit tab role/name assertion for opened file verification. |
| packages/app/e2e/actions.ts | Strengthens settings/menu/popover helpers, improves click fallbacks, and extends waitSession timeout/logic. |
Comments suppressed due to low confidence (1)
packages/app/e2e/session/session-composer-dock.spec.ts:263
withMockPermissionno longer provides a synchronization point to ensure the mocked permission reply request has actually been observed/handled (i.e.,pendingdrained) before the callback returns and routes are unregistered. This can race with the immediatepage.reload()in callers: the reload can cancel the reply request, leavingpendingunchanged and causing the next reload to still show the permission dock, or causing subsequent requests to hit the real backend afterunroute. Consider restoring an explicit “wait until pending is empty / reply request completed” step (either insidewithMockPermissionor exposed to callers) before reloading and before unroute cleanup runs.
try {
return await fn()
} finally {
await page.unroute(listUrl, list)
for (const item of replyUrls) {
await page.unroute(item, reply)
}
if (sessionList) await page.unroute("**/session?*", sessionList)
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…s-tests-yessssirrrrrrrrrrrrrrrrrrrrrrrrrrr
…s-tests-yessssirrrrrrrrrrrrrrrrrrrrrrrrrrr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.