-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(e2e): improve tests for about page (#189)
- Loading branch information
Showing
2 changed files
with
20 additions
and
14 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
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 |
---|---|---|
@@ -1,8 +1,19 @@ | ||
import { test } from './utils' | ||
|
||
test('about page', async ({ page }) => { | ||
await page.goto('/') | ||
await page.getByText('אודות').click() | ||
await page.getByRole('link', { name: 'תרומות קטנות נוספות' }).click() | ||
await page.getByRole('heading', { name: 'הסדנא לידע ציבורי פותחת ומנגישה מידע' }).waitFor() | ||
import { test, expect } from '@playwright/test' | ||
test.describe('About Page Tests', () => { | ||
test('can access about page by clicking `about` menu', async ({ page }) => { | ||
await page.goto('/') | ||
await page.getByText('אודות').click() | ||
await expect(page).toHaveURL('http://localhost:3000/about') | ||
const locator = await page.getByText('אודות') | ||
await expect(locator).toHaveClass('menu-item active') | ||
}) | ||
test('page display title `מהו אתר “דאטאבוס”?`', async ({ page }) => { | ||
await page.goto('/about') | ||
await expect(page.getByRole('heading', { name: 'מהו אתר “דאטאבוס”?' })).toBeVisible() | ||
}) | ||
test('clicking dontaions link should lead to sadna site', async ({ page }) => { | ||
await page.goto('/about') | ||
await page.getByRole('link', { name: 'תרומות קטנות נוספות' }).click() | ||
await page.getByRole('heading', { name: 'הסדנא לידע ציבורי פותחת ומנגישה מידע' }).waitFor() | ||
}) | ||
}) |