gradio/js/app/test/outbreak_forecast.spec.ts
pngwn d6b6c87c4f
Remove mocks (#4550)
* changes

* changes

* remove mocks

* fix scripts

* tweak port

* add logs

* add logs

* do tests again

* tweaks

* fixes

* regen notebooks

* change workers

* change workers

* try to speed up ci

* try again

* try again

* try again

* try again

* try again

* fix actions

* again

* again

* again

* again

* again

* again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* try again

* add names to frontend ci steps
2023-06-19 21:02:03 +01:00

34 lines
1.1 KiB
TypeScript

import { test, expect } from "@gradio/tootils";
import { BASE64_PLOT_IMG } from "./media_data";
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);
});