mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-25 22:10:39 +08:00
fix: Improve test and add improve timeouts (#5142)
* fix: Improve test and add missing timeouts The test in the generalBugs-shard-13.spec.ts file was improved to include missing timeouts for better stability and reliability.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { test } from "@playwright/test";
|
||||
import { expect, test } from "@playwright/test";
|
||||
import * as dotenv from "dotenv";
|
||||
import path from "path";
|
||||
|
||||
@ -16,7 +16,6 @@ test(
|
||||
}
|
||||
|
||||
await page.goto("/");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
let modalCount = 0;
|
||||
try {
|
||||
@ -30,39 +29,40 @@ test(
|
||||
|
||||
while (modalCount === 0) {
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
await page.waitForSelector('[data-testid="modal-title"]', {
|
||||
timeout: 3000,
|
||||
});
|
||||
modalCount = await page.getByTestId("modal-title")?.count();
|
||||
}
|
||||
|
||||
await page.getByText("Close", { exact: true }).click();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.waitForSelector('[data-testid="user-profile-settings"]', {
|
||||
timeout: 3000,
|
||||
});
|
||||
await page.getByTestId("user-profile-settings").click();
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await page.getByText("Settings", { exact: true }).first().click();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page
|
||||
.getByPlaceholder("Insert your API Key")
|
||||
.fill(process.env.STORE_API_KEY ?? "");
|
||||
|
||||
await page.getByTestId("api-key-save-button-store").click();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByText("Success! Your API Key has been saved.").isVisible();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await expect(page.getByText("API key saved successfully")).toBeVisible({
|
||||
timeout: 3000,
|
||||
});
|
||||
|
||||
await page.waitForSelector('[data-testid="icon-ChevronLeft"]', {
|
||||
timeout: 100000,
|
||||
});
|
||||
|
||||
await page.getByTestId("icon-ChevronLeft").first().click();
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await expect(page.getByText("New Flow", { exact: true })).toBeVisible({
|
||||
timeout: 3000,
|
||||
});
|
||||
|
||||
await page.getByText("New Flow", { exact: true }).click();
|
||||
|
||||
@ -74,8 +74,6 @@ test(
|
||||
|
||||
await page.getByTestId("shared-button-flow").click();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await page.waitForSelector("text=Share Flow", {
|
||||
timeout: 10000,
|
||||
});
|
||||
@ -96,16 +94,12 @@ test(
|
||||
timeout: 10000,
|
||||
});
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await page.waitForSelector("text=share", { timeout: 10000 });
|
||||
await page.waitForSelector("text=playground", { timeout: 10000 });
|
||||
await page.waitForSelector("text=api", { timeout: 10000 });
|
||||
|
||||
await page.getByTestId("shared-button-flow").click();
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
await page.waitForSelector("text=Publish workflow to the Langflow Store.", {
|
||||
timeout: 10000,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user