Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions tests/e2e/notifications.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { test, expect } from "@playwright/test";

test.describe("Notification Bell", () => {
test.beforeEach(async ({ page }) => {
await page.addInitScript(() => {
localStorage.setItem("onboarding_tour_dismissed", "1");
});

await page.goto("/");
});

test("should open notification dropdown, mark one read, and decrement unread count", async ({ page }) => {
const connectButton = page.getByRole("button", { name: /Connect Wallet/i }).first();
await expect(connectButton).toBeVisible();
await connectButton.click();
await expect(page.getByText(/Connected/i).first()).toBeVisible();

await page.goto("/en/causes/1");
await expect(page.getByRole("heading", { name: /Clean Water/i })).toBeVisible({ timeout: 10000 });

const fundButton = page.getByRole("button", { name: /Fund This Cause/i }).first();
await expect(fundButton).toBeVisible();
await fundButton.click();

const dialog = page.getByRole("dialog");
await expect(dialog).toBeVisible();

const amountInput = dialog.getByLabel(/Amount/i);
await amountInput.fill("10");

const donateButton = dialog.getByRole("button", { name: /Donate 10 XLM/i });
await expect(donateButton).toBeEnabled();
await donateButton.scrollIntoViewIfNeeded();
await donateButton.click();

Check failure on line 34 in tests/e2e/notifications.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright Tests

[webkit] › tests/e2e/notifications.spec.ts:12:7 › Notification Bell › should open notification dropdown

3) [webkit] › tests/e2e/notifications.spec.ts:12:7 › Notification Bell › should open notification dropdown, mark one read, and decrement unread count Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── TimeoutError: locator.click: Timeout 10000ms exceeded. Call log: - waiting for getByRole('dialog').getByRole('button', { name: /Donate 10 XLM/i }) - locator resolved to <button class="w-full py-3 bg-linear-to-r from-blue-500 to-purple-500 hover:from-blue-600 hover:to-purple-600 disabled:opacity-50 disabled:cursor-not-allowed text-white font-semibold rounded-xl transition-all duration-200">Donate 10 XLM</button> - attempting click action 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - element is outside of the viewport - retrying click action - waiting 20ms 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - element is outside of the viewport - retrying click action - waiting 100ms 15 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - element is outside of the viewport - retrying click action - waiting 500ms - waiting for element to be visible, enabled and stable 32 | await expect(donateButton).toBeEnabled(); 33 | await donateButton.scrollIntoViewIfNeeded(); > 34 | await donateButton.click(); | ^ 35 | 36 | await expect(page.getByText(/donated successfully/i)).toBeVisible({ timeout: 15000 }); 37 | await page.getByRole("button", { name: /Close/i }).click(); at /home/runner/work/ProofOfHeart-frontend/ProofOfHeart-frontend/tests/e2e/notifications.spec.ts:34:24

Check failure on line 34 in tests/e2e/notifications.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright Tests

[webkit] › tests/e2e/notifications.spec.ts:12:7 › Notification Bell › should open notification dropdown

3) [webkit] › tests/e2e/notifications.spec.ts:12:7 › Notification Bell › should open notification dropdown, mark one read, and decrement unread count Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── TimeoutError: locator.click: Timeout 10000ms exceeded. Call log: - waiting for getByRole('dialog').getByRole('button', { name: /Donate 10 XLM/i }) - locator resolved to <button class="w-full py-3 bg-linear-to-r from-blue-500 to-purple-500 hover:from-blue-600 hover:to-purple-600 disabled:opacity-50 disabled:cursor-not-allowed text-white font-semibold rounded-xl transition-all duration-200">Donate 10 XLM</button> - attempting click action 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - element is outside of the viewport - retrying click action - waiting 20ms 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - element is outside of the viewport - retrying click action - waiting 100ms 15 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - element is outside of the viewport - retrying click action - waiting 500ms - waiting for element to be visible, enabled and stable 32 | await expect(donateButton).toBeEnabled(); 33 | await donateButton.scrollIntoViewIfNeeded(); > 34 | await donateButton.click(); | ^ 35 | 36 | await expect(page.getByText(/donated successfully/i)).toBeVisible({ timeout: 15000 }); 37 | await page.getByRole("button", { name: /Close/i }).click(); at /home/runner/work/ProofOfHeart-frontend/ProofOfHeart-frontend/tests/e2e/notifications.spec.ts:34:24

Check failure on line 34 in tests/e2e/notifications.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright Tests

[webkit] › tests/e2e/notifications.spec.ts:12:7 › Notification Bell › should open notification dropdown

3) [webkit] › tests/e2e/notifications.spec.ts:12:7 › Notification Bell › should open notification dropdown, mark one read, and decrement unread count TimeoutError: locator.click: Timeout 10000ms exceeded. Call log: - waiting for getByRole('dialog').getByRole('button', { name: /Donate 10 XLM/i }) - locator resolved to <button class="w-full py-3 bg-linear-to-r from-blue-500 to-purple-500 hover:from-blue-600 hover:to-purple-600 disabled:opacity-50 disabled:cursor-not-allowed text-white font-semibold rounded-xl transition-all duration-200">Donate 10 XLM</button> - attempting click action 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - element is outside of the viewport - retrying click action - waiting 20ms 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - element is outside of the viewport - retrying click action - waiting 100ms 14 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - element is outside of the viewport - retrying click action - waiting 500ms 32 | await expect(donateButton).toBeEnabled(); 33 | await donateButton.scrollIntoViewIfNeeded(); > 34 | await donateButton.click(); | ^ 35 | 36 | await expect(page.getByText(/donated successfully/i)).toBeVisible({ timeout: 15000 }); 37 | await page.getByRole("button", { name: /Close/i }).click(); at /home/runner/work/ProofOfHeart-frontend/ProofOfHeart-frontend/tests/e2e/notifications.spec.ts:34:24

Check failure on line 34 in tests/e2e/notifications.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright Tests

[firefox] › tests/e2e/notifications.spec.ts:12:7 › Notification Bell › should open notification dropdown

2) [firefox] › tests/e2e/notifications.spec.ts:12:7 › Notification Bell › should open notification dropdown, mark one read, and decrement unread count Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── TimeoutError: locator.click: Timeout 10000ms exceeded. Call log: - waiting for getByRole('dialog').getByRole('button', { name: /Donate 10 XLM/i }) - locator resolved to <button class="w-full py-3 bg-linear-to-r from-blue-500 to-purple-500 hover:from-blue-600 hover:to-purple-600 disabled:opacity-50 disabled:cursor-not-allowed text-white font-semibold rounded-xl transition-all duration-200">Donate 10 XLM</button> - attempting click action 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - element is outside of the viewport - retrying click action - waiting 20ms 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - element is outside of the viewport - retrying click action - waiting 100ms 19 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - element is outside of the viewport - retrying click action - waiting 500ms 32 | await expect(donateButton).toBeEnabled(); 33 | await donateButton.scrollIntoViewIfNeeded(); > 34 | await donateButton.click(); | ^ 35 | 36 | await expect(page.getByText(/donated successfully/i)).toBeVisible({ timeout: 15000 }); 37 | await page.getByRole("button", { name: /Close/i }).click(); at /home/runner/work/ProofOfHeart-frontend/ProofOfHeart-frontend/tests/e2e/notifications.spec.ts:34:24

