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:
parent
654154ebbe
commit
4cbce28d26
2 changed files with 29 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue