Skip to content

Commit 3bda3c8

Browse files
committed
fix: make visual test works in CI
1 parent 292e8b7 commit 3bda3c8

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

.github/workflows/shared-component-visual-tests.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ jobs:
4949
if: steps.playwright-cache.outputs.cache-hit != 'true'
5050
run: "yarn playwright install --with-deps --only-shell"
5151

52+
- name: Build Element Web resources
53+
# Needed to prepare language files
54+
run: "yarn build:res"
55+
56+
- name: Build storybook dependencies
57+
# When the first test is ran, it will fail because the dependencies are not yet built.
58+
# This step is to ensure that the dependencies are built before running the tests.
59+
run: "yarn test:storybook:ci"
60+
continue-on-error: true
61+
5262
- name: Run Visual tests
5363
run: "yarn test:storybook:ci"
5464

.storybook/main.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,9 @@ Please see LICENSE files in the repository root for full details.
77

88
import type { StorybookConfig } from "@storybook/react-vite";
99
import path from "node:path";
10-
import { fileURLToPath } from "node:url";
1110
import { nodePolyfills } from "vite-plugin-node-polyfills";
1211
import { mergeConfig } from "vite";
1312

14-
const __filename = fileURLToPath(import.meta.url);
15-
const __dirname = path.dirname(__filename);
16-
1713
const config: StorybookConfig = {
1814
stories: ["../src/shared-components/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
1915
staticDirs: ["../webapp"],
@@ -30,7 +26,7 @@ const config: StorybookConfig = {
3026
resolve: {
3127
alias: {
3228
// Alias used by i18n.tsx
33-
$webapp: path.resolve(__dirname, "../webapp"),
29+
$webapp: path.resolve("webapp"),
3430
},
3531
},
3632
// Needed for counterpart to work

0 commit comments

Comments
 (0)