Skip to content

Commit

Permalink
tests: fix decision flow tests - conditional router component (#3702)
Browse files Browse the repository at this point in the history
✨ (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
  • Loading branch information
Cristhianzl authored Sep 5, 2024
1 parent 3bc9cc9 commit 1e33433
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions src/frontend/tests/end-to-end/decisionFlow.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(`
Expand All @@ -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")
Expand Down Expand Up @@ -566,17 +566,19 @@ 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,
});

await page.getByTestId("icon-LucideSend").click();

await page.waitForSelector("text=🥲", {
await page.waitForSelector("text=🤪", {
timeout: 1200000,
});

await page.getByText("🥲").isVisible();
await page.getByText("🤪").isVisible();
});

0 comments on commit 1e33433

Please sign in to comment.