Check failure on line 34 in tests/e2e/notifications.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright Tests

[firefox] › tests/e2e/notifications.spec.ts:12:7 › Notification Bell › should open notification dropdown

2) [firefox] › tests/e2e/notifications.spec.ts:12:7 › Notification Bell › should open notification dropdown, mark one read, and decrement unread count Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── TimeoutError: locator.click: Timeout 10000ms exceeded. Call log: - waiting for getByRole('dialog').getByRole('button', { name: /Donate 10 XLM/i }) - locator resolved to <button class="w-full py-3 bg-linear-to-r from-blue-500 to-purple-500 hover:from-blue-600 hover:to-purple-600 disabled:opacity-50 disabled:cursor-not-allowed text-white font-semibold rounded-xl transition-all duration-200">Donate 10 XLM</button> - attempting click action 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - element is outside of the viewport - retrying click action - waiting 20ms 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - element is outside of the viewport - retrying click action - waiting 100ms 19 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - element is outside of the viewport - retrying click action - waiting 500ms 32 | await expect(donateButton).toBeEnabled(); 33 | await donateButton.scrollIntoViewIfNeeded(); > 34 | await donateButton.click(); | ^ 35 | 36 | await expect(page.getByText(/donated successfully/i)).toBeVisible({ timeout: 15000 }); 37 | await page.getByRole("button", { name: /Close/i }).click(); at /home/runner/work/ProofOfHeart-frontend/ProofOfHeart-frontend/tests/e2e/notifications.spec.ts:34:24

