gradio/ui/packages/app/snapshots/blocks_xray.spec.ts
pngwn ed4f3e4ffd
add snapshot testing (#2438)
* add snapshot testing

* bump ci image

* tweak

* tweak

* fix gitgignore

* fix gitgignore

* dedicated snapshot script

* clean up tests

* tweaks

* fix ci

* fix script

* oops

* fix
2022-10-12 17:30:42 +01:00

19 lines
459 B
TypeScript

import { test, expect, Page } from "@playwright/test";
function mock_demo(page: Page, demo: string) {
return page.route("**/config", (route) => {
return route.fulfill({
headers: {
"Access-Control-Allow-Origin": "*"
},
path: `../../../demo/${demo}/config.json`
});
});
}
test("blocks xray", async ({ page }) => {
await mock_demo(page, "blocks_xray");
await page.goto("http://localhost:3000");
await expect(page).toHaveScreenshot();
});