langflow/src/frontend/tests/core/features/logs.spec.ts
Lucas Oliveira 984b172d5d
feat: adds new Edit Details popover, removes flow menu, fixes nav alignment, adds new Flow Status overlay (#8087)
* Updated flow settings component size

* Added FlowSettingsComponent to contain modal content

* Removed unused imports

* Changed Flow Settings Modal to use new component

* Changed Flow Menu styling, removing Saved and context menu, and adding a direct click to edit flow info

* Removed unused styling

* Updated nav position and truncation

* updated alert styling

* Added z index to header

* Added flow settings coming from the bottom

* Changed flow settings to not crash when there is no flow

* Removed unused imports

* Implemented flow details using popover

* Removed onClick

* Changed canvas controls position and color

* Changed panel tooltip side and classes

* Added log canvas component

* Added children to flow logs modal

* Added log canvas component into page

* Changed position and shadow of canvas controls

* removed endpoint name from edit flow settings

* added endpoint name change into tweaks modal

* Added endpoint editing to tweaks

* Implemented storing the error in the flowBuildStatus

* Updated type

* Added Flow Building Component

* Added Flow Building Component implementation

* Added red color

* Added past build flow params

* Implemented design of flowBuildingComponent

* Implemented build error storing on flowStore

* Implemented build error on flow store

* Changed notifications test

* Set build error as null when building

* Reset build error when exiting flow

* Changed from error to buildError

* Changed flowStore to have buildInfo instead of buildError

* Changed flowBuildingComponent to have buildInfo and display successful builds

* Added handleDismissed instead of setting dismissed as true

* Updated tests to current Update implementation

* Updated tests to remove click on built successfully

* Updated tests and data-testid to match new Flow Name editing behavior

* fixed auto login test

* Fixed edit-flow-name test and save changes on node

* fixed tests

* Changed Share to Publish and added test ids

* added Rename Flow util for tests

* Changed tests to use new RenameFlow

* Fixed auto save off

* Added data test id to flow building component

* Removed pulsing from Name Invalid

* Made name editable but not saveable when invalid

* Added character name reached on description

* Added transition on pencil

* Modularized alert store to separate notification history and notifications

* Added errors to notification history

* Fixed flow building component position and update all components

* Fixed animations

* Fixed animation

* Added same animation to Update All Components

* Updated animations to make update only appear when flow building is not appearing

* fix flow settings test

* Fixed build status not being redefined

*  (UpdateAllComponents/index.tsx): Refactor containerVariants to CONTAINER_VARIANTS for consistency and readability
📝 (visual-variants.ts): Add visual variants for buttons and time in flowBuildingComponent
♻️ (flowBuildingComponent/index.tsx): Import visual variants from separate file for better organization and maintainability

* Fixed offset width of time

---------

Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2025-05-22 14:44:25 +00:00

89 lines
3.4 KiB
TypeScript

import { expect, test } from "@playwright/test";
import * as dotenv from "dotenv";
import path from "path";
import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
test(
"should able to see and interact with logs",
{ tag: ["@release", "@workspace", "@api"] },
async ({ page }) => {
test.skip(
!process?.env?.OPENAI_API_KEY,
"OPENAI_API_KEY required to run this test",
);
if (!process.env.CI) {
dotenv.config({ path: path.resolve(__dirname, "../../.env") });
}
await awaitBootstrapTest(page);
await page.getByTestId("side_nav_options_all-templates").click();
await page.getByRole("heading", { name: "Basic Prompting" }).click();
await expect(page.getByTestId(/.*rf__node.*/).first()).toBeVisible({
timeout: 3000,
});
let outdatedComponents = await page.getByTestId("update-button").count();
while (outdatedComponents > 0) {
await page.getByTestId("update-button").first().click();
outdatedComponents = await page.getByTestId("update-button").count();
}
let filledApiKey = await page.getByTestId("remove-icon-badge").count();
while (filledApiKey > 0) {
await page.getByTestId("remove-icon-badge").first().click();
filledApiKey = await page.getByTestId("remove-icon-badge").count();
}
await page.getByText("Logs").click();
await page.getByText("No Data Available", { exact: true }).isVisible();
await page.keyboard.press("Escape");
const apiKeyInput = page.getByTestId("popover-anchor-input-api_key");
const isApiKeyInputVisible = await apiKeyInput.isVisible();
if (isApiKeyInputVisible) {
await apiKeyInput.fill(process.env.OPENAI_API_KEY ?? "");
}
await page.getByTestId("dropdown_str_model_name").click();
await page.getByTestId("gpt-4o-1-option").click();
await page.waitForSelector('[data-testid="button_run_chat output"]', {
timeout: 1000,
});
await page.getByTestId("button_run_chat output").first().click();
await page.waitForSelector("text=built successfully", { timeout: 30000 });
await page.getByText("Logs").click();
await page.getByText("timestamp").first().isVisible();
await page.getByText("flow_id").first().isVisible();
await page.getByText("source").first().isVisible();
await page.getByText("target", { exact: true }).first().isVisible();
await page.getByText("target_args", { exact: true }).first().isVisible();
await page.getByRole("gridcell").first().isVisible();
await page.keyboard.press("Escape");
await page.getByTestId("user-profile-settings").first().click();
await page.getByText("Settings", { exact: true }).click();
await page.getByText("Messages", { exact: true }).click();
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();
},
);