improve test setup and utils

This commit is contained in:
pngwn 2022-03-22 13:39:49 +00:00
parent 8d947138fa
commit b7d2125323
2 changed files with 2 additions and 21 deletions

View File

@ -6,6 +6,8 @@
"workbench": "pnpm dev --filter @gradio/workbench",
"dev": "pnpm dev --filter @gradio/app",
"build": "pnpm build --filter @gradio/app --emptyOutDir",
"preview": "sirv ../gradio/templates/frontend --single --port=3000 --quiet",
"format:check": "prettier --check --plugin-search-dir=. .",
"format:write": "prettier --write --plugin-search-dir=. .",
"ts:check": "svelte-check --tsconfig tsconfig.json",

View File

@ -1,21 +0,0 @@
import { test, expect, Page } from "@playwright/test";
function mock_demo(page: Page, demo: string) {
return page.route("http://localhost:7860/config", (route) => {
return route.fulfill({
headers: {
"Access-Control-Allow-Origin": "*"
},
path: `../../../demo/${demo}/config.json`
});
});
}
test("basic test", async ({ page }) => {
await mock_demo(page, "xray_blocks");
await page.goto("http://localhost:3000");
const title = await page.locator(".output-html");
await expect(title).toContainText("Detect Disease From Scan");
});