Skip to content

Commit d2435ce

Browse files
authored
chore: updated playwright and storybook (#1018)
1 parent e910c9d commit d2435ce

84 files changed

Lines changed: 432 additions & 194 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/pr-visual-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
name: Visual Tests
99
runs-on: ubuntu-latest
1010
container:
11-
image: mcr.microsoft.com/playwright:v1.49.0-jammy
11+
image: mcr.microsoft.com/playwright:v1.52.0-jammy
1212
steps:
1313
- name: Checkout
1414
uses: actions/checkout@v6

demo/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@
4040
"@babel/preset-typescript": "7.28.5",
4141
"@bem-react/classname": "^1.6.0",
4242
"@gravity-ui/icons": "^2.12.0",
43-
"@playwright/experimental-ct-react": "1.49.0",
44-
"@playwright/test": "1.49.0",
45-
"@storybook/addon-docs": "10.1.10",
43+
"@playwright/experimental-ct-react": "1.52.0",
44+
"@playwright/test": "1.52.0",
45+
"@storybook/addon-docs": "10.2.19",
4646
"@storybook/addon-webpack5-compiler-babel": "4.0.0",
47-
"@storybook/cli": "10.1.10",
47+
"@storybook/cli": "10.2.19",
4848
"@storybook/preset-scss": "1.0.3",
49-
"@storybook/react": "10.1.10",
50-
"@storybook/react-webpack5": "10.1.10",
49+
"@storybook/react": "10.2.19",
50+
"@storybook/react-webpack5": "10.2.19",
5151
"@types/markdown-it": "catalog:",
5252
"@types/node": "catalog:",
5353
"@types/react": "catalog:react",
@@ -64,7 +64,7 @@
6464
"react": "catalog:react",
6565
"react-dom": "catalog:react",
6666
"react-use": "catalog:",
67-
"storybook": "10.2.10",
67+
"storybook": "10.2.19",
6868
"stylelint": "catalog:linters",
6969
"ts-dedent": "2.2.0",
7070
"typescript": "catalog:ts",

demo/scripts/playwright-docker.sh

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ cd "$REPO_ROOT"
1010
echo "Running in $(pwd)"
1111

1212
IMAGE_NAME="mcr.microsoft.com/playwright"
13-
IMAGE_TAG="v1.49.0-jammy" # This version have to be synchronized with playwright version from package.json
13+
IMAGE_TAG="v1.52.0-jammy" # This version have to be synchronized with playwright version from package.json
1414

1515
PNPM_STORE_CACHE_DIR="$HOME/.cache/markdown-editor-playwright-docker-pnpm-store"
1616
NODE_MODULES_CACHE_DIR="$HOME/.cache/markdown-editor-playwright-docker-node-modules"
@@ -21,8 +21,11 @@ command_exists() {
2121

2222
run_command() {
2323
$CONTAINER_TOOL run --rm --network host -it -w /work \
24+
--platform linux/arm64 \
25+
--ipc=host \
2426
-v $(pwd):/work \
2527
-v "$NODE_MODULES_CACHE_DIR:/work/node_modules" \
28+
-v "$PNPM_STORE_CACHE_DIR:/root/.local/share/pnpm/store" \
2629
-e IS_DOCKER=1 \
2730
-e NODE_OPTIONS="--max-old-space-size=8192" \
2831
"$IMAGE_NAME:$IMAGE_TAG" \
@@ -40,6 +43,7 @@ fi
4043

4144
if [[ "$1" = "clear" ]]; then
4245
rm -rf "$NODE_MODULES_CACHE_DIR"
46+
rm -rf "$PNPM_STORE_CACHE_DIR"
4347
rm -rf "./demo/tests/playwright/.cache-docker"
4448
exit 0
4549
fi
@@ -49,8 +53,10 @@ init_pnpm() {
4953
run_command "COREPACK_INTEGRITY_KEYS=0 corepack pnpm config set store-dir $PNPM_STORE_CACHE_DIR"
5054
}
5155

52-
if [[ ! -d "$NODE_MODULES_CACHE_DIR" ]]; then
53-
mkdir -p "$NODE_MODULES_CACHE_DIR"
56+
mkdir -p "$NODE_MODULES_CACHE_DIR"
57+
mkdir -p "$PNPM_STORE_CACHE_DIR"
58+
59+
if [[ -z "$(ls -A "$NODE_MODULES_CACHE_DIR")" ]]; then
5460
init_pnpm
5561
run_command "COREPACK_INTEGRITY_KEYS=0 corepack pnpm i --frozen-lockfile"
5662
else
@@ -59,8 +65,14 @@ fi
5965

6066
if [[ "$1" = "test" ]]; then
6167
echo "Running playwright tests"
68+
EXTRA_ARGS=""
69+
if [[ $# -ge 2 ]]; then
70+
for arg in "${@:2}"; do
71+
EXTRA_ARGS="$EXTRA_ARGS $(printf '%q' "$arg")"
72+
done
73+
fi
6274
run_command 'COREPACK_INTEGRITY_KEYS=0 corepack pnpm --filter '@gravity-ui/*' build'
63-
run_command 'COREPACK_INTEGRITY_KEYS=0 corepack pnpm --filter '@markdown-editor/demo' run playwright'
75+
run_command "cd demo && COREPACK_INTEGRITY_KEYS=0 corepack pnpm exec playwright test --config=tests/playwright/playwright.config.ts $EXTRA_ARGS"
6476
exit 0
6577
fi
6678

demo/tests/playwright/playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const config: PlaywrightTestConfig = {
5454
snapshotPathTemplate:
5555
'{testDir}/__snapshots__/{testFileName}-snapshots/{arg}{-projectName}-linux{ext}',
5656
/* Maximum time one test can run for. */
57-
timeout: 10 * 1000,
57+
timeout: 15 * 1000,
5858
/* Run tests in files in parallel */
5959
fullyParallel: true,
6060
/* Fail the build on CI if you accidentally left test.only in the source code. */

0 commit comments

Comments
 (0)