Add contract and Playwright PR checks

This commit is contained in:
Anthony Ettinger 2026-06-06 11:30:12 +00:00
parent 447974dbba
commit 254233c3ab
11 changed files with 277 additions and 45 deletions

View file

@ -0,0 +1,29 @@
import { expect, test } from "@playwright/test";
test.describe("CommandBoard.run PWA", () => {
test("renders the command board workspace", async ({ page }) => {
await page.goto("/");
await expect(page.getByText("CommandBoard.run").first()).toBeVisible();
await expect(page.getByRole("heading", { name: "The command network for humans and AI agents." })).toBeVisible();
await expect(page.getByText("/gigs", { exact: true })).toBeVisible();
await expect(page.getByText("QA checkout flow")).toBeVisible();
});
test("shows default plugin status including sh1pt", async ({ page }) => {
await page.goto("/");
await expect(page.getByText("CoinPay").last()).toBeVisible();
await expect(page.getByText("uGig").last()).toBeVisible();
await expect(page.getByText("sh1pt").last()).toBeVisible();
await expect(page.getByText("projects, actions, and releases")).toBeVisible();
});
test("surfaces sh1pt project activity", async ({ page }) => {
await page.goto("/");
await expect(page.getByText("/projects/sh1pt", { exact: true })).toBeVisible();
await expect(page.getByText("Release action published")).toBeVisible();
await expect(page.getByText("/projects/sh1pt · deployment ready")).toBeVisible();
});
});

View file

@ -5,12 +5,15 @@
"type": "module",
"scripts": {
"build": "node scripts/check-assets.js",
"dev": "vite --host 0.0.0.0"
"dev": "vite --host 0.0.0.0",
"test:e2e": "playwright test"
},
"dependencies": {
"@vitejs/plugin-react": "^5.1.1",
"vite": "^7.2.6",
"typescript": "^5.9.3"
},
"devDependencies": {}
"devDependencies": {
"@playwright/test": "^1.57.0"
}
}

View file

@ -0,0 +1,31 @@
import { defineConfig, devices } from "@playwright/test";
export default defineConfig({
testDir: "./e2e",
timeout: 30_000,
expect: {
timeout: 5_000
},
fullyParallel: true,
reporter: process.env.CI ? [["github"], ["list"]] : "list",
use: {
baseURL: "http://127.0.0.1:5173",
trace: "on-first-retry"
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] }
},
{
name: "mobile-chrome",
use: { ...devices["Pixel 7"] }
}
],
webServer: {
command: "npm run dev -- --port 5173",
url: "http://127.0.0.1:5173",
reuseExistingServer: !process.env.CI,
timeout: 30_000
}
});