test(web-tanstack): add Playwright scaffold + skipped home spec
This commit is contained in:
12
apps/web-tanstack/e2e/home.spec.ts
Normal file
12
apps/web-tanstack/e2e/home.spec.ts
Normal 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();
|
||||
},
|
||||
);
|
||||
@@ -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",
|
||||
|
||||
21
apps/web-tanstack/playwright.config.ts
Normal file
21
apps/web-tanstack/playwright.config.ts
Normal 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.
|
||||
});
|
||||
4
apps/web-tanstack/test-results/.last-run.json
Normal file
4
apps/web-tanstack/test-results/.last-run.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"status": "passed",
|
||||
"failedTests": []
|
||||
}
|
||||
3
pnpm-lock.yaml
generated
3
pnpm-lock.yaml
generated
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user