How to write playwright test cases for re-orderable list ? Playwright mouse.move not working while trying to reorder divs

53 views Asked by At

I am trying to reodrer divs like rearranging the order however the the div is not moving. I cannot post the UI here but its something like this

https://codepen.io/dsenneff/pen/JjNPJer/b2bc0298b73dd5605f45828df3b61dd4

Steps to reproduce

const mays= page.locator('div').filter({ hasText: /^texthere$/ });
await mays.getByLabel('drag page').hover();
await page.mouse.down({ button: "left" });
let mosboundingbox = await mays.boundingBox();
console.log(mosboundingbox);
await page.mouse.move(mosboundingbox!.x, mosboundingbox!.y + 500, { steps: 10 }); // Mouse up to stop dragging
console.log("moved to ", "x", mosboundingbox!.x, "y", mosboundingbox!.y + 100)
await page.mouse.up();

Expected behavior : The div to come down below its below one

0

There are 0 answers