Repository navigation
Dismiss VS Code E2E notifications without depending on hover - #21565
Ankit Jain (radical) merged 2 commits into
Conversation
VS Code only displays a notification toast's clear action while the toast is hovered or focused. Notification.dismiss() from page-objects hovers the toast, waits for the action to be visible and then clicks it. Toasts re-layout when another notification arrives or expires, so the toast can move out from under the pointer between the visibility check and the click, hiding the action and failing the click with ElementNotInteractableError. dismissAllNotifications (and the edge-case Python setup notification) now click the toast's clear action through a script, which does not depend on the pointer position. dismissAllNotifications still polls until no toasts remain. Co-authored-by: Copilot <[email protected]>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21565Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21565" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the change to dismiss notification toasts without hover-dependent controls.
No open issues 🎉
What changed in this PR
This PR addresses intermittent VS Code extension E2E failures by dismissing notification toasts without relying on hover-dependent controls.
Changes:
- Adds a shared dismissal helper that clicks the clear action through script execution while preserving polling until no toasts remain.
- Updates the notification interface and edge-case test to use the new helper.
- Adds a regression test and supporting stub for dismissal without hover.
| File | Description |
|---|---|
extension/src/test/notificationWaitForMessage.test.ts |
Adds regression coverage for hover-independent dismissal. |
extension/src/test/fixtures/e2e-notification-extester-stub.ts |
Models notification actions and script-dispatched clicks. |
extension/src/test-e2e/helpers/vscode.ts |
Adds the dismissal helper and integrates it into notification cleanup. |
extension/src/test-e2e/helpers/extester.ts |
Exposes element lookup on the notification interface. |
extension/src/test-e2e/edgeCases.e2e.test.ts |
Replaces direct dismissal with the shared helper. |
Review effort: Balanced
|
CI evidence for exact head
🤖 Posted by AspireAgent (AI Agent) |
Jose Perez Rodriguez (joperezr)
left a comment
There was a problem hiding this comment.
The change preserves the debugger-guidance assertion and keeps notification cleanup bounded; it does not weaken the behavior this scenario protects. Approving the test-reliability aspect. The outstanding request from Ella to use notifications.clearAll through the E2E bridge remains for the author and maintainer to address before deciding merge readiness; this approval does not resolve or supersede that feedback.
Address review feedback: instead of clicking a toast's clear action (which VS Code only shows while the toast is hovered), dismissAllNotifications asks the E2E bridge to run notifications.clearAll and keeps its bounded retry until no notifications remain. The Python hint test asserts its message and then uses the same helper, so the single-notification helper is removed. Co-authored-by: Copilot <[email protected]>
Tests selector0 / 101 PR test projects · 2 PR jobs, from 6 changed files. Selected PR test projects (0 / 101)none — no PR-gated .NET test projects run for this change. Selected PR jobs (2)
How these were chosen — grouped by what changedJob reasons
Selection computed for commit |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
✅ No documentation update needed. docs_optional → test_only. No signals triggered. All changed files are VS Code extension E2E test code and test-only helpers ( |
## Description Fixes an intermittent failure in the VS Code extension tests, not a bug in Aspire itself. The tests close notifications to clear the screen. Previously, they moved the mouse over a notification and clicked its close button. If another notification appeared or expired, the notification could move away from the mouse and hide the button before the click. The test would then fail with `ElementNotInteractableError`, even though the feature being tested had worked. The tests now ask VS Code to clear all notifications through the E2E bridge, which runs VS Code's `notifications.clearAll` command, instead of clicking a notification. Cleanup keeps its bounded retry until no notifications remain. The Python debugger setup test checks its message and then uses the same cleanup. No feature assertions are weakened, and no new dependencies are required. Adds unit tests: one checks that cleanup goes through the bridge's clear-all action when a notification can't be clicked, and one checks that the bridge action runs `notifications.clearAll`. They don't recreate the browser timing race. Fixes #21742 Validation: CI for the current head is pending. The notification cleanup unit tests passed locally and fail against the old hover-based cleanup. The bridge dispatch test needs the VS Code test host, which couldn't be downloaded locally, so it relies on CI. ## Checklist - Is this feature complete? - [x] Yes. Ready to ship. - [ ] No. Follow-up changes expected. - Are you including unit tests for the changes and scenario tests if relevant? - [x] Yes - [ ] No - Did you add public API? - [ ] Yes - If yes, did you have an API Review for it? - [ ] Yes - [ ] No - Did you add `<remarks />` and `<code />` elements on your triple slash comments? - [ ] Yes - [ ] No - [x] No - Does the change make any security assumptions or guarantees? - [ ] Yes - If yes, have you done a threat model and had a security review? - [ ] Yes - [ ] No - [x] No --------- Co-authored-by: davidfowl <[email protected]> Co-authored-by: Copilot <[email protected]> (cherry picked from commit af45278)
## Description Fixes an intermittent failure in the VS Code extension tests, not a bug in Aspire itself. The tests close notifications to clear the screen. Previously, they moved the mouse over a notification and clicked its close button. If another notification appeared or expired, the notification could move away from the mouse and hide the button before the click. The test would then fail with `ElementNotInteractableError`, even though the feature being tested had worked. The tests now ask VS Code to clear all notifications through the E2E bridge, which runs VS Code's `notifications.clearAll` command, instead of clicking a notification. Cleanup keeps its bounded retry until no notifications remain. The Python debugger setup test checks its message and then uses the same cleanup. No feature assertions are weakened, and no new dependencies are required. Adds unit tests: one checks that cleanup goes through the bridge's clear-all action when a notification can't be clicked, and one checks that the bridge action runs `notifications.clearAll`. They don't recreate the browser timing race. Fixes #21742 Validation: CI for the current head is pending. The notification cleanup unit tests passed locally and fail against the old hover-based cleanup. The bridge dispatch test needs the VS Code test host, which couldn't be downloaded locally, so it relies on CI. ## Checklist - Is this feature complete? - [x] Yes. Ready to ship. - [ ] No. Follow-up changes expected. - Are you including unit tests for the changes and scenario tests if relevant? - [x] Yes - [ ] No - Did you add public API? - [ ] Yes - If yes, did you have an API Review for it? - [ ] Yes - [ ] No - Did you add `<remarks />` and `<code />` elements on your triple slash comments? - [ ] Yes - [ ] No - [x] No - Does the change make any security assumptions or guarantees? - [ ] Yes - If yes, have you done a threat model and had a security review? - [ ] Yes - [ ] No - [x] No --------- Co-authored-by: davidfowl <[email protected]> Co-authored-by: Copilot <[email protected]> (cherry picked from commit af45278)
## Description Backport of #21565 to `release/17.0` (source commit `af4527806f2e09424b40e72ab80895fffe82b02f`). The release branch's Windows diagnostic-log E2E scenario fails while clearing a notification: the toast's clear-button click at `(11,11)` is intercepted by the VS Code titlebar. This prevents the scenario from reliably exercising the current CLI and AppHost log actions. This exact six-file backport uses the existing E2E control bridge to invoke VS Code's `notifications.clearAll`, rather than clicking the toast. Cleanup remains bounded; the feature assertions remain intact. Behavioral tests cover an unclickable toast and bridge command dispatch. No skips, quarantine, added retries, timeout increases, dependency changes, or workflow changes. Related: #22241; original source issue #21742. Failure evidence: [release/17.0 push CI, attempt 1, Windows diagnostic-logs job](https://github.com/microsoft/aspire/actions/runs/43537211054/job/132276516754), commit `a509f094e0ee87d17dc0e1cc9bca84f7ca2623da`. That source failure branch determines the PR base. The earlier backport #22009 is closed and unmerged; this PR does not modify or reopen it. ### Customer Impact Release-branch CI can fail during notification cleanup rather than testing diagnostic-log behavior. This is an E2E reliability fix, not a change to the shipped log actions or notification UI. Screenshots are not applicable to this test-control change. ### Testing The following results were obtained in a prior isolated Linux validation on the exact target commit above with this exact source patch; they are reused here, not presented as new executions: | Command (from `extension/` unless noted) | Result | | --- | --- | | `corepack yarn run compile-tests` | Passed, including recompilation after restoring the fix. | | `corepack yarn exec mocha -- --ui tdd out/test/notificationWaitForMessage.test.js --grep 'dismisses notifications through VS Code clear-all'` | Expected failure with the original `notifications[0].dismiss()` restored and the new test retained: 0 passed, 1 failed with `ElementNotInteractableError`. This is a behavioral regression proof, not an actual Windows reproduction. | | `corepack yarn run compile-e2e` | Passed. | | `corepack yarn run compile-tests` followed by `corepack yarn exec mocha -- --ui tdd out/test/notificationWaitForMessage.test.js` | Passed: 9 tests with the fix restored. Recompilation is needed because the E2E compiler replaces shared output. | | `corepack yarn exec eslint -- src/test-e2e/helpers/vscode.ts src/test-e2e/edgeCases.e2e.test.ts src/test/e2eStateFileBridge.test.ts src/test/notificationWaitForMessage.test.ts src/testing/e2eStateFileBridge.ts src/types/extensionApi.ts` | Passed. | | `git diff --exit-code && git diff --cached --check` (repository root) | Passed; only the exact source patch was staged. | For this PR preparation, `git cherry-pick --no-commit af45278` and `git diff --cached --check` passed again on the same target. **Current-head validation:** [CI run 43689787525](https://github.com/microsoft/aspire/actions/runs/43689787525) completed successfully at `58e2a9ea9fe792491c87dce7a723b389f3b816b7`. Windows diagnostic-logs passed 2/2, edge-cases 6/6, tree-actions 7/7, and VS Code-hosted unit tests passed 4,153 with 9 pre-existing pending tests. The required `Final Results` check passes. Independent review of this exact head passed; there are no unresolved review threads. Attempt 1 required workflow approval and ran no tests. Attempt 2 exposed existing release-branch tree URL readiness, global fake-timer, and ARM64 packaging failures; attempt 3 completed successfully. The earlier failures remain part of the CI record, not evidence of first-attempt reliability or branch recovery. Notification cleanup does not change resource URL snapshots; the timer tests use the pre-existing global fake clock. Separate fixes already on main address those tree/timer races and are not folded into this backport. The existing test-selection map routes `extension/**` to extension unit and E2E jobs; no routing change is needed. The current release tip `6a7a7c49dc62640bc28cb6f9e613422540380206` has no `extension/` changes relative to the tested base. Human review and shiproom approval remain required. A later eligible scheduled/push CI run exercising the merged fix is required before declaring branch recovery. ### Risk Low: the change is confined to E2E notification cleanup and its existing test-control bridge. It preserves bounded cleanup and the diagnostic-log assertions. Windows and hosted validation passed at the PR head. ### Regression? Unknown: the failure and matching main-branch fix are established, but the introducing version or commit is not. ## Checklist - Is this feature complete? - [x] Yes. Ready to ship. - [ ] No. Follow-up changes expected. - Are you including unit tests for the changes and scenario tests if relevant? - [x] Yes - [ ] No - Did you add public API? - [ ] Yes - If yes, did you have an API Review for it? - [ ] Yes - [ ] No - Did you add `<remarks />` and `<code />` elements on your triple slash comments? - [ ] Yes - [ ] No - [x] No - Does the change make any security assumptions or guarantees? - [ ] Yes - If yes, have you done a threat model and had a security review? - [ ] Yes - [ ] No - [x] No <!-- ci-health:work:release17-diagnostic-logs-windows --> <!-- ci-health:worker:v1 --> 🤖 AspireAssistant Co-authored-by: radical <[email protected]> Co-authored-by: Copilot <[email protected]>
Description
Fixes an intermittent failure in the VS Code extension tests, not a bug in Aspire itself.
The tests close notifications to clear the screen. Previously, they moved the mouse over a notification and clicked its close button. If another notification appeared or expired, the notification could move away from the mouse and hide the button before the click. The test would then fail with
ElementNotInteractableError, even though the feature being tested had worked.The tests now ask VS Code to clear all notifications through the E2E bridge, which runs VS Code's
notifications.clearAllcommand, instead of clicking a notification. Cleanup keeps its bounded retry until no notifications remain. The Python debugger setup test checks its message and then uses the same cleanup. No feature assertions are weakened, and no new dependencies are required.Adds unit tests: one checks that cleanup goes through the bridge's clear-all action when a notification can't be clicked, and one checks that the bridge action runs
notifications.clearAll. They don't recreate the browser timing race.Fixes #21742
Validation: CI for the current head is pending. The notification cleanup unit tests passed locally and fail against the old hover-based cleanup. The bridge dispatch test needs the VS Code test host, which couldn't be downloaded locally, so it relies on CI.
Checklist
<remarks />and<code />elements on your triple slash comments?