-
+
{{ component.name }}
diff --git a/packages/design-system/tests/e2e/playwright.config.ts b/packages/design-system/tests/e2e/playwright.config.ts
new file mode 100644
index 00000000000..8e22877a4ce
--- /dev/null
+++ b/packages/design-system/tests/e2e/playwright.config.ts
@@ -0,0 +1,52 @@
+import { defineConfig, devices } from '@playwright/test'
+
+export default defineConfig({
+ testDir: './',
+ testMatch: /.*\.spec\.ts/,
+ fullyParallel: true,
+ forbidOnly: process.env.CI === 'true',
+ retries: process.env.CI === 'true' ? 2 : 0,
+ workers: process.env.CI === 'true' ? 1 : undefined,
+ reporter: 'html',
+
+ projects: [
+ {
+ name: 'chromium',
+ use: { ...devices['Desktop Chrome'] }
+ }
+
+ // Running these browsers currently produces an error in drone CI due to missing deps (even when they are installed first)
+ // {
+ // name: 'firefox',
+ // use: { ...devices['Desktop Firefox'] }
+ // },
+
+ // {
+ // name: 'webkit',
+ // use: { ...devices['Desktop Safari'] }
+ // }
+
+ // The mobile view of docs is currently pretty junky and causes various false negatives on mobile tests
+ // {
+ // name: 'Mobile Chrome',
+ // use: { ...devices['Pixel 5'] }
+ // },
+
+ // {
+ // name: 'Mobile Safari',
+ // use: { ...devices['iPhone 12'] }
+ // }
+ ],
+
+ webServer: {
+ command: 'NODE_ENV=production pnpm start',
+ url: 'http://127.0.0.1:6060',
+ reuseExistingServer: process.env.CI !== 'true',
+ // Timeout is intentionally pretty high here due to the server boot taking a long time
+ timeout: 5 * 60 * 1000
+ },
+
+ use: {
+ baseURL: 'http://127.0.0.1:6060'
+ }
+})
diff --git a/packages/design-system/tests/e2e/specs/component-example.spec.ts b/packages/design-system/tests/e2e/specs/component-example.spec.ts
new file mode 100644
index 00000000000..eb7c82cfada
--- /dev/null
+++ b/packages/design-system/tests/e2e/specs/component-example.spec.ts
@@ -0,0 +1,21 @@
+import { test, expect } from '@playwright/test'
+
+const SELECTORS = Object.freeze({
+ previewWrapper: '[data-testid="preview-wrapper"]',
+ codemirrorHtml: '[data-testid="codemirror-html"]',
+ // We're using class here instead of data attribute because we cannot adjust the default preview component
+ // The class is coming from the specified theme
+ codemirrorVue: '.cm-s-night',
+ tabHtml: '[data-testid="preview-tab-html"]'
+})
+
+test('Components preview is displayed', async ({ page, baseURL }) => {
+ await page.goto((baseURL || '') + '/#/' + encodeURIComponent('oC Components') + '/OcButton')
+
+ await expect(page.locator(SELECTORS.previewWrapper)).toBeVisible()
+ await expect(page.locator(SELECTORS.codemirrorVue)).toBeVisible()
+
+ await page.locator(SELECTORS.tabHtml).click()
+
+ await expect(page.locator(SELECTORS.codemirrorHtml)).toBeVisible()
+})
diff --git a/packages/design-system/tests/e2e/specs/components-list.spec.ts b/packages/design-system/tests/e2e/specs/components-list.spec.ts
new file mode 100644
index 00000000000..c43b9bed704
--- /dev/null
+++ b/packages/design-system/tests/e2e/specs/components-list.spec.ts
@@ -0,0 +1,13 @@
+import { test, expect } from '@playwright/test'
+
+const SELECTORS = Object.freeze({
+ listWrapper: '[data-testid="components-list"]',
+ listRow: '[data-testid="component-list-row"]'
+})
+
+test('Components list is loaded', async ({ page, baseURL }) => {
+ await page.goto(baseURL || '')
+
+ await expect(page.locator(SELECTORS.listWrapper)).toBeVisible()
+ expect((await page.$$(SELECTORS.listRow)).length).toBeGreaterThan(10)
+})
diff --git a/tests/unit/config/jest.config.ts b/tests/unit/config/jest.config.ts
index 4af850e94f6..f36e3a46902 100644
--- a/tests/unit/config/jest.config.ts
+++ b/tests/unit/config/jest.config.ts
@@ -67,6 +67,9 @@ export default {
'!/**/node_modules/**'
],
testMatch: ['**/*.spec.{js,ts}'],
- testPathIgnorePatterns: ['/.pnpm-store/*'],
+ testPathIgnorePatterns: [
+ '/.pnpm-store/*',
+ '/packages/design-system/tests/e2e/*'
+ ],
clearMocks: true
} satisfies Config
|