test: Enhance tool mode spec with zoom controls and drag-drop functionality (#5363)

 (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
This commit is contained in:
Cristhian Zanforlin Lousa 2024-12-19 11:19:17 -03:00 committed by GitHub
commit ba7380824c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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();