mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-04-26 09:20:18 +08:00
- Updated `e2e/basic.spec.ts` to inject a mock `window.ipcRenderer` and `window.apm_store` on test startup. Playwright connects to the Vite dev server via standard Chromium, which previously caused the app to crash due to missing Electron contexts. - Added `page.route` intercepts to return valid mock data for categories and apps, ensuring that components like `.app-card` actually render in the E2E environment instead of being stuck in a loading state or failing. - Removed arbitrary timeouts and `127.0.0.1:3344` URL.
12 lines
343 B
TypeScript
12 lines
343 B
TypeScript
import { test, expect } from "@playwright/test";
|
|
|
|
test("mock test", async ({ page }) => {
|
|
page.on('console', msg => console.log('PAGE LOG:', msg.text()));
|
|
page.on('pageerror', exception => {
|
|
console.log(`Uncaught exception: "${exception}"`);
|
|
});
|
|
|
|
await page.goto("http://localhost:5173/");
|
|
await page.waitForTimeout(2000);
|
|
});
|