Add test_drag_and_drop

This commit is contained in:
Michael Mintz 2020-07-20 20:25:40 -04:00
parent 4bacd83260
commit d059821879
1 changed files with 19 additions and 0 deletions

19
examples/test_drag_and_drop.py Executable file
View File

@ -0,0 +1,19 @@
"""
Testing Drag & Drop
"""
from seleniumbase import BaseCase
class DragAndDropTests(BaseCase):
def test_drag_and_drop(self):
self.open('https://www.w3schools.com/html/html5_draganddrop.asp')
self.remove_elements("script") # Ad content slows down the page
self.remove_elements("iframe") # Ad content slows down the page
self.scroll_to("#div1")
self.sleep(0.5)
self.assert_false(self.is_element_visible("#div2 img#drag1"))
self.drag_and_drop("#div1 img#drag1", '#div2')
self.assert_true(self.is_element_visible("#div2 img#drag1"))
self.sleep(1)