Skip to content

Commit 61b26fa

Browse files
committed
remove cucumber
1 parent d6dea31 commit 61b26fa

File tree

18 files changed

+135
-1262
lines changed

18 files changed

+135
-1262
lines changed

.github/workflows/bdd.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: BDD E2E
1+
name: E2E Tests
22

33
on:
44
push:
@@ -11,9 +11,9 @@ permissions:
1111

1212
jobs:
1313
e2e:
14-
name: Run BDD (Cucumber + Playwright)
14+
name: Playwright E2E
1515
runs-on: ubuntu-latest
16-
timeout-minutes: 20
16+
timeout-minutes: 15
1717
steps:
1818
- name: Checkout
1919
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
@@ -22,7 +22,7 @@ jobs:
2222
uses: ./.github/actions/setup
2323

2424
- name: Install Playwright browsers
25-
run: pnpm exec playwright install --with-deps
25+
run: pnpm exec playwright install --with-deps chromium
2626

2727
- name: Start dev stack (Next + OIDC + Mock)
2828
env:
@@ -40,7 +40,7 @@ jobs:
4040
for url in http://localhost:3000 http://localhost:4000/.well-known/openid-configuration http://localhost:9090/health; do
4141
echo "Waiting for $url..."
4242
up=false
43-
for i in {1..60}; do
43+
for i in {1..30}; do
4444
if curl -sf "$url" >/dev/null; then
4545
echo "$url is up"
4646
up=true
@@ -54,13 +54,22 @@ jobs:
5454
fi
5555
done
5656
57-
- name: Run BDD tests
57+
- name: Run Playwright tests
5858
env:
5959
BASE_URL: http://localhost:3000
60-
run: pnpm run test:bdd
60+
run: pnpm run test:e2e
61+
62+
- name: Upload test artifacts
63+
uses: actions/upload-artifact@v4
64+
if: failure()
65+
with:
66+
name: playwright-report
67+
path: |
68+
test-results/
69+
playwright-report/
70+
retention-days: 7
6171

6272
- name: Cleanup dev
6373
if: always()
6474
run: |
6575
if [ -f dev.pid ]; then kill $(cat dev.pid) || true; fi
66-

CLAUDE.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,18 +222,18 @@ pnpm generate-client:nofetch # Regenerate without fetching
222222
- **Testing Library** - Component testing
223223
- **jsdom** - DOM simulation
224224

225-
### BDD E2E (Cucumber + Playwright)
225+
### E2E Tests (Playwright)
226226

227-
- End-to-end scenarios live under `tests/bdd` and run against a live dev stack.
227+
- End-to-end tests live under `tests/e2e` and run against a live dev stack.
228228
- Commands:
229229
- `pnpm dev` – starts Next.js (3000), mock OIDC (4000), and MSW mock API (9090)
230-
- `pnpm run test:bdd` – runs Cucumber scenarios with Playwright (headless)
231-
- `pnpm run test:bdd:debug`runs with Playwright Inspector (headed, pauses on start)
232-
- `pnpm run test:bdd:trace` – runs with Playwright tracing, artifacts in `test-results/traces/*.zip`
233-
- CI runs BDD tests via `.github/workflows/bdd.yml` and installs Playwright browsers.
230+
- `pnpm run test:e2e` – runs Playwright tests (headless)
231+
- `pnpm run test:e2e:ui`opens Playwright UI mode for interactive debugging
232+
- `pnpm run test:e2e:debug` – runs with Playwright Inspector
233+
- CI runs E2E tests via `.github/workflows/bdd.yml` and installs Playwright browsers.
234234
- Install browsers locally once: `pnpm exec playwright install`
235235

236-
Scaffolded global steps include navigation, clicking buttons by accessible name, URL assertions, and text/heading checks. Prefer reusing global steps; add domain-specific ones only when needed for clarity.
236+
Tests use custom fixtures for authentication. The `authenticatedPage` fixture handles login automatically.
237237

238238
### Example Test
239239

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -285,14 +285,14 @@ pnpm test --coverage # With coverage
285285

286286
Uses Vitest + Testing Library + MSW.
287287

288-
#### BDD E2E Tests (Cucumber + Playwright)
288+
#### E2E Tests (Playwright)
289289

290290
```bash
291291
pnpm exec playwright install # One-time browser install
292292
pnpm dev # Start dev stack
293-
pnpm run test:bdd # Run scenarios (headless)
294-
pnpm run test:bdd:debug # With Playwright Inspector
295-
pnpm run test:bdd:trace # Capture traces
293+
pnpm run test:e2e # Run tests (headless)
294+
pnpm run test:e2e:ui # Playwright UI mode
295+
pnpm run test:e2e:debug # With Playwright Inspector
296296
```
297297

