From ba7380824cb9fd308da1eb573931fafd2ce96a10 Mon Sep 17 00:00:00 2001 From: Cristhian Zanforlin Lousa Date: Thu, 19 Dec 2024 11:19:17 -0300 Subject: [PATCH] test: Enhance tool mode spec with zoom controls and drag-drop functionality (#5363) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✨ (tool-mode.spec.ts): add zoomOut utility function to enable zooming out on the page 📝 (tool-mode.spec.ts): update test case to include zooming out functionality using the new zoomOut utility function --- .../tests/extended/features/tool-mode.spec.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/frontend/tests/extended/features/tool-mode.spec.ts b/src/frontend/tests/extended/features/tool-mode.spec.ts index 86c7c1b36..7893801bb 100644 --- a/src/frontend/tests/extended/features/tool-mode.spec.ts +++ b/src/frontend/tests/extended/features/tool-mode.spec.ts @@ -1,5 +1,6 @@ import { expect, test } from "@playwright/test"; import { awaitBootstrapTest } from "../../utils/await-bootstrap-test"; +import { zoomOut } from "../../utils/zoom-out"; test( "User should be able to use components as tool", @@ -113,17 +114,22 @@ test( await page.getByTestId("disclosure-agents").click(); + await page.getByTestId("fit_view").click(); + + await zoomOut(page, 4); + await page.waitForSelector('[data-testid="agentsAgent"]', { timeout: 3000, state: "visible", }); await page .getByTestId("agentsAgent") - .hover() - .then(async () => { - await page.getByTestId("add-component-button-agent").click(); + .dragTo(page.locator('//*[@id="react-flow-id"]'), { + targetPosition: { x: 350, y: 100 }, }); + await page.getByTestId("fit_view").click(); + // Move the Agent node a bit await page.getByTestId("handle-url-shownode-toolset-right").first().click();