Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions libs/core/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@ UserInterfaceState.xcuserstate

/src/global/styles/tokens/core/*.json
/src/global/styles/tokens/semantic/*.json

# Playwright
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
3 changes: 3 additions & 0 deletions libs/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@
"@babel/preset-env": "^7.22.10",
"@chromatic-com/storybook": "^3.2.2",
"@pine-ds/doc-components": "^2.17.0",
"@playwright/test": "^1.50.1",
"@pxtrn/storybook-addon-docs-stencil": "^6.4.1",
"@stencil-community/eslint-plugin": "^0.5.0",
"@stencil/playwright": "^0.2.1",
"@stencil/react-output-target": "^0.5.3",
"@stencil/sass": "^3.2.0",
"@storybook/addon-a11y": "^8.4.2",
Expand All @@ -80,6 +82,7 @@
"@storybook/web-components-vite": "^8.4.2",
"@tokens-studio/sd-transforms": "^1.2.9",
"@types/jest": "^29.5.14",
"@types/node": "^22.13.9",
"@types/sortablejs": "^1.15.1",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.2.0",
Expand Down
90 changes: 90 additions & 0 deletions libs/core/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import { devices, expect, PlaywrightTestConfig, PlaywrightTestOptions, PlaywrightWorkerOptions, Project } from '@playwright/test';

import {matchers } from '@stencil/playwright';

expect.extend(matchers);

/* Configure projects for major browsers */
const projects: Project<PlaywrightTestOptions, PlaywrightWorkerOptions>[] = [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},

{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},

{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},

/* Test against mobile viewports. */
{
name: 'Mobile Chrome',
use: { ...devices['Pixel 5'] },
},
{
name: 'Mobile Safari',
use: { ...devices['iPhone 12'] },
},

/* Test against branded browsers. */
{
name: 'Microsoft Edge',
use: { ...devices['Desktop Edge'], channel: 'msedge' },
},
{
name: 'Google Chrome',
use: { ...devices['Desktop Chrome'], channel: 'chrome' },
},
];

/**
* See https://playwright.dev/docs/test-configuration.
*/
const config: PlaywrightTestConfig = {

/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Run tests in files in parallel */
fullyParallel: true,
projects,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: [
['html', { open: 'never' }],
[process.env.CI ? 'github' : 'list'],
],
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
testDir: './src/components',
testMatch: '*.e2e.playwright.ts',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
actionTimeout: 0,
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: 'http://localhost:7334',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
},
/* Run your local dev server before starting the tests */
// webServer: {
// command: 'npm run start.stencil',
// url: 'http://localhost:3333/',
// reuseExistingServer: true,
// timeout: 90000,
// },
webServer: {
command: 'serve -p 7334',
port: 7334,
reuseExistingServer: !process.env.CI,
},
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
};

export default config;
2 changes: 1 addition & 1 deletion libs/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"baseUrl": ".",
"declaration": false,
"experimentalDecorators": true,
"lib": ["dom", "es2015", "es2017"],
"lib": ["dom", "es2015", "es2017", "esnext.disposable"],
"jsx": "react",
"jsxFactory": "h",
"moduleResolution": "node",
Expand Down
Loading
Loading