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
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,50 @@ jobs:

- name: Test
run: dotnet test --no-build

e2e:
runs-on: ubuntu-latest
needs: lint
timeout-minutes: 15
steps:
- uses: actions/checkout@v6

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '22'
cache: 'npm'

- name: Download Tailwind CSS
run: bash tools/download-tailwind.sh

- name: Restore .NET
run: dotnet restore

- name: Build .NET
run: dotnet build --no-restore

- name: Install npm dependencies
run: npm ci

- name: Build frontend
run: npm run build

- name: Install Playwright browsers
run: npx -w tests/e2e playwright install --with-deps

- name: Run smoke tests
run: npm run test:smoke -w tests/e2e

- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: tests/e2e/playwright-report/
retention-days: 14
37 changes: 14 additions & 23 deletions tests/e2e/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import { defineConfig, devices } from '@playwright/test';

const isCI = !!process.env.CI;
const baseURL = isCI ? 'http://localhost:5000' : 'https://localhost:5001';

export default defineConfig({
testDir: './tests',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: [['html'], ...(process.env.CI ? [['github' as const]] : [])],
forbidOnly: isCI,
retries: isCI ? 2 : 0,
workers: isCI ? 1 : undefined,
reporter: [['html'], ...(isCI ? [['github' as const]] : [])],
use: {
baseURL: 'https://localhost:5001',
baseURL,
trace: 'on-first-retry',
ignoreHTTPSErrors: true,
screenshot: 'only-on-failure',
Expand All @@ -23,30 +26,18 @@ export default defineConfig({
use: { ...devices['Desktop Chrome'] },
dependencies: ['setup'],
},
...(process.env.CI
? [
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
dependencies: ['setup'],
},
{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
dependencies: ['setup'],
},
]
: []),
],
webServer: {
command: 'dotnet run --project ../../template/SimpleModule.Host',
url: 'https://localhost:5001/health/live',
command: isCI
? 'dotnet run --project ../../template/SimpleModule.Host --launch-profile http'
: 'dotnet run --project ../../template/SimpleModule.Host',
url: `${baseURL}/health/live`,
reuseExistingServer: true,
ignoreHTTPSErrors: true,
timeout: 60_000,
timeout: 120_000,
env: {
...process.env,
ASPNETCORE_URLS: 'https://localhost:5001',
ASPNETCORE_URLS: baseURL,
Database__DefaultConnection: 'Data Source=e2e-test.db',
},
},
Expand Down
Loading