♻️ (playwright.config.ts): increase workers from 1 to 3 to improve test parallelism
✅ (basicExamples.spec.ts): add waitForSelector for 'fit view' to ensure element is loaded ✅ (basicExamples.spec.ts): add waitForSelector for 'built successfully' to ensure element is loaded ✅ (chatInputOutput.spec.ts): add waitForSelector for 'extended-disclosure' to ensure element is loaded ✅ (codeAreaModalComponent.spec.ts): add waitForSelector for 'extended-disclosure' to ensure element is loaded ✅ (dropdownComponent.spec.ts): add waitForSelector for 'extended-disclosure' to ensure element is loaded ✅ (fileUploadComponent.spec.ts): add waitForSelector for 'extended-disclosure' to ensure element is loaded ✅ (filterEdge.spec.ts): add waitForSelector for 'extended-disclosure' to ensure element is loaded ✅ (filterEdge.spec.ts): update test expectations for 'disclosure-agents' to be visible ✅ (floatComponent.spec.ts): add waitForSelector for 'extended-disclosure' to ensure element is loaded ✅ (flowPage.spec.ts): add waitForSelector for 'extended-disclosure' to ensure element is loaded ✅ (folders.spec.ts): add waitForSelector for 'icon-ChevronLeft' to ensure element is loaded ✅ (folders.spec.ts): update folder name input and visibility check to improve reliability ✅ (generalBugs.spec.ts): add waitForSelector for 'extended-disclosure' to ensure element is loaded ✅ (tests): replace waitForTimeout with waitForSelector in end-to-end tests Replace `waitForTimeout` with `waitForSelector` to improve test reliability and reduce flakiness.
This commit is contained in:
parent
b0e7be8de4
commit
4e62f95a2a
20 changed files with 92 additions and 38 deletions
|
|
@ -21,7 +21,7 @@ export default defineConfig({
|
|||
/* Retry on CI only */
|
||||
retries: process.env.CI ? 2 : 0,
|
||||
/* Opt out of parallel tests on CI. */
|
||||
workers: 1,
|
||||
workers: 3,
|
||||
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
||||
timeout: 120 * 1000,
|
||||
// reporter: [
|
||||
|
|
|
|||
|
|
@ -24,6 +24,10 @@ test("Basic Prompting (Hello, World)", async ({ page }) => {
|
|||
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.waitForSelector('[title="fit view"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
await page.getByTitle("zoom out").click();
|
||||
|
|
@ -283,6 +287,9 @@ test("Blog Writer", async ({ page }) => {
|
|||
|
||||
await page.getByTestId("button_run_chat output").click();
|
||||
await page.waitForTimeout(5000);
|
||||
|
||||
await page.waitForSelector("text=built successfully", { timeout: 30000 });
|
||||
|
||||
await page.getByText("built successfully").last().click({
|
||||
timeout: 30000,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -28,7 +28,11 @@ test("chat_io_teste", async ({ page }) => {
|
|||
);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("chat output");
|
||||
|
|
|
|||
|
|
@ -23,7 +23,11 @@ test("CodeAreaModalComponent", async ({ page }) => {
|
|||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("python function");
|
||||
|
|
|
|||
|
|
@ -22,8 +22,9 @@ test("dropDownComponent", async ({ page }) => {
|
|||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("amazon");
|
||||
|
|
|
|||
|
|
@ -23,7 +23,9 @@ test("should be able to upload a file", async ({ page }) => {
|
|||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
|
|
|
|||
|
|
@ -21,7 +21,9 @@ test("LLMChain - Tooltip", async ({ page }) => {
|
|||
}
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
|
|
@ -168,12 +170,13 @@ test("LLMChain - Filter", async ({ page }) => {
|
|||
}
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId(
|
||||
"input-list-plus-btn-edit_metadata_indexing_include-2",
|
||||
);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("llmchain");
|
||||
|
|
@ -196,10 +199,8 @@ test("LLMChain - Filter", async ({ page }) => {
|
|||
)
|
||||
.click();
|
||||
|
||||
await expect(page.getByTestId("disclosure-models")).toBeVisible();
|
||||
await expect(
|
||||
page.getByTestId("modelsGoogle Generative AI").first(),
|
||||
).toBeVisible();
|
||||
await expect(page.getByTestId("disclosure-agents")).toBeVisible();
|
||||
|
||||
await expect(page.getByTestId("chainsLLMChain").first()).toBeVisible();
|
||||
await expect(
|
||||
page.getByTestId("langchain_utilitiesSearchApi").first(),
|
||||
|
|
|
|||
|
|
@ -22,7 +22,9 @@ test("FloatComponent", async ({ page }) => {
|
|||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("ollama");
|
||||
|
|
|
|||
|
|
@ -22,7 +22,9 @@ test.describe("Flow Page tests", () => {
|
|||
}
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("custom");
|
||||
|
|
|
|||
|
|
@ -22,6 +22,10 @@ test("CRUD folders", async ({ page }) => {
|
|||
}
|
||||
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
||||
|
||||
await page.waitForSelector('[data-testid="icon-ChevronLeft"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("icon-ChevronLeft").first().click();
|
||||
|
||||
await page.getByText("My Collection").nth(2).isVisible();
|
||||
|
|
@ -35,9 +39,16 @@ test("CRUD folders", async ({ page }) => {
|
|||
await page.getByText("New Folder").last().isVisible();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.getByText("New Folder").last().dblclick();
|
||||
await page.getByTestId("input-folder").fill("new folder test name");
|
||||
await page.keyboard.press("Enter");
|
||||
await page.getByText("new folder test name").last().isVisible();
|
||||
|
||||
const element = await page.getByTestId("input-folder");
|
||||
await element.fill("new folder test name");
|
||||
|
||||
await page.getByText("My Projects").last().click();
|
||||
|
||||
await page.getByText("new folder test name").last().waitFor({
|
||||
state: "visible",
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page
|
||||
.getByText("new folder test name")
|
||||
|
|
|
|||
|
|
@ -22,7 +22,9 @@ test("should interact with api request", async ({ page }) => {
|
|||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(1000);
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("api request");
|
||||
|
|
|
|||
|
|
@ -22,7 +22,9 @@ test("GlobalVariables", async ({ page }) => {
|
|||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("openai");
|
||||
|
|
|
|||
|
|
@ -22,7 +22,9 @@ test("InputComponent", async ({ page }) => {
|
|||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("Chroma");
|
||||
|
|
|
|||
|
|
@ -21,7 +21,9 @@ test("InputListComponent", async ({ page }) => {
|
|||
}
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("url");
|
||||
|
|
|
|||
|
|
@ -22,7 +22,9 @@ test("IntComponent", async ({ page }) => {
|
|||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("openai");
|
||||
|
|
|
|||
|
|
@ -2,13 +2,6 @@ import { expect, test } from "@playwright/test";
|
|||
import uaParser from "ua-parser-js";
|
||||
test("LangflowShortcuts", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
const getUA = await page.evaluate(() => navigator.userAgent);
|
||||
const userAgentInfo = uaParser(getUA);
|
||||
let control = "Control";
|
||||
|
||||
if (userAgentInfo.os.name.includes("Mac")) {
|
||||
control = "Meta";
|
||||
}
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
|
|
@ -28,8 +21,18 @@ test("LangflowShortcuts", async ({ page }) => {
|
|||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
const getUA = await page.evaluate(() => navigator.userAgent);
|
||||
const userAgentInfo = uaParser(getUA);
|
||||
let control = "Control";
|
||||
|
||||
if (userAgentInfo.os.name.includes("Mac")) {
|
||||
control = "Meta";
|
||||
}
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("ollama");
|
||||
|
|
|
|||
|
|
@ -21,7 +21,9 @@ test("NestedComponent", async ({ page }) => {
|
|||
}
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("pinecone");
|
||||
|
|
|
|||
|
|
@ -21,7 +21,9 @@ test("PromptTemplateComponent", async ({ page }) => {
|
|||
}
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("prompt");
|
||||
|
|
|
|||
|
|
@ -93,8 +93,9 @@ test.describe("save component tests", () => {
|
|||
if (replaceButton) {
|
||||
await page.getByTestId("replace-button").click();
|
||||
}
|
||||
await page.waitForTimeout(3000);
|
||||
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("group");
|
||||
|
|
|
|||
|
|
@ -82,7 +82,9 @@ test("check if tweaks are updating when someothing on the flow changes", async (
|
|||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByTestId("blank-flow").click();
|
||||
await page.waitForTimeout(3000);
|
||||
await page.waitForSelector('[data-testid="extended-disclosure"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
await page.getByTestId("extended-disclosure").click();
|
||||
await page.getByPlaceholder("Search").click();
|
||||
await page.getByPlaceholder("Search").fill("Chroma");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue