Example #1
0
 def test_drag_and_drop_with_offset(self):
     mock_desk = MagicMock()
     webdriver.Remote = WebdriverRemoteMock
     ActionChains.drag_and_drop_by_offset = MagicMock()
     MobileLibrary.open_application(mock_desk, 'remote_url')
     MobileLibrary.drag_and_drop_by_offset(mock_desk,
                                           "some_locator",
                                           x_offset=100,
                                           y_offset=100)
     ActionChains.drag_and_drop_by_offset.assert_called()
Example #2
0
 def test_drag_and_drop_with_offset(self):
     mock_desk = MagicMock()
     webdriver.Remote = WebdriverRemoteMock
     TouchAction.move_to = MagicMock()
     TouchAction.release = MagicMock()
     MobileLibrary.open_application(mock_desk, 'remote_url')
     MobileLibrary.drag_and_drop_by_offset(mock_desk,
                                           "some_locator",
                                           x_offset=100,
                                           y_offset=100)
     mock_desk._platform_dependant_press.assert_called()
     TouchAction.move_to.assert_called_with(x=unittest.mock.ANY,
                                            y=unittest.mock.ANY)
     TouchAction.release.assert_called()