Skip to content

Commit d059821

Browse files
committed
Add test_drag_and_drop
1 parent 4bacd83 commit d059821

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

examples/test_drag_and_drop.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""
2+
Testing Drag & Drop
3+
"""
4+
5+
from seleniumbase import BaseCase
6+
7+
8+
class DragAndDropTests(BaseCase):
9+
10+
def test_drag_and_drop(self):
11+
self.open('https://www.w3schools.com/html/html5_draganddrop.asp')
12+
self.remove_elements("script") # Ad content slows down the page
13+
self.remove_elements("iframe") # Ad content slows down the page
14+
self.scroll_to("#div1")
15+
self.sleep(0.5)
16+
self.assert_false(self.is_element_visible("#div2 img#drag1"))
17+
self.drag_and_drop("#div1 img#drag1", '#div2')
18+
self.assert_true(self.is_element_visible("#div2 img#drag1"))
19+
self.sleep(1)

0 commit comments

Comments
 (0)