298298
### Mock Server
@@ -479,16 +479,16 @@ pnpm type-check # TypeScript
479479
pnpm lint # Biome
480480
```
481481

482-
### BDD E2E (Cucumber + Playwright)
482+
### E2E Tests (Playwright)
483483

484484
Run the app and E2E tests locally:
485485

486486
```bash
487487
pnpm exec playwright install # one-time browser install
488488
pnpm dev # start Next (3000) + OIDC (4000) + Mock API (9090)
489-
pnpm run test:bdd # run Cucumber scenarios (headless)
490-
pnpm run test:bdd:debug # headed with Playwright Inspector (PWDEBUG=1)
491-
pnpm run test:bdd:trace # capture Playwright traces (PWTRACE=1)
489+
pnpm run test:e2e # run Playwright tests (headless)
490+
pnpm run test:e2e:ui # Playwright UI mode for debugging
491+
pnpm run test:e2e:debug # with Playwright Inspector
492492
```
493493

494494
CI runs the E2E suite via `.github/workflows/bdd.yml`.

cucumber.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

package.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
"lint": "biome check",
1414
"format": "biome format --write",
1515
"test": "vitest",
16-
"test:bdd": "cucumber-js",
17-
"test:bdd:trace": "PWTRACE=1 cucumber-js",
18-
"test:bdd:debug": "PWDEBUG=1 cucumber-js",
16+
"test:e2e": "playwright test",
17+
"test:e2e:ui": "playwright test --ui",
18+
"test:e2e:debug": "playwright test --debug",
1919
"type-check": "tsc --noEmit",
2020
"prepare": "husky",
2121
"oidc": "node dev-auth/oidc-provider.mjs",
@@ -51,8 +51,6 @@
5151
},
5252
"devDependencies": {
5353
"@biomejs/biome": "2.3.8",
54-
"@cucumber/cucumber": "^12.2.0",
55-
"@cucumber/messages": "^31.0.0",
5654
"@hey-api/client-next": "0.5.1",
5755
"@hey-api/openapi-ts": "0.89.0",
5856
"@mswjs/http-middleware": "^0.10.2",
@@ -66,7 +64,6 @@
6664
"@types/react": "^19",
6765
"@types/react-dom": "^19",
6866
"@vitejs/plugin-react": "^5.1.1",
69-
"aria-query": "^5.3.2",
7067
"babel-plugin-react-compiler": "1.0.0",
7168
"concurrently": "^9.2.1",
7269
"dotenv": "^17.2.3",
@@ -75,7 +72,6 @@
7572
"lint-staged": "^16.0.0",
7673
"oidc-provider": "^9.5.2",
7774
"tailwindcss": "^4",
78-
"ts-node": "^10.9.2",
7975
"tsx": "4.21.0",
8076
"typescript": "^5",
8177
"vite": "^7.2.2",

playwright.config.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { defineConfig, devices } from "@playwright/test";
2+
3+
const BASE_URL = process.env.BASE_URL || "http://localhost:3000";
4+
5+
export default defineConfig({
6+
testDir: "./tests/e2e",
7+
fullyParallel: true,
8+
forbidOnly: !!process.env.CI,
9+
retries: process.env.CI ? 2 : 0,
10+
workers: process.env.CI ? 1 : undefined,
11+
reporter: process.env.CI ? "github" : "list",
12+
timeout: 30_000,
13+
use: {
14+
baseURL: BASE_URL,
15+
trace: "on-first-retry",
16+
screenshot: "only-on-failure",
17+
},
18+
projects: [
19+
{
20+
name: "chromium",
21+
use: { ...devices["Desktop Chrome"] },
22+
},
23+
],
24+
webServer: {
25+
command: "pnpm dev",
26+
url: BASE_URL,
27+
reuseExistingServer: !process.env.CI,
28+
timeout: 120_000,
29+
stdout: "pipe",
30+
stderr: "pipe",
31+
env: {
32+
API_BASE_URL: "http://localhost:9090",
33+
OIDC_ISSUER_URL: "http://localhost:4000",
34+
OIDC_CLIENT_ID: "better-auth-dev",
35+
OIDC_CLIENT_SECRET: "dev-secret-change-in-production",
36+
NEXT_PUBLIC_OIDC_PROVIDER_ID: "okta",
37+
BETTER_AUTH_URL: "http://localhost:3000",
38+
BETTER_AUTH_SECRET: "e2e-test-secret-at-least-32-chars-long",
39+
},
40+
},
41+
});

0 commit comments

Comments
 (0)