Skip to content

Commit 47ce5bf

Browse files
committed
test(regression): update test to use box selection for Combine Text nodes instead of Ctrl/Meta+click for better reliability in Playwright with ReactFlow
1 parent f4ed889 commit 47ce5bf

File tree

1 file changed

+29
-5
lines changed

1 file changed

+29
-5
lines changed

src/frontend/tests/core/regression/generalBugs-shard-5.spec.ts

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ test(
8787
});
8888
//connection 1
8989
const elementCombineTextOutput0 = page
90-
.getByTestId("div-handle-combinetext-shownode-combined text-right")
90+
.getByTestId("handle-combinetext-shownode-combined text-right")
9191
.nth(0);
9292
await elementCombineTextOutput0.click();
9393

@@ -169,10 +169,34 @@ test(
169169

170170
await adjustScreenView(page, { numberOfZoomOut: 2 });
171171

172-
await page
173-
.getByTestId("title-Combine Text")
174-
.first()
175-
.click({ modifiers: ["ControlOrMeta"] });
172+
// Select both Combine Text nodes using box selection (Shift+drag)
173+
// Note: Ctrl/Meta+click doesn't work reliably in Playwright with ReactFlow
174+
const combineTextNodes = page.locator(".react-flow__node").filter({
175+
has: page.getByTestId("title-Combine Text"),
176+
});
177+
178+
const firstBox = await combineTextNodes.first().boundingBox();
179+
const secondBox = await combineTextNodes.nth(1).boundingBox();
180+
181+
if (firstBox && secondBox) {
182+
// Calculate area to drag-select both nodes
183+
const startX = Math.min(firstBox.x, secondBox.x) - 50;
184+
const startY = Math.min(firstBox.y, secondBox.y) - 50;
185+
const endX =
186+
Math.max(firstBox.x + firstBox.width, secondBox.x + secondBox.width) +
187+
50;
188+
const endY =
189+
Math.max(firstBox.y + firstBox.height, secondBox.y + secondBox.height) +
190+
50;
191+
192+
// Use Shift+drag for box selection
193+
await page.keyboard.down("Shift");
194+
await page.mouse.move(startX, startY);
195+
await page.mouse.down();
196+
await page.mouse.move(endX, endY, { steps: 10 });
197+
await page.mouse.up();
198+
await page.keyboard.up("Shift");
199+
}
176200

177201
await page.waitForSelector('[data-testid="group-node"]', {
178202
timeout: 3000,

0 commit comments

Comments
 (0)