From b8c100744ca447ec7ccd6509068ff8d5f53dc858 Mon Sep 17 00:00:00 2001 From: Cristhian Zanforlin Lousa Date: Mon, 17 Mar 2025 11:37:00 -0300 Subject: [PATCH] test: enhance chat integration tests with additional assertions and validations (#7102) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✅ (chatInputOutputUser-shard-1.spec.ts): add assertion to check if the close button count is greater than 1 for improved test coverage --- .../chatInputOutputUser-shard-1.spec.ts | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/frontend/tests/extended/integrations/chatInputOutputUser-shard-1.spec.ts b/src/frontend/tests/extended/integrations/chatInputOutputUser-shard-1.spec.ts index 3118d6bb1..68a622d61 100644 --- a/src/frontend/tests/extended/integrations/chatInputOutputUser-shard-1.spec.ts +++ b/src/frontend/tests/extended/integrations/chatInputOutputUser-shard-1.spec.ts @@ -1,4 +1,4 @@ -import { test } from "@playwright/test"; +import { expect, test } from "@playwright/test"; import * as dotenv from "dotenv"; import path from "path"; import { awaitBootstrapTest } from "../../utils/await-bootstrap-test"; @@ -171,11 +171,20 @@ test( await page.waitForSelector("text=built successfully", { timeout: 30000 }); await page.waitForTimeout(600); await page.keyboard.press("o"); - await page.waitForSelector( - `[data-testid="${urlNodeId}-dataframe-output-modal"]`, - { - timeout: 3000, - }, - ); + await page.getByText(`Inspect the output of the component below.`, { + exact: true, + }); + + await page.getByText(`Component Output`, { + exact: true, + }); + + const closeButton = await page + .getByText(`Close`, { + exact: true, + }) + .count(); + + expect(closeButton).toBeGreaterThan(1); }, );