fix: mcp test when there are a lot of flows (#8197)

This commit is contained in:
Lucas Oliveira 2025-05-23 14:47:27 -03:00 committed by GitHub
commit 1670330868
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -93,17 +93,29 @@ test(
expect(isCheckedAgainAgain).toBeFalsy();
// Select first action
await page
.locator('input[data-ref="eInput"]')
.last()
.scrollIntoViewIfNeeded();
await page.locator('input[data-ref="eInput"]').last().click();
await page.waitForTimeout(1000);
let element = page.locator('input[data-ref="eInput"]').last();
let elementText = await element.getAttribute("id");
await element.scrollIntoViewIfNeeded();
let count = 0;
while (
elementText !==
(await page
.locator('input[data-ref="eInput"]')
.last()
.getAttribute("id")) &&
count < 20
) {
element = page.locator('input[data-ref="eInput"]').last();
elementText = await element.getAttribute("id");
await element.scrollIntoViewIfNeeded();
await page.waitForTimeout(500);
}
await page.locator('input[data-ref="eInput"]').last().click();
await page
.getByRole("gridcell")
.nth(cellsCount - 1)
.click();
await page.waitForTimeout(1000);
const isLastChecked = await page
@ -113,16 +125,22 @@ test(
expect(isLastChecked).toBeTruthy();
await page
.getByRole("gridcell")
.nth(cellsCount - 1)
.click();
await page.waitForTimeout(1000);
expect(
await page.locator('[data-testid="input_update_name"]').isVisible(),
).toBe(true);
await page.getByTestId("input_update_name").fill("mcp test name");
await page.waitForTimeout(500);
await page.waitForTimeout(2000);
// Close the modal
await page.getByText("Close").last().click();
await page.waitForTimeout(500);
await page.waitForTimeout(2000);
// Verify the selected action is visible in the tab
await expect(page.getByTestId("div-mcp-server-tools")).toBeVisible();