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:
parent
e6bacbf98b
commit
ba7380824c
1 changed files with 9 additions and 3 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
import { expect, test } from "@playwright/test";
|
import { expect, test } from "@playwright/test";
|
||||||
import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
|
import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
|
||||||
|
import { zoomOut } from "../../utils/zoom-out";
|
||||||
|
|
||||||
test(
|
test(
|
||||||
"User should be able to use components as tool",
|
"User should be able to use components as tool",
|
||||||
|
|
@ -113,17 +114,22 @@ test(
|
||||||
|
|
||||||
await page.getByTestId("disclosure-agents").click();
|
await page.getByTestId("disclosure-agents").click();
|
||||||
|
|
||||||
|
await page.getByTestId("fit_view").click();
|
||||||
|
|
||||||
|
await zoomOut(page, 4);
|
||||||
|
|
||||||
await page.waitForSelector('[data-testid="agentsAgent"]', {
|
await page.waitForSelector('[data-testid="agentsAgent"]', {
|
||||||
timeout: 3000,
|
timeout: 3000,
|
||||||
state: "visible",
|
state: "visible",
|
||||||
});
|
});
|
||||||
await page
|
await page
|
||||||
.getByTestId("agentsAgent")
|
.getByTestId("agentsAgent")
|
||||||
.hover()
|
.dragTo(page.locator('//*[@id="react-flow-id"]'), {
|
||||||
.then(async () => {
|
targetPosition: { x: 350, y: 100 },
|
||||||
await page.getByTestId("add-component-button-agent").click();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await page.getByTestId("fit_view").click();
|
||||||
|
|
||||||
// Move the Agent node a bit
|
// Move the Agent node a bit
|
||||||
|
|
||||||
await page.getByTestId("handle-url-shownode-toolset-right").first().click();
|
await page.getByTestId("handle-url-shownode-toolset-right").first().click();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue