Skip to content

Commit

Permalink
Fix test failures on using ChromeDriver-BrowserStack (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
seav authored and oliverroick committed Feb 13, 2018
1 parent 9ed3cbc commit 3a969a1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cadasta/test/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.4.0'
__version__ = '0.4.1'
5 changes: 3 additions & 2 deletions cadasta/test/account_tests/registration_util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from selenium.common.exceptions import ElementNotInteractableException
from selenium.common.exceptions import (ElementNotInteractableException,
NoSuchElementException)

from ..base_test import SeleniumTestCase

Expand All @@ -20,5 +21,5 @@ def switch_to_email_or_phone(self, field):
try:
self.wd.BY_LINK(
'I want to register with my {}'.format(field)).click()
except ElementNotInteractableException:
except (ElementNotInteractableException, NoSuchElementException):
pass
4 changes: 2 additions & 2 deletions cadasta/test/account_tests/test_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def test_user_can_invoke_resending_of_confirmation_email(self):

try:
self.wd.BY_LINK('I want to verify my email').click()
except ElementNotInteractableException:
except (ElementNotInteractableException, NoSuchElementException):
pass
self.update_form_field('email', self.email)
self.wd.BY_XPATH('//button[contains(.,"Send Verification")]').click()
Expand Down Expand Up @@ -423,7 +423,7 @@ def test_user_can_invoke_resending_of_verification_token(self):

try:
self.wd.BY_LINK('I want to verify my phone').click()
except ElementNotInteractableException:
except (ElementNotInteractableException, NoSuchElementException):
pass
self.update_form_field('phone', self.phone)
self.wd.BY_XPATH('//button[contains(.,"Send Verification")]').click()
Expand Down
7 changes: 4 additions & 3 deletions cadasta/test/account_tests/test_updating.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
import re

from os.path import abspath, dirname, join
from selenium.common.exceptions import ElementNotInteractableException
from selenium.common.exceptions import (ElementNotInteractableException,
NoSuchElementException)
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select

Expand Down Expand Up @@ -85,7 +86,7 @@ def test_user_can_invoke_password_reset_by_email(self):
self.assert_url_path('/account/password/reset/')
try:
self.wd.BY_LINK('I want to reset password with my email').click()
except ElementNotInteractableException:
except (ElementNotInteractableException, NoSuchElementException):
pass
self.update_form_field('email', self.email_user['email'])
self.wd.BY_XPATH('//*[@type="submit"]').click()
Expand All @@ -100,7 +101,7 @@ def test_user_can_invoke_password_reset_by_phone(self):
self.assert_url_path('/account/password/reset/')
try:
self.wd.BY_LINK('I want to reset password with my phone').click()
except ElementNotInteractableException:
except (ElementNotInteractableException, NoSuchElementException):
pass
self.update_form_field('phone', self.phone_user['phone'])
self.wd.BY_XPATH('//*[@type="submit"]').click()
Expand Down

0 comments on commit 3a969a1

Please sign in to comment.