Skip to content

Commit 5eb6966

Browse files
authored
ci(pie-monorepo): DSW-000 fix pie test reporters (#1748)
* ci(pie-monorepo): DSW-000 fix pie test reporters * ci(pie-monorepo): DSW-000 updated for global change in CI * fix(pie-components-config): DSW-000 updated path for playwright report
1 parent 822207d commit 5eb6966

6 files changed

Lines changed: 61 additions & 60 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@ jobs:
221221
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
222222
if: always()
223223
with:
224-
name: browsers-report
225-
path: browsers-report/
224+
name: lit-browsers-report
225+
path: lit-browsers-report/
226226
retention-days: 7
227227
# Run Visual Tests
228228
- name: Run All Visual Tests
@@ -241,8 +241,8 @@ jobs:
241241
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
242242
if: always()
243243
with:
244-
name: visual-report
245-
path: visual-report/
244+
name: lit-visual-report
245+
path: lit-visual-report/
246246
retention-days: 7
247247
env:
248248
STORYBOOK_AMPLIFY_ID: d17ja0ul7nrdy0

configs/pie-components-config/playwright-lit-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function getPlaywrightConfig () {
2020
/* Opt out of parallel tests on CI. */
2121
workers: '50%',
2222
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
23-
reporter: [['html', { outputFolder: 'lit-browsers-report' }]],
23+
reporter: [['html', { outputFolder: '../../../lit-browsers-report' }]],
2424
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
2525
use: {
2626
ctViteConfig: {

configs/pie-components-config/playwright-lit-visual-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function getPlaywrightVisualConfig () {
1717
/* Opt out of parallel tests on CI. */
1818
workers: '50%',
1919
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
20-
reporter: [['html', { outputFolder: 'lit-visual-report' }]],
20+
reporter: [['html', { outputFolder: '../../../lit-visual-report' }]],
2121
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
2222
use: {
2323
ctViteConfig: {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pie-monorepo",
3-
"description": "The home of Just Eat Takeaway.com's PIE Design System",
3+
"description": "The home of Just Eat Takeaway.com's PIE Design System.",
44
"version": "2.65.0",
55
"keywords": [],
66
"author": "Just Eat Takeaway.com - Design System Team",

playwright-browsers.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const config: PlaywrightTestConfig = {
3333
/* All CPUs on CI / half of available CPUs when testing locally. */
3434
workers: process.env.CI ? '100%' : '50%',
3535
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
36-
reporter: [['html', { outputFolder: 'lit-browsers-report' }]],
36+
reporter: [['html', { outputFolder: 'browsers-report' }]],
3737
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
3838
use: {
3939
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */

playwright-visual.config.ts

Lines changed: 53 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { PlaywrightTestConfig, devices } from '@playwright/test';
22

33
const { getBaseUrl } = require('./apps/pie-docs/test/helpers/configuration-helper');
4+
45
const baseURL = getBaseUrl();
56
process.env.BASE_URL = baseURL;
67
/**
@@ -14,62 +15,62 @@ process.env.BASE_URL = baseURL;
1415
*/
1516
const 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: /@mobile/,
56-
use: {
57-
...devices['Desktop Chrome'],
58-
},
59-
testMatch: ['**/test/visual/*.spec.js']
60-
},
61-
{
62-
name: 'visual:mobile',
63-
grep: /@mobile/,
64-
use: {
65-
...devices['Pixel 5'],
66-
},
67-
testMatch: ['**/test/visual/*.spec.js']
68-
},
69-
],
53+
projects: [
54+
{
55+
name: 'visual:desktop',
56+
grepInvert: /@mobile/,
57+
use: {
58+
...devices['Desktop Chrome'],
59+
},
60+
testMatch: ['**/test/visual/*.spec.js'],
61+
},
62+
{
63+
name: 'visual:mobile',
64+
grep: /@mobile/,
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

Comments
 (0)