mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-25 16:09:31 +08:00
fix: refactor mcp and freeze tests to be less prone to flaky results (#8486)
* Fixed mcp test to be less prone to errors * Fix freeze spec
This commit is contained in:
@ -260,8 +260,6 @@ test(
|
||||
|
||||
await page.getByTestId("button_run_chat output").click();
|
||||
|
||||
await page.waitForTimeout(3000);
|
||||
|
||||
await page.waitForSelector("text=built successfully", {
|
||||
timeout: 30000 * 3,
|
||||
});
|
||||
|
||||
@ -104,6 +104,35 @@ test(
|
||||
timeout: 30000,
|
||||
});
|
||||
|
||||
attempts = 0;
|
||||
dropdownEnabled = false;
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
while (attempts < maxAttempts && !dropdownEnabled) {
|
||||
await page.waitForTimeout(3000);
|
||||
|
||||
try {
|
||||
await page.waitForSelector(
|
||||
'[data-testid="dropdown_str_tool"]:not([disabled])',
|
||||
{
|
||||
timeout: 30000,
|
||||
state: "visible",
|
||||
},
|
||||
);
|
||||
dropdownEnabled = true;
|
||||
} catch (error) {
|
||||
attempts++;
|
||||
console.log(`Retry attempt ${attempts} for second refresh button`);
|
||||
await page.getByTestId("refresh-button-sse_url").click();
|
||||
}
|
||||
}
|
||||
|
||||
if (!dropdownEnabled) {
|
||||
throw new Error(
|
||||
"Dropdown did not become enabled after multiple refresh attempts",
|
||||
);
|
||||
}
|
||||
|
||||
await page.getByTestId("tab_0_stdio").click();
|
||||
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
Reference in New Issue
Block a user