Skip to content

Commit 43d79cf

Browse files
committed
test: playwright instead of cucumber
1 parent 6fca7bb commit 43d79cf

File tree

15 files changed

+67
-1205
lines changed

15 files changed

+67
-1205
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
working-directory: backend
2222
run: uv run pytest
2323

24-
frontend-vitest:
24+
frontend-unit:
2525
runs-on: ubuntu-latest
2626
steps:
2727
- uses: actions/checkout@v4
@@ -34,11 +34,11 @@ jobs:
3434
- name: Install dependencies
3535
working-directory: frontend_omni
3636
run: pnpm install
37-
- name: Run vitest tests
37+
- name: Run unit tests
3838
working-directory: frontend_omni
39-
run: pnpm test
39+
run: pnpm test:unit
4040

41-
frontend-cucumber:
41+
frontend-e2e:
4242
runs-on: ubuntu-latest
4343
steps:
4444
- uses: actions/checkout@v4
@@ -54,6 +54,6 @@ jobs:
5454
- name: Install Playwright browsers
5555
working-directory: frontend_omni
5656
run: pnpm playwright install --with-deps
57-
- name: Run cucumber tests
57+
- name: Run Playwright tests
5858
working-directory: frontend_omni
59-
run: pnpm test:cucumber
59+
run: pnpm test:e2e

AGENTS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ uv run pytest tests/test_*.py # Run specific test file
125125

126126
```bash
127127
cd frontend_omni
128-
pnpm test # Run tests
128+
pnpm test:unit # Run unit tests (vitest)
129+
pnpm test:e2e # Run e2e tests (Playwright)
129130
pnpm build # Build for production
130131
pnpm lint # Run linter
131132
```

frontend_omni/.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ yarn-error.log*
77
pnpm-debug.log*
88
lerna-debug.log*
99

10-
node_modules
11-
dist
10+
node_modules/
11+
dist/
1212
dist-ssr
1313
*.local
14+
playwright-report/
15+
test-results/
1416

1517
# Editor directories and files
1618
.vscode/*

frontend_omni/README.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,3 @@ The frontend is now available under http://localhost:5173
1616
**React Compionents**: PascalCase
1717
**React Services/Hooks**: camalCase
1818
**Folders**: kebab-case
19-
20-
## Testiong
21-
22-
### VS Code Cucumber Extension
23-
24-
In order to make the cucumber extension find cucumber tests, the paths must be adapted for
25-
26-
- `cucumber.features` and
27-
- `cucumber.glue`.
28-
29-
The `frontend_onmi` must be prepended to all the paths.

frontend_omni/cucumber.cjs

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

frontend_omni/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
"check": "biome check",
1010
"check:write": "biome check --write",
1111
"preview": "vite preview",
12-
"test": "vitest run",
13-
"test:cucumber": "cucumber-js",
14-
"test:cucumber:headed": "HEADED=true cucumber-js"
12+
"test": "pnpm test:unit && pnpm test:e2e",
13+
"test:unit": "vitest run",
14+
"test:e2e": "playwright test",
15+
"test:e2e:headed": "playwright test --headed",
16+
"test:e2e:ui": "playwright test --ui"
1517
},
1618
"dependencies": {
1719
"@ai-sdk/openai": "^2.0.52",
@@ -62,7 +64,6 @@
6264
},
6365
"devDependencies": {
6466
"@biomejs/biome": "2.2.6",
65-
"@cucumber/cucumber": "^12.2.0",
6667
"@playwright/test": "^1.56.1",
6768
"@testing-library/jest-dom": "^6.8.0",
6869
"@testing-library/react": "^16.3.0",
@@ -87,4 +88,4 @@
8788
"vite": "npm:rolldown-vite@7.1.14"
8889
}
8990
}
90-
}
91+
}

frontend_omni/playwright.config.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@ import { defineConfig, devices } from "@playwright/test";
22

33
export default defineConfig({
44
testDir: "./tests",
5+
testMatch: "**/*.spec.ts",
56
fullyParallel: true,
67
forbidOnly: !!process.env.CI,
78
retries: process.env.CI ? 2 : 0,
89
workers: process.env.CI ? 1 : undefined,
9-
reporter: "html",
10+
reporter: [
11+
["html", { open: "never" }], // Generate HTML report but don't auto-open
12+
["list"] // Also show results in terminal
13+
],
1014
use: {
1115
baseURL: "http://localhost:4173",
1216
trace: "on-first-retry",
@@ -20,13 +24,14 @@ export default defineConfig({
2024
name: "firefox",
2125
use: { ...devices["Desktop Firefox"] },
2226
},
23-
{
24-
name: "webkit",
25-
use: { ...devices["Desktop Safari"] },
26-
},
27+
// Support this later at some point
28+
// {
29+
// name: "webkit",
30+
// use: { ...devices["Desktop Safari"] },
31+
// },
2732
],
2833
webServer: {
29-
command: "pnpm preview",
34+
command: "pnpm build && pnpm preview",
3035
url: "http://localhost:4173",
3136
reuseExistingServer: !process.env.CI,
3237
},

0 commit comments

Comments
 (0)