Example #1
0
 def test_scroll_up(self):
     mock_desk = MagicMock()
     webdriver.Remote = WebdriverRemoteMock
     mock_desk.get_current_context = MagicMock(return_value="Web")
     MobileLibrary.open_application(mock_desk, 'remote_url')
     MobileLibrary.scroll_up(mock_desk, "some_locator")
     mock_desk._element_find()._execute.assert_called()
Example #2
0
 def test_scroll_up_native_app(self):
     mock_desk = MagicMock()
     webdriver.Remote = WebdriverRemoteMock
     mock_desk._current_application().execute_script = MagicMock()
     mock_desk.get_current_context = MagicMock(return_value="NATIVE")
     MobileLibrary.open_application(mock_desk, 'remote_url')
     MobileLibrary.scroll_up(mock_desk, "some_locator")
     mock_desk._current_application().execute_script.assert_called()