-
Notifications
You must be signed in to change notification settings - Fork 229
feat: MoveCollection COMPASS-9434 #7060
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
.action('pointer') | ||
.move({ | ||
x: Math.round(startPosition.x) + 10, | ||
y: Math.round(startPosition.y) + 10, | ||
}) | ||
.down({ button: 0 }) // Left mouse button | ||
.move({ x: 10, y: 0, duration: 100 }) | ||
.pause(1000) | ||
.move({ x: 10, y: 0, duration: 100 }) | ||
.up({ button: 0 }) // Release the left mouse button |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming we tried browser.dragAndDrop
method that wdio has and it didn't work that's why we rolled out our own logic, is that right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, doesn't work. Internally it does the simple obvious sequence of pointer actions. From debugging I saw that Reactflow would report a drag stop, but it wouldn't update the position with that alone. Only if it registered ongoing dragging before, and looks like it's doing some debouncing on that, would the node actually move.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha, thanks for context, if this is a better version of drag and drop, you might want to move it to other reusable commands that we keep in commands
expect(Math.round(nodes[0].position.x)).to.equal(originalPosition.x); | ||
expect(Math.round(nodes[0].position.y)).to.equal(originalPosition.y); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is honestly too much internal testing for an e2e test, if we can't verify the exact numbers, checking that new position is different from the old one is good enough, and for undo / redo I'm assuming browser location should also suffice (like we expect it to return to whatever getLocation returned us initially on "Undo" click)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true actually, thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eerr.. okay so.. I'm afraid this is more stable 🙈 . When I said I was happy to get it moved somewhere, I really meant it. I have no theories on this one, but I can't control where it moves. I've been playing again with the params but the only way I've seen it move is slightly to the left&up, which shifts the diagram viewport, and that messes up the rest of the checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But now I really don't like the tests like this.. let me change it so that we ignore the original startPosition.
Co-authored-by: Sergey Petushkov <[email protected]>
Description
Adds
MoveCollection
Edit. Now that we have a first non-placeholder edit, I took the opportunity to update e2e tests to use this for history checking and clean up the temporary editor.Note on the e2e tests - I've had some trouble to get reactflow to register the webdriverio's actions. In the end I was happy to get some combination of actions that moves the node somewhere else.
Screen.Recording.2025-06-27.at.11.14.23.mov
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes