Skip to content

Commit 9e97a9c

Browse files
committed
add new test project
1 parent 120233a commit 9e97a9c

4 files changed

Lines changed: 70 additions & 22 deletions

File tree

webui/e2e/header.dashboard.spec.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { test, expect } from './models/fixture-dashboard'
2+
3+
test('header in dashboard', async ({ dashboard }) => {
4+
await dashboard.open()
5+
6+
await test.step("navigation links", async () => {
7+
const links = dashboard.header.getNavLinks()
8+
await expect(links.nth(0)).toHaveText('Dashboard')
9+
if (process.env.CI) {
10+
await expect(links.nth(1)).toHaveText('Guides')
11+
await expect(links.nth(2)).toHaveText('Configuration')
12+
await expect(links.nth(3)).toHaveText('JavaScript API')
13+
await expect(links.nth(4)).toHaveText('Resources')
14+
await expect(links.nth(5)).toHaveText('References')
15+
} else {
16+
await expect(links.nth(1)).toHaveText('Dashboard')
17+
await expect(links.nth(2)).toHaveText('Guides')
18+
await expect(links.nth(3)).toHaveText('Configuration')
19+
await expect(links.nth(4)).toHaveText('JavaScript API')
20+
await expect(links.nth(5)).toHaveText('Resources')
21+
await expect(links.nth(6)).toHaveText('References')
22+
}
23+
})
24+
25+
await test.step('version number', async() => {
26+
await expect(dashboard.header.version).toHaveText('v0.11.0')
27+
})
28+
})

webui/e2e/header.spec.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

webui/e2e/header.website.spec.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { test, expect } from './models/fixture-dashboard'
2+
3+
test('header in dashboard', async ({ dashboard }) => {
4+
await dashboard.open()
5+
6+
await test.step("navigation links", async () => {
7+
const links = dashboard.header.getNavLinks()
8+
await expect(links.nth(0)).toHaveText('Dashboard')
9+
await expect(links.nth(1)).toHaveText('Guides')
10+
await expect(links.nth(2)).toHaveText('Configuration')
11+
await expect(links.nth(3)).toHaveText('JavaScript API')
12+
await expect(links.nth(4)).toHaveText('Resources')
13+
await expect(links.nth(5)).toHaveText('References')
14+
})
15+
16+
await test.step('version number', async() => {
17+
await expect(dashboard.header.version).not.toBeVisible();
18+
})
19+
})

webui/playwright.config.ts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const config: PlaywrightTestConfig = {
4444
/* Configure projects for major browsers */
4545
projects: [
4646
{
47-
name: 'chromium',
47+
name: 'dashboard',
4848
use: {
4949
...devices['Desktop Chrome'],
5050
storageState: {
@@ -60,7 +60,28 @@ const config: PlaywrightTestConfig = {
6060
}
6161
]
6262
},
63-
}
63+
},
64+
testIgnore: ["/e2e/**/*.website.spec.ts"],
65+
},
66+
{
67+
name: 'website',
68+
use: {
69+
...devices['Desktop Chrome'],
70+
storageState: {
71+
cookies: [],
72+
origins: [
73+
{
74+
origin: 'http://localhost:5173',
75+
localStorage: [
76+
{
77+
name: 'theme', value: 'dark'
78+
}
79+
]
80+
}
81+
]
82+
},
83+
},
84+
testIgnore: ["/e2e/**/*.dashboard.spec.ts"],
6485
},
6586
// {
6687
// name: 'firefox',

0 commit comments

Comments
 (0)