|
1 | 1 | import path from 'path' |
2 | | -import { expect } from '@playwright/test' |
| 2 | +import { expect, test } from '@playwright/test' |
3 | 3 | import { createExtension, createTest } from '../../lib/framework' |
4 | 4 |
|
5 | | -const developerExtensionPath = path.join(process.cwd(), 'developer-extension', 'dist') |
| 5 | +const developerExtensionPath = path.join(process.cwd(), 'developer-extension/.output/chrome-mv3') |
6 | 6 |
|
7 | | -createTest('should switch between tabs') |
8 | | - .withExtension(createExtension(developerExtensionPath)) |
9 | | - .run(async ({ page, getExtensionId, flushBrowserLogs }) => { |
10 | | - const extensionId = await getExtensionId() |
| 7 | +test.describe('developer extension', () => { |
| 8 | + createTest('should switch between tabs') |
| 9 | + .withExtension(createExtension(developerExtensionPath)) |
| 10 | + .run(async ({ page, getExtensionId, flushBrowserLogs }) => { |
| 11 | + const extensionId = await getExtensionId() |
11 | 12 |
|
12 | | - await page.goto(`chrome-extension://${extensionId}/panel.html`) |
| 13 | + await page.goto(`chrome-extension://${extensionId}/panel.html`) |
13 | 14 |
|
14 | | - const getSelectedTab = () => page.getByRole('tab', { selected: true }) |
15 | | - const getTab = (name: string) => page.getByRole('tab', { name }) |
| 15 | + const getSelectedTab = () => page.getByRole('tab', { selected: true }) |
| 16 | + const getTab = (name: string) => page.getByRole('tab', { name }) |
16 | 17 |
|
17 | | - expect(await getSelectedTab().innerText()).toEqual('Events') |
| 18 | + expect(await getSelectedTab().innerText()).toEqual('Events') |
18 | 19 |
|
19 | | - await getTab('Infos').click() |
20 | | - expect(await getSelectedTab().innerText()).toEqual('Infos') |
| 20 | + await getTab('Infos').click() |
| 21 | + expect(await getSelectedTab().innerText()).toEqual('Infos') |
21 | 22 |
|
22 | | - flushBrowserLogs() |
23 | | - }) |
| 23 | + flushBrowserLogs() |
| 24 | + }) |
| 25 | +}) |
0 commit comments