migrate progress and install playwrite
This commit is contained in:
parent
2459833b87
commit
b2f14793e3
9 changed files with 467 additions and 0 deletions
32
src/frontend/tests/auto_login.spec.ts
Normal file
32
src/frontend/tests/auto_login.spec.ts
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test.describe("Auto_login tests", () => {
|
||||
test("auto_login sign in", async ({ page }) => {
|
||||
await page.routeFromHAR("harFiles/langflow.har", {
|
||||
url: "**/api/v1/**",
|
||||
update: false,
|
||||
});
|
||||
await page.goto("http:localhost:3000/");
|
||||
await page.getByRole("button", { name: "Community Examples" }).click();
|
||||
await page.waitForSelector(".community-pages-flows-panel");
|
||||
expect(
|
||||
await page
|
||||
.locator(".community-pages-flows-panel")
|
||||
.evaluate((el) => el.children)
|
||||
).toBeTruthy();
|
||||
});
|
||||
test("auto_login block_admin", async ({ page }) => {
|
||||
await page.routeFromHAR("harFiles/langflow.har", {
|
||||
url: "**/api/v1/**",
|
||||
update: false,
|
||||
});
|
||||
await page.goto("http:localhost:3000/");
|
||||
await page.getByRole("button", { name: "Community Examples" }).click();
|
||||
await page.goto("http:localhost:3000/login");
|
||||
await page.getByRole("button", { name: "Community Examples" }).click();
|
||||
await page.goto("http:localhost:3000/admin");
|
||||
await page.getByRole("button", { name: "Community Examples" }).click();
|
||||
await page.goto("http:localhost:3000/admin/login");
|
||||
await page.getByRole("button", { name: "Community Examples" }).click();
|
||||
});
|
||||
});
|
||||
20
src/frontend/tests/example.spec.ts
Normal file
20
src/frontend/tests/example.spec.ts
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test("has title", async ({ page }) => {
|
||||
await page.goto("https://playwright.dev/");
|
||||
|
||||
// Expect a title "to contain" a substring.
|
||||
await expect(page).toHaveTitle(/Playwright/);
|
||||
});
|
||||
|
||||
test("get started link", async ({ page }) => {
|
||||
await page.goto("https://playwright.dev/");
|
||||
|
||||
// Click the get started link.
|
||||
await page.getByRole("link", { name: "Get started" }).click();
|
||||
|
||||
// Expects page to have a heading with the name of Installation.
|
||||
await expect(
|
||||
page.getByRole("heading", { name: "Installation" })
|
||||
).toBeVisible();
|
||||
});
|
||||
18
src/frontend/tests/login.spec.ts
Normal file
18
src/frontend/tests/login.spec.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import { test } from "@playwright/test";
|
||||
|
||||
test.describe("Login", () => {
|
||||
test("har_file", async ({ page }) => {
|
||||
await page.routeFromHAR("harFiles/login.har", {
|
||||
url: "**/api/v1/**",
|
||||
update: true,
|
||||
updateMode: "minimal",
|
||||
updateContent: "embed",
|
||||
});
|
||||
|
||||
await page.goto("http://localhost:3000/");
|
||||
await page.waitForURL("http://localhost:3000/login");
|
||||
await page.waitForURL("http://localhost:3000/login", { timeout: 100 });
|
||||
await page.getByPlaceholder("Username").click();
|
||||
await page.close();
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue