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
36 changes: 36 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Playwright Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm install
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: Build
run: pnpm run build
- name: Run app and e2e tests
env:
USE_MOCK_DATA: true
run: |
pnpm run preview &
npx wait-on http://localhost:4173 --timeout 60000
pnpm exec playwright test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,10 @@ vite.config.ts.timestamp-*

# Coolify
coolify.config.json
deploy.config.json
deploy.config.json

# Playwright
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
162 changes: 82 additions & 80 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,82 +1,84 @@
{
"name": "slimstarter",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"test": "npm run test:integration && npm run test:unit",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check . && eslint .",
"format": "prettier --write .",
"test:integration": "playwright test",
"test:unit": "vitest",
"db:studio": "npx drizzle-kit studio",
"db:generate": "npx drizzle-kit generate",
"db:migrate": "npx drizzle-kit migrate",
"prod": "pnpm db:migrate && PORT=5173 node build"
},
"devDependencies": {
"@iconify/svelte": "^4.2.0",
"@inlang/paraglide-js": "1.11.3",
"@playwright/test": "^1.49.1",
"@sveltejs/adapter-auto": "^3.3.1",
"@sveltejs/adapter-node": "^5.2.12",
"@sveltejs/kit": "^2.16.0",
"@sveltejs/vite-plugin-svelte": "^4.0.4",
"@types/eslint": "^9.6.1",
"autoprefixer": "^10.4.20",
"bits-ui": "1.0.0-next.78",
"clsx": "^2.1.1",
"drizzle-kit": "^0.25.0",
"eslint": "^9.18.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.46.1",
"formsnap": "^2.0.0",
"globals": "^15.14.0",
"lucide-svelte": "^0.454.0",
"mdsvex": "^0.12.3",
"mode-watcher": "^0.5.0",
"postcss": "^8.5.1",
"prettier": "^3.4.2",
"prettier-plugin-svelte": "^3.3.3",
"svelte": "^5.19.0",
"svelte-check": "^4.1.4",
"svelte-meta-tags": "^4.1.0",
"svelte-radix": "^1.1.1",
"svelte-sonner": "^0.3.28",
"sveltekit-superforms": "^2.22.1",
"tailwind-merge": "^2.6.0",
"tailwind-variants": "^0.2.1",
"tailwindcss": "^3.4.17",
"tailwindcss-animate": "^1.0.7",
"typescript": "^5.7.3",
"typescript-eslint": "^8.20.0",
"vite": "^5.4.12",
"vitest": "^2.1.8",
"zod": "^3.24.1"
},
"type": "module",
"dependencies": {
"@inlang/paraglide-sveltekit": "0.11.5",
"@node-rs/argon2": "^1.8.3",
"@oslojs/binary": "^1.0.0",
"@oslojs/crypto": "^1.0.1",
"@oslojs/encoding": "^1.1.0",
"@oslojs/otp": "^1.1.0",
"@oslojs/webauthn": "^1.0.0",
"@paddle/paddle-js": "^1.3.3",
"@paddle/paddle-node-sdk": "^1.10.0",
"@pilcrowjs/object-parser": "^0.0.4",
"arctic": "^2.3.3",
"dotenv": "^16.4.7",
"drizzle-orm": "^0.34.1",
"pg": "^8.13.1",
"postgres": "^3.4.5",
"svelte-inview": "^4.0.4",
"svelte-motion": "^0.12.2",
"uqr": "^0.1.2"
}
"name": "slimstarter",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"test": "npm run test:integration && npm run test:unit",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check . && eslint .",
"format": "prettier --write .",
"test:integration": "playwright test",
"test:unit": "vitest",
"db:studio": "npx drizzle-kit studio",
"db:generate": "npx drizzle-kit generate",
"db:migrate": "npx drizzle-kit migrate",
"prod": "pnpm db:migrate && PORT=5173 node build",
"test:e2e": "pnpm exec playwright test"
},
"devDependencies": {
"@iconify/svelte": "^4.2.0",
"@inlang/paraglide-js": "1.11.3",
"@playwright/test": "^1.49.1",
"@sveltejs/adapter-auto": "^3.3.1",
"@sveltejs/adapter-node": "^5.2.12",
"@sveltejs/kit": "^2.16.0",
"@sveltejs/vite-plugin-svelte": "^4.0.4",
"@types/eslint": "^9.6.1",
"@types/node": "^22.13.0",
"autoprefixer": "^10.4.20",
"bits-ui": "1.0.0-next.78",
"clsx": "^2.1.1",
"drizzle-kit": "^0.25.0",
"eslint": "^9.18.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.46.1",
"formsnap": "^2.0.0",
"globals": "^15.14.0",
"lucide-svelte": "^0.454.0",
"mdsvex": "^0.12.3",
"mode-watcher": "^0.5.0",
"postcss": "^8.5.1",
"prettier": "^3.4.2",
"prettier-plugin-svelte": "^3.3.3",
"svelte": "^5.19.0",
"svelte-check": "^4.1.4",
"svelte-meta-tags": "^4.1.0",
"svelte-radix": "^1.1.1",
"svelte-sonner": "^0.3.28",
"sveltekit-superforms": "^2.22.1",
"tailwind-merge": "^2.6.0",
"tailwind-variants": "^0.2.1",
"tailwindcss": "^3.4.17",
"tailwindcss-animate": "^1.0.7",
"typescript": "^5.7.3",
"typescript-eslint": "^8.20.0",
"vite": "^5.4.12",
"vitest": "^2.1.8",
"zod": "^3.24.1"
},
"type": "module",
"dependencies": {
"@inlang/paraglide-sveltekit": "0.11.5",
"@node-rs/argon2": "^1.8.3",
"@oslojs/binary": "^1.0.0",
"@oslojs/crypto": "^1.0.1",
"@oslojs/encoding": "^1.1.0",
"@oslojs/otp": "^1.1.0",
"@oslojs/webauthn": "^1.0.0",
"@paddle/paddle-js": "^1.3.3",
"@paddle/paddle-node-sdk": "^1.10.0",
"@pilcrowjs/object-parser": "^0.0.4",
"arctic": "^2.3.3",
"dotenv": "^16.4.7",
"drizzle-orm": "^0.34.1",
"pg": "^8.13.1",
"postgres": "^3.4.5",
"svelte-inview": "^4.0.4",
"svelte-motion": "^0.12.2",
"uqr": "^0.1.2"
}
}
79 changes: 79 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import { defineConfig, devices } from '@playwright/test';

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
// import dotenv from 'dotenv';
// import path from 'path';
// dotenv.config({ path: path.resolve(__dirname, '.env') });

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './tests',
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
// baseURL: 'http://127.0.0.1:3000',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
},

/* Configure projects for major browsers */
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},

{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},

{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},

/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
// {
// name: 'Mobile Safari',
// use: { ...devices['iPhone 12'] },
// },

/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
// },
// {
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
// },
],

/* Run your local dev server before starting the tests */
// webServer: {
// command: 'npm run start',
// url: 'http://127.0.0.1:3000',
// reuseExistingServer: !process.env.CI,
// },
});
Loading