tests: fix decision flow test (#4143)

* starting fix test

* ✨ (decisionFlow.spec.ts): refactor integration test to remove unnecessary commented out code and improve readability by simplifying and organizing the test steps for creating a flow with decision.
This commit is contained in:
Cristhian Zanforlin Lousa 2024-10-16 10:05:31 -03:00 • committed by GitHub
commit ab77ca752b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,454 +2,414 @@ import { expect, test } from "@playwright/test";
import * as dotenv from "dotenv"; import * as dotenv from "dotenv";
import path from "path"; import path from "path";
// Add this function at the beginning of the file, after the imports
async function moveElementByX(
page: any,
elementId: string,
moveX: number,
nth: number,
) {
const element = await page.getByTestId(`title-${elementId}`).nth(nth);
await element.hover();
const boundingBox = await element.boundingBox();
if (boundingBox) {
const startX = boundingBox.x + boundingBox.width / 2;
const startY = boundingBox.y + boundingBox.height / 2;
await page.mouse.move(startX, startY);
await page.mouse.down();
await page.mouse.move(startX + moveX, startY);
await page.mouse.up();
} else {
throw new Error(`Unable to get bounding box for the element: ${elementId}`);
}
}
// Add this function at the beginning of the file, after the imports
async function moveElementByY(
page: any,
elementId: string,
moveY: number,
nth: number,
) {
const element = await page.getByTestId(`title-${elementId}`).nth(nth);
await element.hover();
const boundingBox = await element.boundingBox();
if (boundingBox) {
const startX = boundingBox.x + boundingBox.width / 2;
const startY = boundingBox.y + boundingBox.height / 2;
await page.mouse.move(startX, startY);
await page.mouse.down();
await page.mouse.move(startX, startY + moveY);
await page.mouse.up();
} else {
throw new Error(`Unable to get bounding box for the element: ${elementId}`);
}
}
// Add this function at the beginning of the file, after the imports
async function moveElementByXY(
page: any,
elementId: string,
moveX: number,
moveY: number,
nth: number,
) {
const element = await page.getByTestId(`title-${elementId}`).nth(nth);
await element.hover();
const boundingBox = await element.boundingBox();
if (boundingBox) {
const startX = boundingBox.x + boundingBox.width / 2;
const startY = boundingBox.y + boundingBox.height / 2;
await page.mouse.move(startX, startY);
await page.mouse.down();
await page.mouse.move(startX + moveX, startY + moveY);
await page.mouse.up();
} else {
throw new Error(`Unable to get bounding box for the element: ${elementId}`);
}
}
test("should create a flow with decision", async ({ page }) => { test("should create a flow with decision", async ({ page }) => {
// test.skip( test.skip(
// !process?.env?.OPENAI_API_KEY, !process?.env?.OPENAI_API_KEY,
// "OPENAI_API_KEY required to run this test", "OPENAI_API_KEY required to run this test",
// ); );
// if (!process.env.CI) { if (!process.env.CI) {
// dotenv.config({ path: path.resolve(__dirname, "../../.env") }); dotenv.config({ path: path.resolve(__dirname, "../../.env") });
// } }
// await page.goto("/"); await page.goto("/");
// await page.waitForSelector('[data-testid="mainpage_title"]', { await page.waitForSelector('[data-testid="mainpage_title"]', {
// timeout: 30000, timeout: 30000,
// }); });
// await page.waitForSelector('[id="new-project-btn"]', { await page.waitForSelector('[id="new-project-btn"]', {
// timeout: 30000, timeout: 30000,
// }); });
// let modalCount = 0; let modalCount = 0;
// try { try {
// const modalTitleElement = await page?.getByTestId("modal-title"); const modalTitleElement = await page?.getByTestId("modal-title");
// if (modalTitleElement) { if (modalTitleElement) {
// modalCount = await modalTitleElement.count(); modalCount = await modalTitleElement.count();
// } }
// } catch (error) { } catch (error) {
// modalCount = 0; modalCount = 0;
// } }
// while (modalCount === 0) { while (modalCount === 0) {
// await page.getByText("New Project", { exact: true }).click(); await page.getByText("New Project", { exact: true }).click();
// await page.waitForTimeout(3000); await page.waitForTimeout(3000);
// modalCount = await page.getByTestId("modal-title")?.count(); modalCount = await page.getByTestId("modal-title")?.count();
// } }
// await page.waitForSelector('[data-testid="blank-flow"]', { await page.waitForSelector('[data-testid="blank-flow"]', {
// timeout: 30000, timeout: 30000,
// }); });
// await page.getByTestId("blank-flow").click(); await page.getByTestId("blank-flow").click();
// await page.waitForSelector('[data-testid="extended-disclosure"]', { await page.waitForSelector('[data-testid="extended-disclosure"]', {
// timeout: 30000, timeout: 30000,
// }); });
// await page.getByTestId("extended-disclosure").click(); await page.getByTestId("extended-disclosure").click();
// await page.getByPlaceholder("Search").click(); //---------------------------------- CHAT INPUT
// await page.getByPlaceholder("Search").fill("chat input"); await page.getByPlaceholder("Search").click();
// await page.waitForTimeout(1000); await page.getByPlaceholder("Search").fill("chat input");
// await page await page.waitForTimeout(500);
// .getByTestId("inputsChat Input") await page
// .dragTo(page.locator('//*[@id="react-flow-id"]')); .getByTestId("inputsChat Input")
// await page.getByTitle("fit view").click({ .dragTo(page.locator('//*[@id="react-flow-id"]'));
// force: true,
// }); //---------------------------------- CREATE LIST
// await page.getByPlaceholder("Search").click(); await page.getByPlaceholder("Search").click();
// await page.getByPlaceholder("Search").fill("create list"); await page.getByPlaceholder("Search").fill("list");
// await page.waitForTimeout(1000); await page.waitForTimeout(500);
// await page.getByTitle("zoom out").click(); await page
// await page.getByTitle("zoom out").click(); .getByTestId("helpersCreate List")
// await page .dragTo(page.locator('//*[@id="react-flow-id"]'));
// .getByTestId("helpersCreate List") await page.getByTestId("input-list-plus-btn_texts-0").first().click();
// .dragTo(page.locator('//*[@id="react-flow-id"]')); await page.getByTestId("input-list-plus-btn_texts-0").first().click();
// await page.mouse.up(); await page.getByTestId("input-list-plus-btn_texts-0").first().click();
// await page.mouse.down();
// await page.getByTitle("fit view").click({ await page
// force: true, .getByTestId("inputlist_str_texts_0")
// }); .first()
// await page.getByTitle("fit view").click({ .fill("big news! langflow 1.0 is out");
// force: true, await page
// }); .getByTestId("inputlist_str_texts_1")
// await page.getByTestId("input-list-plus-btn_texts-0").click(); .first()
// await page.getByTestId("input-list-plus-btn_texts-0").click(); .fill("uhul that movie was awesome");
// await page await page.getByTestId("inputlist_str_texts_2").first().fill("love you babe");
// .getByTestId("inputlist_str_texts_0") await page
// .first() .getByTestId("helpersCreate List")
// .fill("big news! langflow 1.0 is out"); .dragTo(page.locator('//*[@id="react-flow-id"]'));
// await page await page.getByTestId("input-list-plus-btn_texts-0").last().click();
// .getByTestId("inputlist_str_texts_1") await page.getByTestId("input-list-plus-btn_texts-0").last().click();
// .first() await page.getByTestId("input-list-plus-btn_texts-0").last().click();
// .fill("uhul that movie was awesome");
// await page.getByTestId("inputlist_str_texts_2").first().fill("love you babe"); await page.getByTestId("inputlist_str_texts_0").last().fill("oh my cat died");
// await page.getByTitle("zoom out").click(); await page
// await page.getByTitle("zoom out").click(); .getByTestId("inputlist_str_texts_1")
// await page .last()
// .getByTestId("helpersCreate List") .fill("No one loves me");
// .dragTo(page.locator('//*[@id="react-flow-id"]')); await page.getByTestId("inputlist_str_texts_2").last().fill("not cool..");
// await page.mouse.up();
// await page.mouse.down(); //---------------------------------- PARSE DATA
// await page.getByTitle("fit view").click({ await page.getByPlaceholder("Search").click();
// force: true, await page.getByPlaceholder("Search").fill("parse data");
// }); await page.waitForTimeout(500);
// await page.getByTitle("fit view").click({
// force: true, await page
// }); .getByTestId("helpersParse Data")
// await page.getByTestId("input-list-plus-btn_texts-0").last().click(); .dragTo(page.locator('//*[@id="react-flow-id"]'));
// await page.getByTestId("input-list-plus-btn_texts-0").last().click(); await page
// await page.getByTestId("inputlist_str_texts_0").last().fill("oh my cat died"); .getByTestId("helpersParse Data")
// await page .dragTo(page.locator('//*[@id="react-flow-id"]'));
// .getByTestId("inputlist_str_texts_1")
// .last() //---------------------------------- PASS
// .fill("No one loves me"); await page.getByPlaceholder("Search").click();
// await page.getByTestId("inputlist_str_texts_2").last().fill("not cool.."); await page.getByPlaceholder("Search").fill("pass");
// await page.getByPlaceholder("Search").click(); await page.waitForTimeout(500);
// await page.getByPlaceholder("Search").fill("parse data"); await page
// await page.waitForTimeout(1000); .getByTestId("prototypesPass")
// await page.getByTitle("zoom out").click(); .dragTo(page.locator('//*[@id="react-flow-id"]'));
// await page await page.waitForTimeout(500);
// .getByTestId("helpersParse Data") await page
// .dragTo(page.locator('//*[@id="react-flow-id"]')); .getByTestId("prototypesPass")
// await page.mouse.up(); .dragTo(page.locator('//*[@id="react-flow-id"]'));
// await page.mouse.down(); await page.waitForTimeout(500);
// await page.getByTitle("fit view").click({ await page
// force: true, .getByTestId("prototypesPass")
// }); .dragTo(page.locator('//*[@id="react-flow-id"]'));
// await page.getByTitle("fit view").click({ //---------------------------------- PROMPT
// force: true, await page.getByPlaceholder("Search").click();
// }); await page.getByPlaceholder("Search").fill("prompt");
// await page await page.waitForTimeout(500);
// .getByTestId("helpersParse Data") await page
// .dragTo(page.locator('//*[@id="react-flow-id"]')); .getByTestId("promptsPrompt")
// await page.mouse.up(); .dragTo(page.locator('//*[@id="react-flow-id"]'));
// await page.mouse.down(); //---------------------------------- OPENAI
// await page.getByTitle("fit view").click({ await page.getByPlaceholder("Search").click();
// force: true, await page.getByPlaceholder("Search").fill("openai");
// }); await page.waitForTimeout(500);
// await page.getByTitle("fit view").click({ await page
// force: true, .getByTestId("modelsOpenAI")
// }); .dragTo(page.locator('//*[@id="react-flow-id"]'));
// await page.getByPlaceholder("Search").click();
// await page.getByPlaceholder("Search").fill("prompt"); //---------------------------------- CONDITIONAL ROUTER
// await page.waitForTimeout(1000); await page.getByPlaceholder("Search").click();
// await page await page.getByPlaceholder("Search").fill("conditional router");
// .getByTestId("promptsPrompt") await page.waitForTimeout(500);
// .dragTo(page.locator('//*[@id="react-flow-id"]')); await page
// await page.mouse.up(); .getByTestId("prototypesConditional Router")
// await page.mouse.down(); .dragTo(page.locator('//*[@id="react-flow-id"]'));
// await page.getByTitle("fit view").click({ //---------------------------------- CHAT OUTPUT
// force: true, await page.getByPlaceholder("Search").click();
// }); await page.getByPlaceholder("Search").fill("chat output");
// await page.getByTitle("fit view").click({ await page.waitForTimeout(500);
// force: true, await page
// }); .getByTestId("outputsChat Output")
// await page.getByPlaceholder("Search").click(); .dragTo(page.locator('//*[@id="react-flow-id"]'));
// await page.getByPlaceholder("Search").fill("openai");
// await page.waitForTimeout(1000); await page.waitForTimeout(500);
// await page await page
// .getByTestId("modelsOpenAI") .getByTestId("outputsChat Output")
// .dragTo(page.locator('//*[@id="react-flow-id"]')); .dragTo(page.locator('//*[@id="react-flow-id"]'));
// await page.mouse.up(); //----------------------------------
// await page.mouse.down();
// await page.getByTitle("fit view").click({ await page.getByTitle("fit view").click();
// force: true,
// }); await moveElementByX(page, "Chat Output", 500, 1);
// await page.getByTitle("fit view").click({ await page.waitForTimeout(500);
// force: true, await moveElementByX(page, "Chat Output", 1000, 0);
// }); await page.waitForTimeout(500);
// await page.getByPlaceholder("Search").click(); await moveElementByX(page, "Conditional Router", 1500, 0);
// await page.getByPlaceholder("Search").fill("conditional router"); await page.waitForTimeout(500);
// await page.waitForTimeout(1000); await moveElementByX(page, "OpenAI", 2000, 0);
// await page await page.waitForTimeout(500);
// .getByTestId("prototypesConditional Router") await moveElementByX(page, "Prompt", 2500, 0);
// .dragTo(page.locator('//*[@id="react-flow-id"]')); await page.waitForTimeout(500);
// await page.mouse.up(); await moveElementByX(page, "Pass", 3000, 2);
// await page.mouse.down(); await page.getByTitle("fit view").click();
// await page.getByTitle("fit view").click({ await page.waitForTimeout(500);
// force: true, await moveElementByXY(page, "Pass", 0, 200, 1);
// }); await page.waitForTimeout(500);
// await page.getByTitle("fit view").click({ await moveElementByXY(page, "Pass", 150, 200, 0);
// force: true, await page.waitForTimeout(500);
// }); await moveElementByXY(page, "Parse Data", 300, 200, 1);
// await page.getByPlaceholder("Search").click(); await page.waitForTimeout(500);
// await page.getByPlaceholder("Search").fill("pass"); await moveElementByXY(page, "Parse Data", 450, 200, 0);
// await page.waitForTimeout(1000); await page.waitForTimeout(500);
// await page await moveElementByXY(page, "Create List", 600, 200, 1);
// .getByTestId("prototypesPass") await page.waitForTimeout(500);
// .dragTo(page.locator('//*[@id="react-flow-id"]')); await moveElementByXY(page, "Create List", 800, 200, 0);
// await page.mouse.up(); await page.waitForTimeout(500);
// await page.mouse.down(); await moveElementByXY(page, "Chat Input", 1000, 200, 0);
// await page.getByTitle("fit view").click({
// force: true, await page.waitForTimeout(500);
// }); await page.getByTitle("fit view").click();
// await page.getByTitle("fit view").click({
// force: true, //---------------------------------- EDIT PROMPT
// }); await page.getByTestId("promptarea_prompt_template").first().click();
// await page await page.getByTestId("modal-promptarea_prompt_template").first().fill(`
// .getByTestId("prototypesPass") {Condition}
// .dragTo(page.locator('//*[@id="react-flow-id"]')); Answer with either TRUE or FALSE (and nothing else).
// await page.mouse.up(); TRUE Examples:
// await page.mouse.down(); {true_examples}
// await page.getByTitle("fit view").click({ FALSE Examples:
// force: true, {false_examples}
// }); User: {user_message}
// await page.getByTitle("fit view").click({ AI:
// force: true, `);
// }); await page.getByText("Check & Save").last().click();
// await page.getByTitle("zoom out").click();
// await page //---------------------------------- MAKE CONNECTIONS
// .getByTestId("prototypesPass") await page
// .dragTo(page.locator('//*[@id="react-flow-id"]')); .getByTestId("handle-createlist-shownode-data list-right")
// await page.mouse.up(); .nth(0)
// await page.mouse.down(); .click();
// await page.getByTitle("fit view").click({ await page.getByTestId("handle-parsedata-shownode-data-left").nth(0).click();
// force: true,
// }); await page
// await page.getByTitle("fit view").click({ .getByTestId("handle-createlist-shownode-data list-right")
// force: true, .nth(2)
// }); .click();
// await page.getByTitle("zoom out").click(); await page.getByTestId("handle-parsedata-shownode-data-left").nth(1).click();
// await page.getByPlaceholder("Search").click();
// await page.getByPlaceholder("Search").fill("chatoutput"); await page
// await page.waitForTimeout(1000); .getByTestId("handle-chatinput-shownode-message-right")
// await page .nth(0)
// .getByTestId("outputsChat Output") .click();
// .dragTo(page.locator('//*[@id="react-flow-id"]')); await page
// await page.mouse.up(); .getByTestId("handle-pass-shownode-input message-left")
// await page.mouse.down(); .nth(2)
// await page.getByTitle("fit view").click({ .click();
// force: true,
// }); await page.getByTestId("handle-parsedata-shownode-text-right").nth(0).click();
// await page.getByTitle("fit view").click({ await page
// force: true, .getByTestId("handle-prompt-shownode-true_examples-left")
// }); .nth(0)
// await page.getByTitle("zoom out").click(); .click();
// await page
// .getByTestId("outputsChat Output") await page.getByTestId("handle-parsedata-shownode-text-right").nth(2).click();
// .dragTo(page.locator('//*[@id="react-flow-id"]')); await page
// await page.mouse.up(); .getByTestId("handle-prompt-shownode-false_examples-left")
// await page.mouse.down(); .nth(0)
// await page.getByTitle("fit view").click({ .click();
// force: true,
// }); await page
// await page.getByTitle("fit view").click({ .getByTestId("handle-pass-shownode-output message-right")
// force: true, .nth(4)
// }); .click();
// //connection 1 await page
// const elementCreateListOutput0 = await page .getByTestId("handle-prompt-shownode-user_message-left")
// .getByTestId("handle-createlist-shownode-data list-right") .nth(0)
// .nth(2); .click();
// await elementCreateListOutput0.hover();
// await page.mouse.down(); await page
// const elementParseDataInput0 = await page .getByTestId("handle-prompt-shownode-prompt message-right")
// .getByTestId("handle-parsedata-shownode-data-left") .first()
// .nth(0); .click();
// await elementParseDataInput0.hover();
// await page.mouse.up(); await page
// //connection 2 .getByTestId("handle-openaimodel-shownode-input-left")
// const elementCreateListOutput1 = await page .nth(0)
// .getByTestId("handle-createlist-shownode-data list-right") .click();
// .first();
// await elementCreateListOutput1.hover(); await page
// await page.mouse.down(); .getByTestId("handle-openaimodel-shownode-text-right")
// const elementParseDataInput1 = await page .nth(0)
// .getByTestId("handle-parsedata-shownode-data-left") .click();
// .last();
// await elementParseDataInput1.hover(); await page
// await page.mouse.up(); .getByTestId("handle-conditionalrouter-shownode-input text-left")
// //connection 3 .nth(0)
// const elementChatInputOutput = await page .click();
// .getByTestId("handle-chatinput-shownode-message-right")
// .first(); await page.getByTestId("popover-anchor-input-match_text").fill("TRUE");
// await elementChatInputOutput.hover();
// await page.mouse.down(); await page.getByTestId("title-Pass").nth(1).click();
// const elementPassInput3 = await page
// .getByTestId("handle-pass-shownode-input message-left") await page.getByTestId("advanced-button-modal").click();
// .last();
// await elementPassInput3.hover(); await page
// await page.mouse.up(); .getByTestId("popover-anchor-input-input_message-edit")
// //edit prompt .nth(0)
// await page.getByTestId("promptarea_prompt_template").first().click(); .fill("You're Happy! 🤪");
// await page.getByTestId("modal-promptarea_prompt_template").first().fill(`
// {Condition} await page.getByTestId("showignored_message").last().click();
// Answer with either TRUE or FALSE (and nothing else).
// TRUE Examples: await page.getByText("Close").last().click();
// {true_examples}
// FALSE Examples: await page.getByTestId("title-Pass").nth(0).click();
// {false_examples}
// User: {user_message} await page.getByTestId("advanced-button-modal").click();
// AI:
// `); await page
// await page.getByText("Check & Save").last().click(); .getByTestId("popover-anchor-input-input_message-edit")
// await page.locator('//*[@id="react-flow-id"]').hover(); .nth(0)
// //connection 4 .fill("You're Sad! 🥲");
// const elementPassOutput3 = await page
// .getByTestId("handle-pass-shownode-output message-right") await page.getByTestId("showignored_message").last().click();
// .nth(4);
// await elementPassOutput3.hover(); await page.getByText("Close").last().click();
// await page.mouse.down();
// const elementPromptInputUserMessage = await page await page
// .getByTestId("handle-prompt-shownode-user_message-left") .getByTestId("handle-conditionalrouter-shownode-true route-right")
// .first(); .nth(0)
// await elementPromptInputUserMessage.hover(); .click();
// await page.mouse.up(); await page
// //connection 5 .getByTestId("handle-pass-shownode-ignored message-left")
// const elementParseDataOutput0 = await page .nth(1)
// .getByTestId("handle-parsedata-shownode-text-right") .click();
// .nth(0);
// await elementParseDataOutput0.hover(); await page
// await page.mouse.down(); .getByTestId("handle-conditionalrouter-shownode-false route-right")
// const elementPromptInput = await page .nth(0)
// .getByTestId("handle-prompt-shownode-false_examples-left") .click();
// .first();
// await elementPromptInput.hover(); await page
// await page.mouse.up(); .getByTestId("handle-pass-shownode-ignored message-left")
// await page.locator('//*[@id="react-flow-id"]').hover(); .nth(0)
// //connection 6 .click();
// const elementParseDataOutput1 = await page
// .getByTestId("handle-parsedata-shownode-text-right") await page
// .nth(2); .getByTestId("handle-pass-shownode-output message-right")
// await elementParseDataOutput1.hover(); .nth(2)
// await page.mouse.down(); .click();
// const elementPromptInput1 = await page
// .getByTestId("handle-prompt-shownode-true_examples-left") await page.getByTestId("handle-chatoutput-shownode-text-left").nth(0).click();
// .first();
// await elementPromptInput1.hover(); await page
// await page.mouse.up(); .getByTestId("handle-pass-shownode-output message-right")
// await page.locator('//*[@id="react-flow-id"]').hover(); .nth(0)
// //connection 7 .click();
// elementPassOutput3.hover();
// await page.mouse.down(); await page.getByTestId("handle-chatoutput-shownode-text-left").nth(1).click();
// const elementPromptInput2 = await page
// .getByTestId("handle-prompt-shownode-user_message-left") await page
// .first(); .getByTestId("popover-anchor-input-api_key")
// await elementPromptInput2.hover(); .fill(process.env.OPENAI_API_KEY ?? "");
// await page.mouse.up(); await page.getByTestId("dropdown_str_model_name").click();
// await page.locator('//*[@id="react-flow-id"]').hover(); await page.getByTestId("gpt-4o-1-option").click();
// //connection 8 await page.getByLabel("fit view").click();
// const elementPromptOutput = await page await page.getByText("Playground", { exact: true }).last().click();
// .getByTestId("handle-prompt-shownode-prompt message-right") await page.waitForSelector('[data-testid="input-chat-playground"]', {
// .first(); timeout: 100000,
// await elementPromptOutput.hover(); });
// await page.mouse.down(); await page.getByTestId("input-chat-playground").click();
// const elementOpenAiInput = await page await page
// .getByTestId("handle-openaimodel-shownode-input-left") .getByTestId("input-chat-playground")
// .first(); .fill("my dog is alive and happy!");
// await elementOpenAiInput.hover(); await page.waitForSelector('[data-testid="icon-LucideSend"]', {
// await page.mouse.up(); timeout: 100000,
// await page.locator('//*[@id="react-flow-id"]').hover(); });
// //connection 9 await page.getByTestId("icon-LucideSend").click();
// const elementPassOutput1 = await page await page.waitForSelector("text=🤪", {
// .getByTestId("handle-pass-shownode-output message-right") timeout: 1200000,
// .nth(2); });
// await elementPassOutput1.hover(); await page.getByText("🤪").isVisible();
// await page.mouse.down();
// const elementChatOutput = await page
// .getByTestId("handle-chatoutput-shownode-text-left")
// .last();
// await elementChatOutput.hover();
// await page.mouse.up();
// await page.locator('//*[@id="react-flow-id"]').hover();
// //connection 10
// const elementPassOutput2 = await page
// .getByTestId("handle-pass-shownode-output message-right")
// .first();
// await elementPassOutput2.hover();
// await page.mouse.down();
// const elementChatOutput1 = await page
// .getByTestId("handle-chatoutput-shownode-text-left")
// .first();
// await elementChatOutput1.hover();
// await page.mouse.up();
// await page.locator('//*[@id="react-flow-id"]').hover();
// //connection 11
// const elementOpenAiOutput = await page
// .getByTestId("handle-openaimodel-shownode-text-right")
// .first();
// await elementOpenAiOutput.hover();
// await page.mouse.down();
// const elementConditionalRouterInput1 = await page
// .getByTestId("handle-conditionalrouter-shownode-input text-left")
// .first();
// await elementConditionalRouterInput1.hover();
// await page.mouse.up();
// await page.getByTestId("icon-arrow-right").nth(1).click();
// await page.getByTestId("more-options-modal").click();
// await page.getByTestId("edit-button-modal").click();
// let showIgnoredMessageCheckbox = await page.getByTestId(
// "showignored_message",
// );
// if (!(await showIgnoredMessageCheckbox.isChecked())) {
// await showIgnoredMessageCheckbox.click();
// }
// await page
// .getByTestId("popover-anchor-input-input_message-edit")
// .nth(0)
// .fill("You're Happy! 🤪");
// await page.getByText("Close").last().click();
// await page.getByTitle("zoom in").click();
// await page.getByTitle("zoom in").click();
// await page.getByTitle("zoom in").click();
// await page.getByTitle("zoom in").click();
// await page.locator('//*[@id="react-flow-id"]').hover();
// await page.getByTestId("icon-arrow-right").nth(0).click();
// await page.getByTestId("more-options-modal").click();
// await page.getByTestId("edit-button-modal").click();
// showIgnoredMessageCheckbox = await page.getByTestId("showignored_message");
// if (!(await showIgnoredMessageCheckbox.isChecked())) {
// await showIgnoredMessageCheckbox.click();
// }
// await page
// .getByTestId("popover-anchor-input-input_message-edit")
// .nth(0)
// .fill("You're Sad! 🥲");
// await page.getByText("Close").last().click();
// await page.getByTitle("fit view").click({
// force: true,
// });
// await page.getByTitle("fit view").click({
// force: true,
// });
// await page.getByTestId("popover-anchor-input-match_text").fill("TRUE");
// await page.locator('//*[@id="react-flow-id"]').hover();
// //connection 12
// const elementConditionalRouterOutput1 = await page
// .getByTestId("handle-conditionalrouter-shownode-true route-right")
// .first();
// await elementConditionalRouterOutput1.hover();
// await page.mouse.down();
// await page.locator('//*[@id="react-flow-id"]').hover();
// const elementPassInput1 = await page
// .getByTestId("handle-pass-shownode-ignored message-left")
// .nth(1);
// await elementPassInput1.hover();
// await page.mouse.up();
// await page.locator('//*[@id="react-flow-id"]').hover();
// //connection 13
// const elementConditionalRouterOutput2 = await page
// .getByTestId("handle-conditionalrouter-shownode-false route-right")
// .first();
// await elementConditionalRouterOutput2.hover();
// await page.mouse.down();
// const elementPassInput2 = await page
// .getByTestId("handle-pass-shownode-ignored message-left")
// .first();
// await elementPassInput2.hover();
// await page.mouse.up();
// await page.locator('//*[@id="react-flow-id"]').hover();
// await page
// .getByTestId("popover-anchor-input-api_key")
// .fill(process.env.OPENAI_API_KEY ?? "");
// await page.getByTestId("dropdown_str_model_name").click();
// await page.getByTestId("gpt-4o-1-option").click();
// await page.getByLabel("fit view").click();
// await page.getByText("Playground", { exact: true }).last().click();
// await page.waitForSelector('[data-testid="input-chat-playground"]', {
// timeout: 100000,
// });
// await page.getByTestId("input-chat-playground").click();
// 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=🤪", {
// timeout: 1200000,
// });
// await page.getByText("🤪").isVisible();
}); });