tests: fix decision flow tests - conditional router component (#3702)

 (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
This commit is contained in:
Cristhian Zanforlin Lousa 2024-09-05 18:26:17 -03:00 committed by GitHub
commit 1e334335d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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();
});