From ff9759325370e6b5ad6a4049c5a874e0fc408fd7 Mon Sep 17 00:00:00 2001 From: EugeniyKiyashko Date: Fri, 4 Dec 2026 23:17:55 +0400 Subject: [PATCH] Playwright(demos e2e): check the dark themes for accessibility only when a pull request changes the styles --- .github/workflows/visual-tests-demos.yml | 28 +++++++++++++++++++++++- apps/demos/README.md | 2 ++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/visual-tests-demos.yml b/.github/workflows/visual-tests-demos.yml index 1861d3044f07..71167f38279d 100644 --- a/.github/workflows/visual-tests-demos.yml +++ b/.github/workflows/visual-tests-demos.yml @@ -23,11 +23,35 @@ jobs: timeout-minutes: 6 outputs: should-run: ${{ steps.check.outputs.should-run }} + # The dark themes differ from the light ones only in colors. A pull request checks their + # accessibility when it changes the styles or the test; the merge queue checks it always. + dark-accessibility: ${{ github.event_name != 'pull_request' || steps.changes.outputs.accessibility == 'true' }} steps: - name: Check RUN_TESTS flag id: check run: echo "should-run=${{ env.RUN_TESTS }}" >> $GITHUB_OUTPUT + - uses: actions/checkout@v6 + if: github.event_name == 'pull_request' + + - uses: dorny/paths-filter@v4 + id: changes + if: github.event_name == 'pull_request' + with: + filters: | + accessibility: + - 'packages/devextreme-scss/scss/**' + - 'packages/devextreme-scss/icons/**' + - 'packages/devextreme-scss/images/**' + - 'packages/devextreme-scss/fonts/**' + - 'packages/devextreme/js/**/themes/**' + - 'apps/demos/Demos/**/*.css' + - 'apps/demos/testing/accessibility.spec.ts' + - 'apps/demos/playwright.accessibility.config.ts' + - 'apps/demos/utils/axe-reporter/**' + - 'apps/demos/utils/visual-tests/playwright/**' + - '.github/workflows/visual-tests-demos.yml' + build-devextreme: runs-on: ${{ github.event_name == 'merge_group' && 'devextreme-shr2-ondemand' || 'devextreme-shr2' }} name: Build DevExtreme @@ -526,7 +550,9 @@ jobs: run: pnpm run test-playwright - name: Run Playwright accessibility tests (jQuery) - if: matrix.STRATEGY == 'accessibility' + if: | + matrix.STRATEGY == 'accessibility' && + (!contains(matrix.THEME, '.dark') || needs.check-should-run.outputs.dark-accessibility == 'true') timeout-minutes: 10 working-directory: apps/demos env: diff --git a/apps/demos/README.md b/apps/demos/README.md index 3b8692987543..2d58714772ed 100644 --- a/apps/demos/README.md +++ b/apps/demos/README.md @@ -212,6 +212,8 @@ THEME=material.blue.dark pnpm run test-playwright:accessibility A demo with violations fails, and its report is written to `testing/artifacts/axe-reports/-.md`. +The dark themes differ from the light ones only in colors, so a pull request checks them only when it changes the styles, the CSS of a demo or the accessibility test. The merge queue checks them always. + On macOS DevExtreme scrolls natively, so `scrollable-region-focusable` fails in demos with scrollable content that pass on CI. The container checks what CI checks: ```