gradio/js/app/test/outbreak_forecast.spec.ts
pngwn 085ff0394d
update deps + fix tests (#4675)
* update deps + fix tests

* tweak

* fixes

* changes

* fix everything

* fix checks

* fix

* log

* remove logs

* try this
2023-06-28 22:40:53 +01:00

33 lines
1.1 KiB
TypeScript

import { test, expect } from "@gradio/tootils";
test("matplotlib", async ({ page }) => {
await page.getByLabel("Plot Type").click();
await page.getByRole("button", { name: "Matplotlib" }).click();
await page.getByLabel("Month").click();
await page.getByRole("button", { name: "January" }).click();
await page.getByLabel("Social Distancing?").check();
await Promise.all([
page.click("text=Submit"),
page.waitForResponse("**/run/predict")
]);
const matplotlib_img = await page.locator("img").nth(0);
const matplotlib_img_data = await matplotlib_img.getAttribute("src");
await expect(matplotlib_img_data).toBeTruthy();
});
test("plotly", async ({ page }) => {
await page.getByLabel("Plot Type").click();
await page.getByRole("button", { name: "Plotly" }).click();
await page.getByLabel("Month").click();
await page.getByRole("button", { name: "January" }).click();
await page.getByLabel("Social Distancing?").check();
await Promise.all([
page.click("text=Submit"),
page.waitForResponse("**/run/predict")
]);
await expect(page.locator(".js-plotly-plot")).toHaveCount(1);
});