test(web-tanstack): add Playwright scaffold + skipped home spec

This commit is contained in:
2026-05-05 09:26:19 +02:00
parent 106e5c2737
commit a7b9890db5
5 changed files with 42 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
import { test, expect } from "@playwright/test";
test.skip(
"TanStack home renders site name + nav (pending TanStack Start runtime)",
async ({ page }) => {
// Pending: web-tanstack has no dev server yet. When the TanStack Start
// runtime is wired (future plan), update the playwright.config.ts
// webServer to start it on port 3002 and remove this skip.
await page.goto("http://localhost:3002");
await expect(page.locator("h1").first()).toBeVisible();
},
);

View File

@@ -7,6 +7,7 @@
"build": "echo 'placeholder — TanStack Start build configured in later plan'",
"dev": "echo 'placeholder'",
"lint": "eslint .",
"test:e2e": "playwright test",
"typecheck": "tsc --noEmit"
},
"dependencies": {
@@ -22,6 +23,7 @@
"react-dom": "^19.0.0"
},
"devDependencies": {
"@playwright/test": "^1.50.0",
"@repo/eslint-config": "workspace:*",
"@repo/typescript-config": "workspace:*",
"@types/node": "^22.0.0",

View File

@@ -0,0 +1,21 @@
import { defineConfig, devices } from "@playwright/test";
export default defineConfig({
testDir: "./e2e",
fullyParallel: true,
retries: process.env.CI ? 2 : 0,
reporter: "list",
use: {
baseURL: "http://localhost:3000",
trace: "on-first-retry",
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],
// No webServer: web-tanstack tests run against the shared web-next backend
// (port 3000). When TanStack Start runtime is wired in a future plan, add
// a webServer block here pointing at port 3002.
});

View File

@@ -0,0 +1,4 @@
{
"status": "passed",
"failedTests": []
}

3
pnpm-lock.yaml generated
View File

@@ -207,6 +207,9 @@ importers:
specifier: ^19.0.0
version: 19.2.4(react@19.2.4)
devDependencies:
'@playwright/test':
specifier: ^1.50.0
version: 1.59.1
'@repo/eslint-config':
specifier: workspace:*
version: link:../../packages/eslint-config