-
Notifications
You must be signed in to change notification settings - Fork 62
/
basic-navigation.e2e.ts
104 lines (87 loc) · 3.08 KB
/
basic-navigation.e2e.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
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/*
* SPDX-FileCopyrightText: 2023 Siemens AG
*
* SPDX-License-Identifier: MIT
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import { expect } from '@playwright/test';
import { regressionTest } from '@utils/test';
regressionTest.describe('basic navigation', () => {
regressionTest('basic', async ({ page }) => {
await page.goto('basic-navigation/basic');
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot();
});
regressionTest('content width', async ({ page }) => {
await page.goto('basic-navigation/content-width');
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot();
});
regressionTest('expanded', async ({ page }) => {
await page.goto('basic-navigation/basic');
await page.locator('ix-menu ix-burger-menu').click();
await page.waitForSelector('ix-menu ix-burger-menu.expanded');
await page.waitForTimeout(800);
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot();
});
});
regressionTest.describe('basic navigation mobile', () => {
regressionTest('mobile', async ({ page }) => {
await page.goto('basic-navigation/mobile');
await page.setViewportSize({
height: 1200,
width: 500,
});
await page.waitForTimeout(500);
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot();
});
regressionTest('mobile expanded', async ({ page }) => {
await page.goto('basic-navigation/mobile');
await page.setViewportSize({
height: 1200,
width: 500,
});
await page.waitForTimeout(500);
const menuElement = await page.waitForSelector(
'ix-application-header ix-burger-menu'
);
await menuElement.click();
await page.waitForTimeout(500);
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot();
});
regressionTest('mobile overlay', async ({ page }) => {
await page.goto('basic-navigation/mobile');
await page.setViewportSize({
height: 1200,
width: 500,
});
await page.waitForTimeout(500);
const menuElement = await page.waitForSelector(
'ix-application-header ix-burger-menu'
);
await menuElement.click();
await page.waitForTimeout(500);
const settingsButton = await page.waitForSelector('#settings');
await settingsButton.click();
await page.waitForTimeout(500);
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot();
});
regressionTest('mobile expanded overlay', async ({ page }) => {
await page.goto('basic-navigation/mobile');
await page.setViewportSize({
height: 1200,
width: 500,
});
await page.waitForTimeout(500);
const menuElement = await page.waitForSelector(
'ix-application-header ix-burger-menu'
);
await menuElement.click();
await page.waitForTimeout(500);
const settingsButton = await page.waitForSelector('#settings');
await settingsButton.click();
await menuElement.click();
await page.waitForTimeout(500);
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot();
});
});