-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add notifications UI and add integration test (#5286)
✨ (appHeaderComponent/index.tsx): Refactor AppHeader component to use AlertDropdown for notifications and improve user interaction with notifications tab ✅ (notifications.spec.ts): Add end-to-end test for user interaction with notifications tab in the frontend application
- Loading branch information
1 parent
ddb53ab
commit 0bdf317
Showing
2 changed files
with
92 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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
65 changes: 65 additions & 0 deletions
65
src/frontend/tests/extended/features/notifications.spec.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import { expect, test } from "@playwright/test"; | ||
import { awaitBootstrapTest } from "../../utils/await-bootstrap-test"; | ||
|
||
test( | ||
"User should be able to interact notifications tab", | ||
{ tag: ["@release"] }, | ||
async ({ page }) => { | ||
await awaitBootstrapTest(page); | ||
await page.getByTestId("blank-flow").click(); | ||
await page.waitForSelector('[data-testid="disclosure-inputs"]', { | ||
timeout: 3000, | ||
state: "visible", | ||
}); | ||
|
||
await page.getByTestId("disclosure-inputs").click(); | ||
await page.waitForSelector('[data-testid="inputsChat Input"]', { | ||
timeout: 3000, | ||
state: "visible", | ||
}); | ||
await page | ||
.getByTestId("inputsChat Input") | ||
.hover() | ||
.then(async () => { | ||
await page.getByTestId("add-component-button-chat-input").click(); | ||
await page.getByTestId("button_run_chat input").click(); | ||
}); | ||
|
||
await page.waitForSelector("text=built successfully", { timeout: 30000 }); | ||
|
||
await page.getByText("built successfully").last().click({ | ||
timeout: 15000, | ||
}); | ||
|
||
await page.getByTestId("notification_button").click(); | ||
|
||
// Add explicit waits before checking visibility | ||
await page.waitForSelector('[data-testid="icon-Trash2"]', { | ||
timeout: 3000, | ||
state: "visible", | ||
}); | ||
|
||
await page.waitForSelector("text=Running components", { | ||
timeout: 30000, | ||
state: "visible", | ||
}); | ||
// Then check visibility | ||
const notificationsText = page | ||
.getByText("Notifications", { exact: true }) | ||
.last(); | ||
await expect(notificationsText).toBeVisible(); | ||
|
||
const trashIcon = page.getByTestId("icon-Trash2").last(); | ||
await expect(trashIcon).toBeVisible(); | ||
|
||
const runningComponentsText = page | ||
.getByText("Running components", { exact: true }) | ||
.last(); | ||
await expect(runningComponentsText).toBeVisible(); | ||
|
||
const builtSuccessfullyText = page | ||
.getByText("Chat Input built successfully", { exact: true }) | ||
.last(); | ||
await expect(builtSuccessfullyText).toBeVisible(); | ||
}, | ||
); |