Skip to content

Commit 183b2e9

Browse files
gwleclercclaude
andcommitted
ci: run the Playwright e2e non-regression suite in CI
Add a `make test-e2e` target that builds the client and backend, serves the built client through smocker (seeded with tests/sessions), runs the Playwright suite against it, then stops the server. Wire it into CI as a dedicated `e2e` job (installs the Chromium browser via `npx playwright install --with-deps`) and make `deploy` depend on it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 8c0db89 commit 183b2e9

2 files changed

Lines changed: 42 additions & 1 deletion

File tree

.github/workflows/main.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,32 @@ jobs:
102102
name: smocker-bin
103103
path: ./build/smocker.tar.gz
104104

105+
e2e:
106+
runs-on: ubuntu-latest
107+
timeout-minutes: 10
108+
steps:
109+
- uses: actions/checkout@v4
110+
111+
- uses: actions/setup-node@v4
112+
with:
113+
node-version-file: .nvmrc
114+
cache: npm
115+
116+
- name: Setup Go environment
117+
uses: actions/setup-go@v5
118+
with:
119+
go-version: stable
120+
121+
- run: npm ci
122+
123+
- name: Install Playwright browser
124+
run: npx playwright install --with-deps chromium
125+
126+
- name: Run Playwright non-regression suite
127+
run: make test-e2e
128+
105129
deploy:
106-
needs: [lint, test, build]
130+
needs: [lint, test, build, e2e]
107131
if: startsWith(github.ref, 'refs/tags/')
108132
runs-on: ubuntu-latest
109133
timeout-minutes: 10

Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,23 @@ test-integration: $(VENOM) check-default-ports persistence
102102
start-integration: $(VENOM)
103103
$(VENOM) run tests/features/$(SUITE)
104104

105+
# End-to-end UI non-regression tests (Playwright). Builds the client and backend, serves the
106+
# built client through smocker (seeded with tests/sessions), runs the suite, then stops the
107+
# server. Requires the Playwright browser to be installed (npx playwright install chromium).
108+
E2E_MOCK_PORT ?= 8080
109+
E2E_ADMIN_PORT ?= 8081
110+
.PHONY: test-e2e
111+
test-e2e: build persistence
112+
npm run build
113+
SMOCKER_PERSISTENCE_DIRECTORY=./$(SESSIONS_DIR) ./$(BUILD_DIR)/$(APPNAME) \
114+
--static-files ./$(BUILD_DIR)/client \
115+
--mock-server-listen-port=$(E2E_MOCK_PORT) --config-listen-port=$(E2E_ADMIN_PORT) \
116+
> $(BUILD_DIR)/e2e-smocker.log 2>&1 & \
117+
SMK_PID=$$!; \
118+
for i in $$(seq 1 30); do curl -sf localhost:$(E2E_ADMIN_PORT)/version >/dev/null 2>&1 && break; sleep 0.3; done; \
119+
SMOCKER_E2E_URL=http://localhost:$(E2E_ADMIN_PORT) npx playwright test --config tests/e2e/playwright.config.ts; \
120+
RC=$$?; kill $$SMK_PID 2>/dev/null || true; exit $$RC
121+
105122
$(COVERAGE_DIR)/test-cover.out:
106123
$(MAKE) test
107124

0 commit comments

Comments
 (0)