Fix: update broken test generalBugs-shard-12.spec (#5060)

* fix broken test

* [autofix.ci] apply automated fixes
This commit is contained in:
anovazzi1 2024-12-04 15:37:19 -03:00 committed by GitHub
commit 276722283b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,7 +1,7 @@
import { expect, test } from "@playwright/test";
test(
"user should be able to connect RetrieverTool to another components",
"user should be able to connect RetrieverTool into another components",
{ tag: ["@release"] },
async ({ page }) => {
await page.goto("/");
@ -23,7 +23,9 @@ test(
while (modalCount === 0) {
await page.getByText("New Flow", { exact: true }).click();
await page.waitForTimeout(3000);
await page.waitForSelector('[data-testid="modal-title"]', {
timeout: 3000,
});
modalCount = await page.getByTestId("modal-title").count();
}
@ -34,7 +36,9 @@ test(
await page.getByTestId("sidebar-search-input").click();
await page.getByTestId("sidebar-search-input").fill("retriever");
await page.waitForTimeout(1000);
await page.waitForSelector('[data-testid="sidebar-options-trigger"]', {
timeout: 30000,
});
await page.getByTestId("sidebar-options-trigger").click();
await page
@ -56,8 +60,6 @@ test(
await page.getByTestId("fit_view").click();
await page.getByTestId("zoom_out").click();
await page.waitForTimeout(1000);
await page.getByTestId("zoom_out").click();
await page
.locator('//*[@id="react-flow-id"]')
@ -70,27 +72,32 @@ test(
await page.mouse.up();
await page.getByTestId("sidebar-search-input").click();
await page.getByTestId("sidebar-search-input").fill("chroma");
await page.getByTestId("sidebar-search-input").fill("Vectara");
await page.waitForTimeout(1000);
await page.waitForSelector(
'[data-testid="vectorstoresVectara Self Query Retriever for Vectara Vector Store"]',
{
timeout: 30000,
},
);
modelElement = await page.getByTestId("vectorstoresChroma DB");
targetElement = await page.locator('//*[@id="react-flow-id"]');
modelElement = page.getByTestId(
"vectorstoresVectara Self Query Retriever for Vectara Vector Store",
);
targetElement = page.locator('//*[@id="react-flow-id"]');
await modelElement.dragTo(targetElement);
await page.mouse.up();
await page.mouse.down();
await page.waitForTimeout(1000);
await page.getByTestId("fit_view").click();
await page.getByTestId("fit_view").click();
//connection
const chromaDbOutput = await page
.getByTestId("handle-chroma-shownode-retriever-right")
const vectaraOutput = page
.getByTestId("handle-vectaraselfqueryretriver-shownode-retriever-right")
.nth(0);
await chromaDbOutput.hover();
await vectaraOutput.hover();
await page.mouse.down();
const retrieverToolInput = await page
.getByTestId("handle-retrievertool-shownode-retriever-left")
@ -98,8 +105,6 @@ test(
await retrieverToolInput.hover();
await page.mouse.up();
await page.waitForTimeout(1000);
expect(await page.locator(".react-flow__edge-interaction").count()).toBe(1);
},
);