-
Notifications
You must be signed in to change notification settings - Fork 475
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add e2e test for layout navigation (#8963)
Co-authored-by: taiga-family-bot <[email protected]>
- Loading branch information
1 parent
54d6363
commit caab33f
Showing
3 changed files
with
53 additions
and
1 deletion.
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
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,50 @@ | ||
import {DemoRoute} from '@demo/routes'; | ||
import {TuiDocumentationPagePO, tuiGoto} from '@demo-playwright/utils'; | ||
import {expect, test} from '@playwright/test'; | ||
|
||
test.describe('Navigation', () => { | ||
test('Show settings in aside', async ({page}) => { | ||
await tuiGoto(page, DemoRoute.Navigation); | ||
const example = new TuiDocumentationPagePO(page).getExample('#full'); | ||
|
||
await example.scrollIntoViewIfNeeded(); | ||
|
||
await expect(example).toHaveScreenshot('01-navigation.png'); | ||
|
||
await example.locator('aside [iconStart="@tui.settings"]').hover(); | ||
|
||
await expect(example).toHaveScreenshot('02-navigation.png'); | ||
}); | ||
|
||
test('Show hint in aside', async ({page}) => { | ||
await tuiGoto(page, DemoRoute.Navigation); | ||
const example = new TuiDocumentationPagePO(page).getExample('#full'); | ||
|
||
await example.scrollIntoViewIfNeeded(); | ||
|
||
await example.locator('aside [iconStart="@tui.heart"]').hover(); | ||
|
||
await expect(example).toHaveScreenshot('03-navigation.png'); | ||
}); | ||
|
||
test('A12y', async ({page}) => { | ||
await tuiGoto(page, DemoRoute.Navigation); | ||
const example = new TuiDocumentationPagePO(page).getExample('#full'); | ||
|
||
await example.scrollIntoViewIfNeeded(); | ||
await example.locator('aside footer button').nth(1).click(); | ||
|
||
await expect(example).toHaveScreenshot('04-navigation.png'); | ||
|
||
await example.locator('aside [iconStart="@tui.settings"]').focus(); | ||
await page.keyboard.press('Enter'); | ||
|
||
await expect(example).toHaveScreenshot('05-navigation.png'); | ||
|
||
await example.locator('aside [iconStart="@tui.heart"]').focus(); | ||
await page.keyboard.press('Tab'); | ||
await page.keyboard.press('Space'); | ||
|
||
await expect(example).toHaveScreenshot('06-navigation.png'); | ||
}); | ||
}); |