Skip to content

Commit

Permalink
one more test for full coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolfe1 committed Nov 4, 2020
1 parent 7c9f0a6 commit ee6eb2c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/Desktop/test_desktop.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ def test_switch_application_failure_3(self):
self.assertRaisesRegex(AssertionError, 'Error connecting webdriver to window "test".',
dl.switch_application_by_name, 'remote_url', window_name='test')

def test_switch_application_failure_4(self):
dl = DesktopLibrary()
dl._run_on_failure = MagicMock()
webdriver.Remote = WebdriverRemoteMock
webdriver.Remote.find_element_by_xpath = MagicMock(side_effect=[WebDriverException, 'Window', 'Window'])
self.assertRaisesRegex(AssertionError, 'Error finding window "test" in the desktop session. Is it a top level '
'window handle?.', dl.switch_application_by_name,
'remote_url', window_name='test', exact_match=False)

def test_launch_application_successful(self):
dl = DesktopLibrary()
webdriver.Remote = WebdriverRemoteMock
Expand Down

0 comments on commit ee6eb2c

Please sign in to comment.