From 683c12cdc5d9ad0c7dc4c721bcae4aff1a5b2b12 Mon Sep 17 00:00:00 2001 From: Niklas van Schrick Date: Wed, 27 Dec 2023 20:16:23 +0100 Subject: [PATCH] Disable a11y tests for snapshot update pipelines --- .gitlab-ci.yml | 2 ++ .storybook/test-runner.ts | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 41b9bcad..9d9fa4db 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -44,6 +44,8 @@ storybook:build: storybook:test: extends: - .storybook:test:base + variables: + C0_DISABLE_A11Y_TESTS: 'true' script: - npm run storybook:test:all -- --ci || exit_code=$? - | diff --git a/.storybook/test-runner.ts b/.storybook/test-runner.ts index 52d50930..db0b25d5 100644 --- a/.storybook/test-runner.ts +++ b/.storybook/test-runner.ts @@ -8,6 +8,10 @@ const customSnapshotsDir = `${process.cwd()}/__snapshots__`; const prepareA11y = async (page) => await injectAxe(page); const executeA11y = async (page, context) => { + if(process.env.C0_DISABLE_A11Y_TESTS) { + return; + } + // Get the entire context of a story, including parameters, args, argTypes, etc. const storyContext = await getStoryContext(page, context);