Skip to content

Commit f9a2160

Browse files
committed
[JS] Adds code sample for drag and drop onto element
1 parent 99f0d84 commit f9a2160

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

examples/javascript/test/actionsApi/mouse/dragAndDrop.spec.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,16 @@ suite(function(env) {
2323
let result = await driver.findElement(By.id("drop-status")).getText();
2424
assert.deepStrictEqual('dropped', result)
2525
});
26+
27+
it('Onto Element', async function() {
28+
await driver.get('https://www.selenium.dev/selenium/web/mouse_interaction.html');
29+
const draggable = driver.findElement(By.id("draggable"));
30+
const droppable = await driver.findElement(By.id("droppable"));
31+
const actions = driver.actions({async: true});
32+
await actions.dragAndDrop(draggable, droppable).perform();
33+
34+
let result = await driver.findElement(By.id("drop-status")).getText();
35+
assert.deepStrictEqual('dropped', result)
36+
});
2637
});
2738
});

0 commit comments

Comments
 (0)