Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,6 @@ jobs:
- name: 📥 Download deps
run: bun install --frozen-lockfile

- name: 🎭 Cache Playwright browsers
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: |
playwright-${{ runner.os }}-

- name: 🎭 Install Playwright browsers
run: bun run test:e2e:install

- name: 🧰 Setup env
run: bun run setup:env

Expand Down Expand Up @@ -151,17 +140,6 @@ jobs:
- name: 📥 Download deps
run: bun install --frozen-lockfile

- name: 🎭 Cache Playwright browsers
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: |
playwright-${{ runner.os }}-

- name: 📥 Install Playwright Browsers
run: bun run test:e2e:install

- name: 🧰 Setup env
run: bun run setup:env

Expand Down
28 changes: 14 additions & 14 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"test:e2e:dev": "bunx playwright test --ui",
"pretest:e2e:run": "bun run build",
"test:e2e:run": "cross-env CI=true bunx playwright test",
"test:e2e:install": "bunx playwright install --with-deps chromium",
"test:e2e:install": "bunx playwright install --with-deps --only-shell chromium",
"typecheck": "react-router typegen && tsc",
"benchmark:data": "bun ./scripts/benchmark-data-load.ts",
"benchmark:perf": "bun ./scripts/benchmark-performance.ts",
Expand Down Expand Up @@ -62,9 +62,9 @@
"@radix-ui/react-slot": "^1.2.4",
"@radix-ui/react-tabs": "^1.1.13",
"@radix-ui/react-tooltip": "^1.2.8",
"@react-router/express": "^7.13.0",
"@react-router/node": "^7.13.0",
"@react-router/remix-routes-option-adapter": "^7.13.0",
"@react-router/express": "^7.16.0",
"@react-router/node": "^7.16.0",
"@react-router/remix-routes-option-adapter": "^7.16.0",
"@sentry/react-router": "^10.38.0",
"@tailwindcss/vite": "^4.1.18",
"address": "^2.0.3",
Expand Down Expand Up @@ -94,8 +94,8 @@
"qrcode": "^1.5.4",
"react": "^19.2.4",
"react-dom": "^19.2.4",
"react-router": "^7.13.0",
"react-router-dom": "^7.13.0",
"react-router": "^7.16.0",
"react-router-dom": "^7.16.0",
"remix-utils": "^9.0.1",
"set-cookie-parser": "^3.0.1",
"set-interval-async": "^3.0.3",
Expand All @@ -110,8 +110,8 @@
"@epic-web/config": "^1.21.3",
"@faker-js/faker": "^10.2.0",
"@playwright/test": "^1.58.1",
"@react-router/dev": "^7.13.0",
"@react-router/serve": "^7.13.0",
"@react-router/dev": "^7.16.0",
"@react-router/serve": "^7.16.0",
"@sentry/vite-plugin": "^4.8.0",
"@sly-cli/sly": "^2.1.1",
"@total-typescript/ts-reset": "^0.6.1",
Expand Down
2 changes: 2 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { defineConfig, devices } from '@playwright/test'
import 'dotenv/config'

const PORT = process.env.PORT || '3000'
const browserChannel = process.env.GITHUB_ACTIONS ? 'chrome' : undefined

export default defineConfig({
testDir: './tests/e2e',
Expand Down Expand Up @@ -40,6 +41,7 @@ export default defineConfig({
name: 'chromium',
use: {
...devices['Desktop Chrome'],
channel: browserChannel,
},
},
],
Expand Down
16 changes: 16 additions & 0 deletions tests/setup/playwright-global-setup.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import fsExtra from 'fs-extra'
import { prisma } from '#app/utils/db.server.ts'
import { setup as dbSetup } from './global-setup.ts'

const __dirname = path.dirname(fileURLToPath(import.meta.url))
const fixturesDirPath = path.join(__dirname, '..', 'fixtures')
const defaultSourceNumber = '555-555-5555'

async function ensureSourceNumber() {
const existingSourceNumber = await prisma.sourceNumber.findFirst({
select: { id: true },
})
if (existingSourceNumber) return

await prisma.sourceNumber.create({
data: { phoneNumber: defaultSourceNumber },
select: { id: true },
})
}

/**
* Playwright global setup - runs once before all tests
Expand All @@ -16,6 +30,8 @@ export default async function globalSetup() {

// Run database setup
await dbSetup()
await ensureSourceNumber()
await prisma.$disconnect()

console.log('✓ Playwright global setup complete')
}
6 changes: 5 additions & 1 deletion vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import react from '@vitejs/plugin-react'
import { playwright } from '@vitest/browser-playwright'
import { defineConfig } from 'vitest/config'

const browserChannel = process.env.GITHUB_ACTIONS ? 'chrome' : undefined

export default defineConfig({
plugins: [react()],
css: { postcss: { plugins: [] } },
Expand All @@ -18,7 +20,9 @@ export default defineConfig({
restoreMocks: true,
browser: {
enabled: true,
provider: playwright(),
provider: playwright({
launchOptions: { channel: browserChannel },
}),
instances: [{ browser: 'chromium' }],
headless: true,
ui: false,
Expand Down
Loading