Check failure on line 34 in tests/e2e/notifications.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright Tests

[firefox] › tests/e2e/notifications.spec.ts:12:7 › Notification Bell › should open notification dropdown

2) [firefox] › tests/e2e/notifications.spec.ts:12:7 › Notification Bell › should open notification dropdown, mark one read, and decrement unread count TimeoutError: locator.click: Timeout 10000ms exceeded. Call log: - waiting for getByRole('dialog').getByRole('button', { name: /Donate 10 XLM/i }) - locator resolved to <button class="w-full py-3 bg-linear-to-r from-blue-500 to-purple-500 hover:from-blue-600 hover:to-purple-600 disabled:opacity-50 disabled:cursor-not-allowed text-white font-semibold rounded-xl transition-all duration-200">Donate 10 XLM</button> - attempting click action 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - element is outside of the viewport - retrying click action - waiting 20ms 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - element is outside of the viewport - retrying click action - waiting 100ms 19 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - element is outside of the viewport - retrying click action - waiting 500ms 32 | await expect(donateButton).toBeEnabled(); 33 | await donateButton.scrollIntoViewIfNeeded(); > 34 | await donateButton.click(); | ^ 35 | 36 | await expect(page.getByText(/donated successfully/i)).toBeVisible({ timeout: 15000 }); 37 | await page.getByRole("button", { name: /Close/i }).click(); at /home/runner/work/ProofOfHeart-frontend/ProofOfHeart-frontend/tests/e2e/notifications.spec.ts:34:24

Check failure on line 34 in tests/e2e/notifications.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright Tests

[chromium] › tests/e2e/notifications.spec.ts:12:7 › Notification Bell › should open notification dropdown

1) [chromium] › tests/e2e/notifications.spec.ts:12:7 › Notification Bell › should open notification dropdown, mark one read, and decrement unread count Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── TimeoutError: locator.click: Timeout 10000ms exceeded. Call log: - waiting for getByRole('dialog').getByRole('button', { name: /Donate 10 XLM/i }) - locator resolved to <button class="w-full py-3 bg-linear-to-r from-blue-500 to-purple-500 hover:from-blue-600 hover:to-purple-600 disabled:opacity-50 disabled:cursor-not-allowed text-white font-semibold rounded-xl transition-all duration-200">Donate 10 XLM</button> - attempting click action 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - element is outside of the viewport - retrying click action - waiting 20ms 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - element is outside of the viewport - retrying click action - waiting 100ms 19 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - element is outside of the viewport - retrying click action - waiting 500ms 32 | await expect(donateButton).toBeEnabled(); 33 | await donateButton.scrollIntoViewIfNeeded(); > 34 | await donateButton.click(); | ^ 35 | 36 | await expect(page.getByText(/donated successfully/i)).toBeVisible({ timeout: 15000 }); 37 | await page.getByRole("button", { name: /Close/i }).click(); at /home/runner/work/ProofOfHeart-frontend/ProofOfHeart-frontend/tests/e2e/notifications.spec.ts:34:24

