From 1e334335d1a1f5b10f67abee1eaaa278ae29bd59 Mon Sep 17 00:00:00 2001 From: Cristhian Zanforlin Lousa Date: Thu, 5 Sep 2024 18:26:17 -0300 Subject: [PATCH] tests: fix decision flow tests - conditional router component (#3702) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✨ (decisionFlow.spec.ts): Remove unnecessary code related to connection 4 and improve flow by adding a new connection for prompt input user message 📝 (decisionFlow.spec.ts): Update test to fill in a different message in the chat playground and verify a different emoji response --- .../tests/end-to-end/decisionFlow.spec.ts | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/frontend/tests/end-to-end/decisionFlow.spec.ts b/src/frontend/tests/end-to-end/decisionFlow.spec.ts index e7cd231b1..52e07ad72 100644 --- a/src/frontend/tests/end-to-end/decisionFlow.spec.ts +++ b/src/frontend/tests/end-to-end/decisionFlow.spec.ts @@ -340,18 +340,6 @@ test("should create a flow with decision", async ({ page }) => { await elementPassInput3.hover(); await page.mouse.up(); - //connection 4 - const elementPassOutput3 = await page - .getByTestId("handle-pass-shownode-output message-right") - .nth(4); - await elementPassOutput3.hover(); - await page.mouse.down(); - const elementConditionalRouterInput = await page - .getByTestId("handle-conditionalrouter-shownode-message-left") - .first(); - await elementConditionalRouterInput.hover(); - await page.mouse.up(); - //edit prompt await page.getByTestId("promptarea_prompt_template").first().click(); await page.getByTestId("modal-promptarea_prompt_template").first().fill(` @@ -375,6 +363,18 @@ AI: await page.locator('//*[@id="react-flow-id"]').hover(); + //connection 4 + const elementPassOutput3 = await page + .getByTestId("handle-pass-shownode-output message-right") + .nth(4); + await elementPassOutput3.hover(); + await page.mouse.down(); + const elementPromptInputUserMessage = await page + .getByTestId("handle-prompt-shownode-user_message-left") + .first(); + await elementPromptInputUserMessage.hover(); + await page.mouse.up(); + //connection 5 const elementParseDataOutput0 = await page .getByTestId("handle-parsedata-shownode-text-right") @@ -566,7 +566,9 @@ AI: }); await page.getByTestId("input-chat-playground").click(); - await page.getByTestId("input-chat-playground").fill("my dog just dead"); + await page + .getByTestId("input-chat-playground") + .fill("my dog is alive and happy!"); await page.waitForSelector('[data-testid="icon-LucideSend"]', { timeout: 100000, @@ -574,9 +576,9 @@ AI: await page.getByTestId("icon-LucideSend").click(); - await page.waitForSelector("text=🥲", { + await page.waitForSelector("text=🤪", { timeout: 1200000, }); - await page.getByText("🥲").isVisible(); + await page.getByText("🤪").isVisible(); });