mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-12 10:34:32 +08:00
80f8fbf0e8
* Refactor change_tab function to handle non-interactive or hidden tabs * add changeset * Refactor flashcards app UI and modify test * Fix formatting --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
55 lines
1.5 KiB
TypeScript
55 lines
1.5 KiB
TypeScript
import { test, expect } from "@gradio/tootils";
|
|
|
|
test("shows the results tab when results > 0", async ({ page }) => {
|
|
await page.getByRole("button", { name: "Start Practice" }).click();
|
|
await expect(
|
|
page.getByText("Please enter word prompts into the table.")
|
|
).toBeAttached();
|
|
await page.getByLabel("Close").click();
|
|
|
|
await page
|
|
.getByRole("button", { name: "front back" })
|
|
.getByRole("button")
|
|
.nth(2)
|
|
.dblclick();
|
|
await page
|
|
.getByRole("button", { name: "front back" })
|
|
.locator("tbody")
|
|
.getByRole("textbox")
|
|
.fill("dog");
|
|
await page
|
|
.getByRole("button", { name: "front back" })
|
|
.locator("tbody")
|
|
.getByRole("textbox")
|
|
.press("Enter");
|
|
|
|
await page
|
|
.getByRole("button", { name: "front back" })
|
|
.getByRole("button")
|
|
.nth(3)
|
|
.dblclick();
|
|
await page
|
|
.getByRole("button", { name: "front back" })
|
|
.locator("tbody")
|
|
.getByRole("textbox")
|
|
.fill("cat");
|
|
await page
|
|
.getByRole("button", { name: "front back" })
|
|
.locator("tbody")
|
|
.getByRole("textbox")
|
|
.press("Enter");
|
|
|
|
await page.getByText("New row").click();
|
|
|
|
await page.waitForTimeout(1000);
|
|
await page.getByText("Start Practice").dblclick();
|
|
|
|
await page.waitForTimeout(5000);
|
|
|
|
// await page.getByRole("button", { name: "New Card" }).click();
|
|
// await page.waitForTimeout(1000);
|
|
// await page.getByRole("button", { name: "Flip Card" }).click();
|
|
// await page.getByRole("button", { name: "Correct", exact: true }).click();
|
|
// await page.getByRole("tab", { name: "Results" }).click();
|
|
});
|