Check failure on line 34 in tests/e2e/notifications.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright Tests

[chromium] › tests/e2e/notifications.spec.ts:12:7 › Notification Bell › should open notification dropdown

1) [chromium] › tests/e2e/notifications.spec.ts:12:7 › Notification Bell › should open notification dropdown, mark one read, and decrement unread count Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── TimeoutError: locator.click: Timeout 10000ms exceeded. Call log: - waiting for getByRole('dialog').getByRole('button', { name: /Donate 10 XLM/i }) - locator resolved to <button class="w-full py-3 bg-linear-to-r from-blue-500 to-purple-500 hover:from-blue-600 hover:to-purple-600 disabled:opacity-50 disabled:cursor-not-allowed text-white font-semibold rounded-xl transition-all duration-200">Donate 10 XLM</button> - attempting click action 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - element is outside of the viewport - retrying click action - waiting 20ms 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - element is outside of the viewport - retrying click action - waiting 100ms 19 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - element is outside of the viewport - retrying click action - waiting 500ms 32 | await expect(donateButton).toBeEnabled(); 33 | await donateButton.scrollIntoViewIfNeeded(); > 34 | await donateButton.click(); | ^ 35 | 36 | await expect(page.getByText(/donated successfully/i)).toBeVisible({ timeout: 15000 }); 37 | await page.getByRole("button", { name: /Close/i }).click(); at /home/runner/work/ProofOfHeart-frontend/ProofOfHeart-frontend/tests/e2e/notifications.spec.ts:34:24

Check failure on line 34 in tests/e2e/notifications.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright Tests

[chromium] › tests/e2e/notifications.spec.ts:12:7 › Notification Bell › should open notification dropdown

1) [chromium] › tests/e2e/notifications.spec.ts:12:7 › Notification Bell › should open notification dropdown, mark one read, and decrement unread count TimeoutError: locator.click: Timeout 10000ms exceeded. Call log: - waiting for getByRole('dialog').getByRole('button', { name: /Donate 10 XLM/i }) - locator resolved to <button class="w-full py-3 bg-linear-to-r from-blue-500 to-purple-500 hover:from-blue-600 hover:to-purple-600 disabled:opacity-50 disabled:cursor-not-allowed text-white font-semibold rounded-xl transition-all duration-200">Donate 10 XLM</button> - attempting click action 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - element is outside of the viewport - retrying click action - waiting 20ms 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - element is outside of the viewport - retrying click action - waiting 100ms 19 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - element is outside of the viewport - retrying click action - waiting 500ms 32 | await expect(donateButton).toBeEnabled(); 33 | await donateButton.scrollIntoViewIfNeeded(); > 34 | await donateButton.click(); | ^ 35 | 36 | await expect(page.getByText(/donated successfully/i)).toBeVisible({ timeout: 15000 }); 37 | await page.getByRole("button", { name: /Close/i }).click(); at /home/runner/work/ProofOfHeart-frontend/ProofOfHeart-frontend/tests/e2e/notifications.spec.ts:34:24

await expect(page.getByText(/donated successfully/i)).toBeVisible({ timeout: 15000 });
await page.getByRole("button", { name: /Close/i }).click();

const bell = page.getByRole("button", { name: /Notifications/ });
await expect(bell).toBeVisible();
const badge = bell.getByText(/\d+/);
await expect(badge).toBeVisible();
const initialCount = await badge.textContent();

await bell.click();
const dropdown = page.getByRole("dialog", { name: /Notifications/i });
await expect(dropdown).toBeVisible();

const markReadButton = dropdown.getByRole("button", { name: /Mark notification/i }).first();
await expect(markReadButton).toBeVisible();
await markReadButton.click();

await page.keyboard.press("Escape");
await expect(dropdown).not.toBeVisible();

await expect(badge).not.toHaveText(initialCount ?? "", { timeout: 5000 });
});
});
Loading