forked from Asvarox/allkaraoke
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjukebox.spec.ts
25 lines (20 loc) · 1.03 KB
/
jukebox.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { expect, test } from '@playwright/test';
import navigateWithKeyboard from './steps/navigateWithKeyboard';
test('Jukebox', async ({ page }) => {
await page.goto('/?e2e-test');
await page.getByTestId('skip').click();
await page.getByTestId('jukebox').click();
await expect(page.getByTestId('skip-button')).toBeVisible();
await navigateWithKeyboard(page, 'skip-button');
await page.waitForTimeout(500);
await page.keyboard.press('Enter');
await page.waitForTimeout(500);
const selectedSong = await page.getByTestId('jukebox-container').getAttribute('data-song');
await navigateWithKeyboard(page, 'sing-button');
await page.keyboard.press('Enter'); // Sing this song
await expect(page.getByTestId('lang-Polish')).toBeVisible();
await page.waitForTimeout(500);
await page.getByTestId('close-exclude-languages').click();
await expect(page.getByTestId('song-list-container')).toBeVisible();
await expect(page.getByTestId('song-preview')).toHaveAttribute('data-song', selectedSong!);
});