2024-01-23 15:31:59 +08:00
|
|
|
import { test, expect } from "@gradio/tootils";
|
2024-01-17 21:39:10 +08:00
|
|
|
|
|
|
|
test("shows the results tab when results > 0", async ({ page }) => {
|
2024-01-23 15:31:59 +08:00
|
|
|
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();
|
|
|
|
|
2024-01-17 21:39:10 +08:00
|
|
|
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);
|
2024-01-23 15:31:59 +08:00
|
|
|
await page.getByText("Start Practice").dblclick();
|
2024-01-17 21:39:10 +08:00
|
|
|
});
|