diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 098ba6fd3e..81fcf838e8 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -408,14 +408,13 @@ jobs: run: | pnpm --filter @semcore/theme build pnpm --filter @semcore/core build - pnpm --filter @semcore/base-components build - pnpm build:icons - pnpm build:illustration + pnpm --filter @semcore/icon build + pnpm --filter @semcore/illustration build - name: Browser testing (Functional tests - ${{ matrix.browser }}) id: browser-testing-functional env: CHANGED_COMPONENTS: ${{ needs.defineChangedComponents.outputs.changedComponents }} - run: HOME=/root pnpm playwright test --config playwright.browser.config.ts --grep "@functional" --project=${{ matrix.browser }} $CHANGED_COMPONENTS + run: HOME=/root pnpm playwright test --pass-with-no-tests --config playwright.browser.config.ts --grep "@functional" --project=${{ matrix.browser }} $CHANGED_COMPONENTS continue-on-error: true - name: Save test results as artifacts if: steps.browser-testing-functional.outcome != 'success' @@ -486,7 +485,7 @@ jobs: id: axe-testing env: CHANGED_COMPONENTS: ${{ needs.defineChangedComponents.outputs.changedComponents }} - run: HOME=/root pnpm playwright test --config playwright.axe.config.ts $CHANGED_COMPONENTS + run: HOME=/root pnpm playwright test --pass-with-no-tests --config playwright.axe.config.ts $CHANGED_COMPONENTS continue-on-error: true - name: Save test results as artifacts if: steps.axe-testing.outcome != 'success' @@ -527,18 +526,6 @@ jobs: path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} key: pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} enableCrossOsArchive: true -# - name: Restore cached build -# uses: actions/cache@v4 -# id: cache-build -# with: -# path: | -# semcore/*/lib -# tools/*/lib -# semcore/illustration/**/*.js -# semcore/illustration/**/*.mjs -# semcore/illustration/**/*.d.ts -# key: build-${{ hashFiles('**/pnpm-lock.yaml', '**/CHANGELOG.md') }}-6 -# enableCrossOsArchive: true - name: Install dependencies run: | pnpm install --frozen-lockfile --ignore-scripts @@ -563,7 +550,7 @@ jobs: pnpm --filter @semcore/core build pnpm --filter @semcore/icon build - pnpm exec playwright test --config playwright.nvda.config.ts -- $components + pnpm exec playwright test --pass-with-no-tests --config playwright.nvda.config.ts -- $components continue-on-error: true - name: Save test results as artifacts if: steps.nvda-testing.outcome != 'success' diff --git a/tools/testing-utils/shared/helpers.ts b/tools/testing-utils/shared/helpers.ts index 89dabb03e7..f939ea3af8 100644 --- a/tools/testing-utils/shared/helpers.ts +++ b/tools/testing-utils/shared/helpers.ts @@ -1,6 +1,16 @@ +import type { Page } from 'playwright'; + import { e2eStandToHtml } from '../e2e-stand'; -export async function loadPage(page: any, examplePath: string, lang: string, props = {}) { - const htmlContent = await e2eStandToHtml(examplePath, lang, props); +const stands = new Map(); + +export async function loadPage(page: Page, examplePath: string, lang: string, props?: Record) { + const key = `${examplePath}_${lang}_${props ? JSON.stringify(props) : ''}`; + const htmlContent = stands.get(key) ?? await e2eStandToHtml(examplePath, lang, props ?? {}); + + if (!stands.has(key)) { + stands.set(key, htmlContent); + } + await page.setContent(htmlContent); }