Skip to content

Commit 3114183

Browse files
chore: build project before playwright test (#777)
Co-authored-by: Daniel Roe <daniel@roe.dev>
1 parent 415728e commit 3114183

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,11 @@ jobs:
8787
- name: 📦 Install dependencies
8888
run: pnpm install
8989

90+
- name: 🏗️ Build project
91+
run: pnpm build:playwright
92+
9093
- name: 🖥️ Test project (browser)
91-
run: pnpm test:browser
94+
run: pnpm test:browser:prebuilt
9295

9396
a11y:
9497
runs-on: ubuntu-latest

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"scripts": {
1313
"build": "nuxt build",
1414
"build:lunaria": "node ./lunaria/lunaria.ts",
15+
"build:playwright": "NODE_ENV=test pnpm build",
1516
"dev": "nuxt dev",
1617
"dev:docs": "pnpm run --filter npmx-docs dev --port=3001",
1718
"i18n:check": "node scripts/compare-translations.ts",
@@ -27,13 +28,14 @@
2728
"postinstall": "nuxt prepare && simple-git-hooks && pnpm generate:lexicons",
2829
"generate:lexicons": "lex build --lexicons lexicons --out shared/types/lexicons --clear",
2930
"test": "vite test",
30-
"test:browser": "playwright test",
31-
"test:browser:ui": "playwright test --ui",
32-
"test:browser:update": "playwright test --update-snapshots",
31+
"test:browser": "pnpm build:playwright && pnpm test:browser:prebuilt",
32+
"test:browser:prebuilt": "playwright test",
33+
"test:browser:ui": "pnpm build:playwright && pnpm test:browser:prebuilt --ui",
34+
"test:browser:update": "pnpm build:playwright && pnpm test:browser:prebuilt --update-snapshots",
3335
"test:nuxt": "vite test --project nuxt",
3436
"test:types": "nuxt prepare && vue-tsc -b --noEmit && pnpm --filter npmx-connector test:types",
3537
"test:unit": "vite test --project unit",
36-
"start:playwright:webserver": "NODE_ENV=test pnpm build && pnpm preview --port 5678"
38+
"start:playwright:webserver": "NODE_ENV=test pnpm preview --port 5678"
3739
},
3840
"dependencies": {
3941
"@atproto/api": "^0.18.17",

playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default defineConfig<ConfigOptions>({
1616
command: 'pnpm start:playwright:webserver',
1717
url: baseURL,
1818
reuseExistingServer: false,
19-
timeout: 240_000,
19+
timeout: 60_000,
2020
},
2121
use: {
2222
baseURL,

0 commit comments

Comments
 (0)