-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathmap.spec.js
More file actions
65 lines (55 loc) · 2.07 KB
/
Copy pathmap.spec.js
File metadata and controls
65 lines (55 loc) · 2.07 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { test, expect } from '@playwright/test';
test.describe('Map Page', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/hearings/map?lang=fi');
});
test('should display heading', async ({ page }) => {
await expect(
page.getByRole('heading', { name: 'Kaikki kuulemiset' })
).toBeVisible();
});
test('should display "Etsi otsikoista" searchbox', async ({ page }) => {
await expect(
page.getByRole('searchbox', { name: 'Etsi otsikoista' })
).toBeVisible();
});
test('should display "Hae aiheista" combobox', async ({ page }) => {
await expect(
page.getByRole('combobox', { name: 'Hae aiheista' })
).toBeVisible();
});
test('should display "Etsi" button', async ({ page }) => {
await expect(
page.getByRole('button', { name: 'Etsi', exact: true })
).toBeVisible();
});
test('should display "Näytetään vain avoimet" text', async ({ page }) => {
await expect(page.getByText('Näytetään vain avoimet')).toBeVisible();
});
test('should display "Kartta" tab', async ({ page }) => {
await expect(page.getByRole('tab', { name: 'Kartta' })).toBeVisible();
});
test('should display "Lista" tab', async ({ page }) => {
await expect(page.getByRole('tab', { name: 'Lista' })).toBeVisible();
});
test('swedish translations', async ({ page }) => {
await page.goto('/hearings/map?lang=sv');
await expect
.soft(page.getByRole('heading', { name: 'Alla höranden' }))
.toBeVisible();
await expect.soft(page.getByText('Endast öppna visas')).toBeVisible();
await expect
.soft(page.getByRole('searchbox', { name: 'Sök bland rubrikerna' }))
.toBeVisible();
});
test('english translations', async ({ page }) => {
await page.goto('/hearings/map?lang=en');
await expect
.soft(page.getByRole('heading', { name: 'All hearings' }))
.toBeVisible();
await expect.soft(page.getByText('Show only open')).toBeVisible();
await expect
.soft(page.getByRole('searchbox', { name: 'Search from titles' }))
.toBeVisible();
});
});