Generates a markdown summary table in GitHub Actions showing passed/failed tests with timing per test. Uses the JSON reporter to output results, then a Node script to format as markdown and append to $GITHUB_STEP_SUMMARY. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
54 lines
1.3 KiB
TypeScript
54 lines
1.3 KiB
TypeScript
import { defineConfig, devices } from "@playwright/test";
|
|
|
|
export default defineConfig({
|
|
testDir: "./e2e",
|
|
outputDir: "./e2e/results",
|
|
fullyParallel: true,
|
|
retries: process.env.CI ? 2 : 0,
|
|
workers: process.env.CI ? 1 : undefined,
|
|
reporter: process.env.CI
|
|
? [["github"], ["html", { open: "never" }], ["json", { outputFile: "playwright-results.json" }]]
|
|
: "list",
|
|
use: {
|
|
baseURL: "http://localhost:3000",
|
|
trace: "on-first-retry",
|
|
screenshot: "only-on-failure",
|
|
},
|
|
projects: [
|
|
{
|
|
name: "journal",
|
|
testMatch: "journal.test.ts",
|
|
use: {
|
|
...devices["Desktop Chrome"],
|
|
baseURL: "http://localhost:3000",
|
|
},
|
|
},
|
|
{
|
|
name: "planner",
|
|
testMatch: "planner.test.ts",
|
|
use: {
|
|
...devices["Desktop Chrome"],
|
|
baseURL: "http://localhost:3001",
|
|
},
|
|
},
|
|
{
|
|
name: "integration",
|
|
testMatch: "integration.test.ts",
|
|
use: {
|
|
...devices["Desktop Chrome"],
|
|
},
|
|
},
|
|
],
|
|
webServer: [
|
|
{
|
|
command: "pnpm --filter @trails-cool/journal dev",
|
|
url: "http://localhost:3000",
|
|
reuseExistingServer: !process.env.CI,
|
|
},
|
|
{
|
|
command: "pnpm --filter @trails-cool/planner dev",
|
|
url: "http://localhost:3001",
|
|
reuseExistingServer: !process.env.CI,
|
|
},
|
|
],
|
|
});
|