gradio/js/app/test/gallery_component_events.spec.ts
Freddy Boulton 25e380078a
WIP: Look into functional test flakes (#6312)
* Add code

* trigger ci

* Add await

* format
2023-11-07 14:38:52 -05:00

25 lines
870 B
TypeScript

import { test, expect } from "@gradio/tootils";
test("Gallery preview mode displays all images correctly.", async ({
page
}) => {
await page.getByRole("button", { name: "Run" }).click();
await page.getByLabel("Thumbnail 2 of 3").click();
await expect(
await page.getByTestId("detailed-image").getAttribute("src")
).toEqual("https://gradio-builds.s3.amazonaws.com/assets/lite-logo.png");
await expect(
await page.getByTestId("thumbnail 1").getAttribute("src")
).toEqual("https://gradio-builds.s3.amazonaws.com/assets/cheetah-003.jpg");
});
test("Gallery select event returns the right value", async ({ page }) => {
await page.getByRole("button", { name: "Run" }).click();
await page.getByLabel("Thumbnail 2 of 3").click();
await expect(page.getByLabel("Select Data")).toHaveValue(
"https://gradio-builds.s3.amazonaws.com/assets/lite-logo.png"
);
});