Skip to content

Commit 6ab5741

Browse files
fix(e2e): improve test stability and developer experience (#337)
* fix(e2e): add masks for dynamic content and increase timeouts for slow servers - Add HOST_MASKS for Tool Input/Result panels with dynamic timestamps - Add say-server to SLOW_SERVERS (10s) for TTS model download - Add say-server to EXTRA_WAIT_MS (30s) in generate-grid-screenshots * feat: add update-lock:docker script to regenerate lockfile with public registry * pin package versions for dev compatibility * feat(basic-host): add ?theme=hide query param to hide theme toggle in screenshots - Add hideThemeToggle param to getQueryParams() - Conditionally render ThemeToggle based on ?theme=hide - Update e2e tests to use ?theme=hide for consistent screenshots * update screenshots * update screenshots * fix(husky): load Node.js environment for GUI apps like GitHub Desktop * fix(e2e): increase map-server wait time to 15s for tile loading * fix(e2e): increase waitForAppLoad timeout to 30s for nested iframe loading * ci: add workflow to update e2e snapshots * ci: trigger snapshot update on push to this branch * chore: update e2e snapshots [skip ci] * ci: trigger CI after snapshot update * style: fix prettier formatting in update-snapshots workflow * fix: pin seroval, seroval-plugins, and solid-js for dev compatibility --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 2da8d86 commit 6ab5741

24 files changed

Lines changed: 119 additions & 26 deletions
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Update E2E Snapshots
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
branch:
7+
description: "Branch to update snapshots on"
8+
required: true
9+
default: "main"
10+
# Temporary: auto-run on this branch to update snapshots
11+
push:
12+
branches:
13+
- "ochafik/fix-e2e-flaky-tests"
14+
paths:
15+
- ".github/workflows/update-snapshots.yml"
16+
17+
permissions:
18+
contents: write
19+
20+
jobs:
21+
update-snapshots:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
ref: ${{ github.event.inputs.branch || github.ref }}
27+
token: ${{ secrets.GITHUB_TOKEN }}
28+
29+
- uses: oven-sh/setup-bun@v2
30+
with:
31+
bun-version: latest
32+
33+
- uses: actions/setup-node@v4
34+
with:
35+
node-version: "20"
36+
37+
- uses: astral-sh/setup-uv@v5
38+
39+
- run: npm ci
40+
41+
- name: Install Playwright browsers
42+
run: npx playwright install --with-deps chromium
43+
44+
- name: Update snapshots
45+
run: npx playwright test --update-snapshots --reporter=list
46+
47+
- name: Commit updated snapshots
48+
run: |
49+
git config user.name "github-actions[bot]"
50+
git config user.email "github-actions[bot]@users.noreply.github.com"
51+
git add tests/e2e/**/*.png
52+
git diff --staged --quiet || git commit -m "chore: update e2e snapshots [skip ci]"
53+
git push

examples/basic-host/src/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,14 @@ interface HostProps {
5555
type ToolCallEntry = ToolCallInfo & { id: number };
5656
let nextToolCallId = 0;
5757

58-
// Parse URL query params for debugging: ?server=name&tool=name&call=true
58+
// Parse URL query params for debugging: ?server=name&tool=name&call=true&theme=hide
5959
function getQueryParams() {
6060
const params = new URLSearchParams(window.location.search);
6161
return {
6262
server: params.get("server"),
6363
tool: params.get("tool"),
6464
call: params.get("call") === "true",
65+
hideThemeToggle: params.get("theme") === "hide",
6566
};
6667
}
6768

@@ -107,7 +108,7 @@ function Host({ serversPromise }: HostProps) {
107108

108109
return (
109110
<>
110-
<ThemeToggle />
111+
{!queryParams.hideThemeToggle && <ThemeToggle />}
111112
{toolCalls.map((info) => (
112113
<ToolCallInfoPanel
113114
key={info.id}

examples/basic-server-solid/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"@modelcontextprotocol/sdk": "^1.24.0",
2727
"cors": "^2.8.5",
2828
"express": "^5.1.0",
29-
"solid-js": "1.9.11",
29+
"solid-js": "1.9.10",
3030
"zod": "^4.1.13"
3131
},
3232
"devDependencies": {

examples/map-server/grid-cell.png

-1.24 KB
Loading

examples/map-server/screenshot.png

6.98 KB
Loading
1.71 KB
Loading
-2.56 KB
Loading
735 Bytes
Loading

package-lock.json

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,5 +135,10 @@
135135
"@rollup/rollup-linux-x64-gnu": "^4.53.3",
136136
"@rollup/rollup-win32-arm64-msvc": "^4.53.3",
137137
"@rollup/rollup-win32-x64-msvc": "^4.53.3"
138+
},
139+
"overrides": {
140+
"seroval": "1.4.1",
141+
"seroval-plugins": "1.4.2",
142+
"solid-js": "1.9.10"
138143
}
139144
}

0 commit comments

Comments
 (0)