diff --git a/.drone.star b/.drone.star index a67143cb6e9..9379086993b 100644 --- a/.drone.star +++ b/.drone.star @@ -362,7 +362,7 @@ def stagePipelines(ctx): unit_test_pipelines = unitTests(ctx) e2e_pipelines = e2eTests(ctx) acceptance_pipelines = acceptance(ctx) - return unit_test_pipelines + pipelinesDependsOn(e2e_pipelines + acceptance_pipelines, unit_test_pipelines) + return unit_test_pipelines + buildAndTestDesignSystem(ctx) + pipelinesDependsOn(e2e_pipelines + acceptance_pipelines, unit_test_pipelines) def afterPipelines(ctx): return build(ctx) + pipelinesDependsOn(notify(), build(ctx)) @@ -1022,7 +1022,7 @@ def installPlaywright(): "PLAYWRIGHT_BROWSERS_PATH": ".playwright", }, "commands": [ - "pnpm playwright install chromium", + "pnpm exec playwright install --with-deps", ], }] @@ -2231,3 +2231,53 @@ def appProviderService(name): ], }, ] + +def buildDesignSystemDocs(): + return [{ + "name": "build-design-system-docs", + "image": OC_CI_NODEJS, + "commands": [ + "pnpm --filter @ownclouders/design-system build:docs", + ], + }] + +def runDesignSystemDocsE2eTests(): + return [{ + "name": "run-design-system-docs-e2e-tests", + "image": OC_CI_NODEJS, + "environment": { + "PLAYWRIGHT_BROWSERS_PATH": ".playwright", + }, + "commands": [ + "pnpm --filter @ownclouders/design-system test:e2e", + ], + }] + +def buildAndTestDesignSystem(ctx): + design_system_trigger = { + "ref": [ + "refs/heads/master", + "refs/heads/stable-*", + "refs/tags/**", + "refs/pull/**", + ], + } + + steps = restoreBuildArtifactCache(ctx, "pnpm", ".pnpm-store") + \ + restoreBuildArtifactCache(ctx, "playwright", ".playwright") + \ + installPnpm() + \ + installPlaywright() + \ + buildDesignSystemDocs() + \ + runDesignSystemDocsE2eTests() + + return [{ + "kind": "pipeline", + "type": "docker", + "name": "design-system-build-and-test", + "workspace": { + "base": dir["base"], + "path": config["app"], + }, + "steps": steps, + "trigger": design_system_trigger, + }] diff --git a/.gitignore b/.gitignore index 979471aba06..e19ff261aa5 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,7 @@ tests/e2e/cucumber/report/cucumber_report.json tests/e2e/cucumber/reportGenerator/cucumber_report.json tests/ocis tests/testing-app +playwright-report /webpack.json /webpack-build-log.json diff --git a/packages/design-system/docs/components/Preview.js b/packages/design-system/docs/components/Preview.js index 168cec17721..d6ca54babe8 100644 --- a/packages/design-system/docs/components/Preview.js +++ b/packages/design-system/docs/components/Preview.js @@ -176,6 +176,7 @@ export default (previewComponent) => { elem.classList.add('vueds-html') elem.classList.add('vueds-hidden') + elem.setAttribute('data-testid', 'codemirror-html') CodeTabs.init() }, 300) diff --git a/packages/design-system/docs/utils/tabs.js b/packages/design-system/docs/utils/tabs.js index 84ba4333119..ea94a94b92c 100644 --- a/packages/design-system/docs/utils/tabs.js +++ b/packages/design-system/docs/utils/tabs.js @@ -17,7 +17,7 @@ export default { const tabs = document.createElement('div') tabs.className = 'vueds-tabs' tabs.innerHTML = - "" + "" return tabs }, init() { diff --git a/packages/design-system/package.json b/packages/design-system/package.json index 0bb36becfbe..d48317f25c3 100644 --- a/packages/design-system/package.json +++ b/packages/design-system/package.json @@ -29,7 +29,8 @@ "styleguide:build": "vue-styleguidist build --config ./config/docs.config.js", "tokens": "node build/build-tokens.js", "tokens:w": "onchange -i \"./src/tokens/**/*.json\" -- npm run tokens", - "test": "jest --config ./jest.conf.js --coverage" + "test": "jest --config ./jest.conf.js --coverage", + "test:e2e": "playwright test --config ./tests/e2e/playwright.config.ts" }, "browserslist": [ "> 1%", diff --git a/packages/design-system/src/components/_DocsComponentsList/_DocsComponentsList.vue b/packages/design-system/src/components/_DocsComponentsList/_DocsComponentsList.vue index b272c4084de..1c4bf0a6ab6 100644 --- a/packages/design-system/src/components/_DocsComponentsList/_DocsComponentsList.vue +++ b/packages/design-system/src/components/_DocsComponentsList/_DocsComponentsList.vue @@ -1,5 +1,5 @@