From 1c896924d6ca5b1862e1a94100109695404b4f5b Mon Sep 17 00:00:00 2001 From: cristhianzl Date: Fri, 14 Jun 2024 16:38:15 -0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20(tests):=20add=20zoom=20actions=20t?= =?UTF-8?q?o=20end-to-end=20tests=20for=20better=20view=20control=20?= =?UTF-8?q?=E2=9C=85=20(tests):=20update=20locators=20in=20chatInputOutput?= =?UTF-8?q?.spec.ts=20for=20element=20accuracy=20=E2=9C=85=20(tests):=20im?= =?UTF-8?q?port=20dotenv=20and=20path=20in=20end-to-end=20tests=20for=20en?= =?UTF-8?q?vironment=20config=20=E2=9C=85=20(tests):=20add=20control-click?= =?UTF-8?q?=20actions=20in=20group.spec.ts=20for=20multi-select=20testing?= =?UTF-8?q?=20=E2=9C=85=20(tests):=20update=20text=20assertions=20in=20log?= =?UTF-8?q?s.spec.ts=20for=20consistency=20with=20UI=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tests/end-to-end/actionsMainPage.spec.ts | 16 ++++++++++++++++ .../end-to-end/chatInputOutputUser.spec.ts | 2 ++ .../tests/end-to-end/generalBugs.spec.ts | 2 ++ src/frontend/tests/end-to-end/group.spec.ts | 4 ++++ src/frontend/tests/end-to-end/logs.spec.ts | 19 +++++++++++-------- 5 files changed, 35 insertions(+), 8 deletions(-) diff --git a/src/frontend/tests/end-to-end/actionsMainPage.spec.ts b/src/frontend/tests/end-to-end/actionsMainPage.spec.ts index 9ebc39753..d14feb50a 100644 --- a/src/frontend/tests/end-to-end/actionsMainPage.spec.ts +++ b/src/frontend/tests/end-to-end/actionsMainPage.spec.ts @@ -89,6 +89,11 @@ test("search components", async ({ page }) => { } await page.getByRole("heading", { name: "Basic Prompting" }).click(); + await page.getByTitle("fit view").click(); + await page.getByTitle("zoom out").click(); + await page.getByTitle("zoom out").click(); + await page.getByTitle("zoom out").click(); + await page.getByText("Chat Input").first().click(); await page.getByTestId("more-options-modal").click(); @@ -152,6 +157,11 @@ test("user should be able to download a flow or a component", async ({ } await page.getByRole("heading", { name: "Basic Prompting" }).click(); + await page.getByTitle("fit view").click(); + await page.getByTitle("zoom out").click(); + await page.getByTitle("zoom out").click(); + await page.getByTitle("zoom out").click(); + await page.getByText("Chat Input", { exact: true }).click(); await page.getByTestId("more-options-modal").click(); @@ -224,6 +234,12 @@ test("user should be able to duplicate a flow or a component", async ({ } await page.getByRole("heading", { name: "Basic Prompting" }).click(); + + await page.getByTitle("fit view").click(); + await page.getByTitle("zoom out").click(); + await page.getByTitle("zoom out").click(); + await page.getByTitle("zoom out").click(); + await page.getByText("Chat Input", { exact: true }).click(); await page.getByTestId("more-options-modal").click(); diff --git a/src/frontend/tests/end-to-end/chatInputOutputUser.spec.ts b/src/frontend/tests/end-to-end/chatInputOutputUser.spec.ts index adc2f1805..c603d4c7b 100644 --- a/src/frontend/tests/end-to-end/chatInputOutputUser.spec.ts +++ b/src/frontend/tests/end-to-end/chatInputOutputUser.spec.ts @@ -1,5 +1,7 @@ import { expect, test } from "@playwright/test"; +import * as dotenv from "dotenv"; import { readFileSync } from "fs"; +import path from "path"; test("user must interact with chat with Input/Output", async ({ page }) => { if (!process.env.CI) { diff --git a/src/frontend/tests/end-to-end/generalBugs.spec.ts b/src/frontend/tests/end-to-end/generalBugs.spec.ts index 49ac0af65..104023a38 100644 --- a/src/frontend/tests/end-to-end/generalBugs.spec.ts +++ b/src/frontend/tests/end-to-end/generalBugs.spec.ts @@ -1,4 +1,6 @@ import { expect, test } from "@playwright/test"; +import * as dotenv from "dotenv"; +import path from "path"; test("should interact with api request", async ({ page }) => { await page.goto("/"); diff --git a/src/frontend/tests/end-to-end/group.spec.ts b/src/frontend/tests/end-to-end/group.spec.ts index 5cf1607ee..ff58e7a9c 100644 --- a/src/frontend/tests/end-to-end/group.spec.ts +++ b/src/frontend/tests/end-to-end/group.spec.ts @@ -26,6 +26,10 @@ test.describe("group node test", () => { .click(); await page.waitForTimeout(2000); await page.getByLabel("fit view").first().click(); + + await page.getByTestId("title-OpenAI").click(); + await page.getByTestId("title-OpenAI").click({ modifiers: ["Control"] }); + await page.getByTestId("title-Prompt").click({ modifiers: ["Control"] }); await page.getByTestId("title-OpenAI").click({ modifiers: ["Control"] }); await page.getByRole("button", { name: "Group" }).click(); diff --git a/src/frontend/tests/end-to-end/logs.spec.ts b/src/frontend/tests/end-to-end/logs.spec.ts index 38310e2e3..9d3c0120b 100644 --- a/src/frontend/tests/end-to-end/logs.spec.ts +++ b/src/frontend/tests/end-to-end/logs.spec.ts @@ -50,13 +50,16 @@ test("should able to see and interact with logs", async ({ page }) => { await page.getByRole("gridcell").first().isVisible(); await page.getByText("Messages", { exact: true }).click(); - await page.getByText("Index").isVisible(); - await page.getByText("Timestamp").isVisible(); - await page.getByText("Flow Id", { exact: true }).isVisible(); - await page.getByText("Source").isVisible(); - await page.getByText("Target", { exact: true }).isVisible(); - await page.getByText("Target Args", { exact: true }).isVisible(); - await page.getByText("Status", { exact: true }).isVisible(); - await page.getByText("Error", { exact: true }).isVisible(); + await page.getByText("index", { exact: true }).last().isVisible(); + await page.getByText("timestamp", { exact: true }).isVisible(); + await page.getByText("flow_id", { exact: true }).isVisible(); + await page.getByText("source", { exact: true }).isVisible(); + await page.getByText("target", { exact: true }).isVisible(); + await page.getByText("vertex_id", { exact: true }).isVisible(); + await page.getByText("status", { exact: true }).isVisible(); + await page.getByText("error", { exact: true }).isVisible(); + await page.getByText("outputs", { exact: true }).isVisible(); + await page.getByText("inputs", { exact: true }).isVisible(); + await page.getByRole("gridcell").first().isVisible(); });