Good morning everyone, I've tried for some days to perform an e2e test that performs a Drag&Drop event in Selenium, and after several ways to resolve this, someone told me about Cypress, so, here I am trying to learn this new stuff.
The question is, how could I get the x position and the y position from a certain element with Cypress? In the GitHub issues someone used this function
function moveElement(element, x, y) {
cy.get(`${element}`)
.trigger('mousedown', { which: 1 })
.trigger('mousemove', { clientX: x, clientY: y })
.trigger('mouseup', { force: true })
}
BUT, I dont think that insert the x and y coordinates directly is the best way to work, so, in Selenium I got something like
int getXCoordinate(WebElement){
location = WebElement.getLocation();
x = location.getX();
return X;
}
Is there any way to code a function similar to this?
Aucun commentaire:
Enregistrer un commentaire