11import { PlaywrightTestConfig , devices } from '@playwright/test' ;
22
33const { getBaseUrl } = require ( './apps/pie-docs/test/helpers/configuration-helper' ) ;
4+
45const baseURL = getBaseUrl ( ) ;
56process . env . BASE_URL = baseURL ;
67/**
@@ -14,62 +15,62 @@ process.env.BASE_URL = baseURL;
1415 */
1516const config : PlaywrightTestConfig = {
1617
17- /* Maximum time one test can run for. */
18- timeout : 30 * 1000 ,
19- expect : {
20- /**
21- * Maximum time expect() should wait for the condition to be met.
22- * For example in `await expect(locator).toHaveText();`
23- */
24- timeout : 5000
25- } ,
26- /* Run tests in files in parallel */
27- fullyParallel : true ,
28- /* Fail the build on CI if you accidentally left test.only in the source code. */
29- forbidOnly : ! ! process . env . CI ,
30- /* Retry on CI only */
31- retries : process . env . CI ? 2 : 0 ,
32- /* All CPUs on CI / half of available CPUs when testing locally. */
33- workers : process . env . CI ? '100%' : '50%' ,
34- /* Reporter to use. See https://playwright.dev/docs/test-reporters */
35- reporter : [ [ 'html' , { outputFolder : 'lit- visual-report' } ] ] ,
36- /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
37- use : {
38- /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
39- actionTimeout : 0 ,
40- /* Base URL to use in actions like `await page.goto('/')`. */
41- baseURL : process . env . BASE_URL ,
18+ /* Maximum time one test can run for. */
19+ timeout : 30 * 1000 ,
20+ expect : {
21+ /**
22+ * Maximum time expect() should wait for the condition to be met.
23+ * For example in `await expect(locator).toHaveText();`
24+ */
25+ timeout : 5000 ,
26+ } ,
27+ /* Run tests in files in parallel */
28+ fullyParallel : true ,
29+ /* Fail the build on CI if you accidentally left test.only in the source code. */
30+ forbidOnly : ! ! process . env . CI ,
31+ /* Retry on CI only */
32+ retries : process . env . CI ? 2 : 0 ,
33+ /* All CPUs on CI / half of available CPUs when testing locally. */
34+ workers : process . env . CI ? '100%' : '50%' ,
35+ /* Reporter to use. See https://playwright.dev/docs/test-reporters */
36+ reporter : [ [ 'html' , { outputFolder : 'visual-report' } ] ] ,
37+ /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
38+ use : {
39+ /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
40+ actionTimeout : 0 ,
41+ /* Base URL to use in actions like `await page.goto('/')`. */
42+ baseURL : process . env . BASE_URL ,
4243
43- /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
44- trace : 'on-first-retry' ,
44+ /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
45+ trace : 'on-first-retry' ,
4546
46- /* Sets the default getByTestId function attribute to the data-test-id format */
47- testIdAttribute : 'data-test-id' ,
48- } ,
47+ /* Sets the default getByTestId function attribute to the data-test-id format */
48+ testIdAttribute : 'data-test-id' ,
49+ } ,
4950
50- /* Configure projects for major browsers */
51+ /* Configure projects for major browsers */
5152
52- projects : [
53- {
54- name : 'visual:desktop' ,
55- grepInvert : / @ m o b i l e / ,
56- use : {
57- ...devices [ 'Desktop Chrome' ] ,
58- } ,
59- testMatch : [ '**/test/visual/*.spec.js' ]
60- } ,
61- {
62- name : 'visual:mobile' ,
63- grep : / @ m o b i l e / ,
64- use : {
65- ...devices [ 'Pixel 5' ] ,
66- } ,
67- testMatch : [ '**/test/visual/*.spec.js' ]
68- } ,
69- ] ,
53+ projects : [
54+ {
55+ name : 'visual:desktop' ,
56+ grepInvert : / @ m o b i l e / ,
57+ use : {
58+ ...devices [ 'Desktop Chrome' ] ,
59+ } ,
60+ testMatch : [ '**/test/visual/*.spec.js' ] ,
61+ } ,
62+ {
63+ name : 'visual:mobile' ,
64+ grep : / @ m o b i l e / ,
65+ use : {
66+ ...devices [ 'Pixel 5' ] ,
67+ } ,
68+ testMatch : [ '**/test/visual/*.spec.js' ] ,
69+ } ,
70+ ] ,
7071
71- /* Folder for test artifacts such as screenshots, videos, traces, etc. */
72- // outputDir: 'test-results/',
72+ /* Folder for test artifacts such as screenshots, videos, traces, etc. */
73+ // outputDir: 'test-results/',
7374} ;
7475
75- export default config ;
76+ export default config ;
0 commit comments