62 |
63 |
Lib Unit
64 |
68 |
69 |
70 |
71 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/docs/playwright.config.ts:
--------------------------------------------------------------------------------
1 | import process from 'node:process'
2 | import { defineConfig, devices } from '@playwright/test'
3 |
4 | /**
5 | * Read environment variables from file.
6 | * https://github.com/motdotla/dotenv
7 | */
8 | // require('dotenv').config();
9 |
10 | /**
11 | * See https://playwright.dev/docs/test-configuration.
12 | */
13 | export default defineConfig({
14 | testDir: './e2e',
15 | /* Maximum time one test can run for. */
16 | timeout: 30 * 1000,
17 | expect: {
18 | /**
19 | * Maximum time expect() should wait for the condition to be met.
20 | * For example in `await expect(locator).toHaveText();`
21 | */
22 | timeout: 5000,
23 | },
24 | /* Fail the build on CI if you accidentally left test.only in the source code. */
25 | forbidOnly: !!process.env.CI,
26 | /* Retry on CI only */
27 | retries: process.env.CI ? 2 : 0,
28 | /* Opt out of parallel tests on CI. */
29 | workers: process.env.CI ? 1 : undefined,
30 | /* Reporter to use. See https://playwright.dev/docs/test-reporters */
31 | reporter: [['html', { open: 'never' }]],
32 | /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
33 | use: {
34 | /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
35 | actionTimeout: 0,
36 | /* Base URL to use in actions like `await page.goto('/')`. */
37 | baseURL: 'http://localhost',
38 |
39 | /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
40 | trace: 'on-first-retry',
41 |
42 | headless: true,
43 |
44 | testIdAttribute: 'data-test',
45 | },
46 |
47 | /* Configure projects for major browsers */
48 | projects: [
49 | {
50 | name: 'chromium',
51 | use: {
52 | ...devices['Desktop Chrome'],
53 | viewport: { width: 1000, height: 1000 },
54 | },
55 | },
56 | {
57 | name: 'firefox',
58 | use: {
59 | ...devices['Desktop Firefox'],
60 | viewport: { width: 1000, height: 1000 },
61 | },
62 | },
63 | {
64 | name: 'webkit',
65 | use: {
66 | ...devices['Desktop Safari'],
67 | viewport: { width: 1000, height: 1000 },
68 | },
69 | },
70 |
71 | /* Test against mobile viewports. */
72 | /* {
73 | name: 'Mobile Chrome',
74 | use: {
75 | ...devices['Pixel 5'],
76 | },
77 | }, */
78 | /* {
79 | name: 'Mobile Safari',
80 | use: {
81 | ...devices['iPhone 12'],
82 | },
83 | }, */
84 |
85 | /* Test against branded browsers. */
86 | // {
87 | // name: 'Microsoft Edge',
88 | // use: {
89 | // channel: 'msedge',
90 | // },
91 | // },
92 | // {
93 | // name: 'Google Chrome',
94 | // use: {
95 | // channel: 'chrome',
96 | // },
97 | // },
98 | ],
99 |
100 | /* Folder for test artifacts such as screenshots, videos, traces, etc. */
101 | // outputDir: 'test-results/',
102 | })
103 |
--------------------------------------------------------------------------------
/docs/e2e.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |