mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-18 10:44:33 +08:00
improve test setup and utils
This commit is contained in:
parent
8d947138fa
commit
b7d2125323
@ -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",
|
||||
|
@ -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");
|
||||
});
|
Loading…
Reference in New Issue
Block a user