Skip to content

Improves E2E test reset to dismiss lingering notifications#5103

Merged
nikolay-1986 merged 2 commits intomainfrom
bug/e2e-org-auth-toast-notification
Apr 3, 2026
Merged

Improves E2E test reset to dismiss lingering notifications#5103
nikolay-1986 merged 2 commits intomainfrom
bug/e2e-org-auth-toast-notification

Conversation

@nikolay-1986
Copy link
Copy Markdown
Collaborator

@nikolay-1986 nikolay-1986 commented Apr 3, 2026

Summary

  • Adds notifications.clearAll to VSCodePage.resetUI() so stray VS Code toast notifications (e.g. org auth errors triggered by the Home webview) cannot intercept pointer events in subsequent E2E tests
  • Guards the call with .catch(() => {}) to prevent a missing command registration from breaking test cleanup

Root Cause

Serial E2E tests share one VS Code worker. When the Home webview is open during smoke tests, SubscriptionService triggers getOrganizations() on subscription changes — which shows an "Unable to get organizations" toast when no auth session is active. This toast overlaps the editor area and intercepts pointer events, causing blame.test.ts clicks to fail with "subtree intercepts pointer events".

The resetUI() call in beforeEach now dismisses all pending notifications, preventing carry-over between tests.

Note: The underlying org auth toast behavior (showing an error for an expected unauthenticated state) is tracked separately in #5104.

Test plan

  • All 110 E2E tests pass locally (1 skipped — drag-and-drop, unrelated)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR prevents an expected unauthenticated background fetch from surfacing as a user-facing error toast, and hardens E2E stability by clearing lingering VS Code notifications between tests.

Changes:

  • Suppress window.showErrorMessage in OrganizationService.getOrganizations() when the failure is AuthenticationRequiredError.
  • Clear all VS Code notifications as part of VSCodePage.resetUI() to avoid toasts intercepting pointer events in later E2E steps.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/plus/gk/organizationService.ts Avoids showing a toast for expected AuthenticationRequiredError during background organization fetch.
tests/e2e/pageObjects/vscodePage.ts Clears notifications during E2E UI reset to reduce flakiness caused by lingering toasts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Apr 3, 2026

🤖 Augment PR Summary

Summary: Prevents a user-facing auth error toast when organizations are fetched in the background without an active session.
Also clears all VS Code notifications during E2E resetUI() to avoid lingering toasts intercepting UI interactions between tests.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Adds notification dismissal to resetUI() so that stray VS Code toasts
(e.g. org auth errors) cannot intercept pointer events in subsequent tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Wraps the notifications.clearAll call in resetUI() with .catch(() => {})
so a missing command registration cannot break test cleanup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nikolay-1986 nikolay-1986 changed the title Fixes authentication error toast appearing during background organization fetch Improves E2E test reset to dismiss lingering notifications Apr 3, 2026
@nikolay-1986 nikolay-1986 requested a review from Copilot April 3, 2026 09:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nikolay-1986 nikolay-1986 merged commit 7115e39 into main Apr 3, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants