fix e2e tests

This commit is contained in:
Sam 2021-11-06 23:16:19 +01:00
parent 7cb5404588
commit dee572c40f
2 changed files with 9 additions and 5 deletions

View File

@ -24,11 +24,11 @@ class TestLogin:
assert button.get_attribute('type') == 'submit' assert button.get_attribute('type') == 'submit'
assert 'Log in' in button.text assert 'Log in' in button.text
forgot_password_link = selenium.find_element_by_class_name( links = selenium.find_elements_by_class_name('links')
'password-forgotten' assert links[0].tag_name == 'a'
) assert 'Register' in links[0].text
assert forgot_password_link.tag_name == 'a' assert links[1].tag_name == 'a'
assert 'Forgot password?' in forgot_password_link.text assert 'Forgot password?' in links[1].text
def test_user_can_log_in(self, selenium): def test_user_can_log_in(self, selenium):
user = { user = {

View File

@ -29,6 +29,10 @@ class TestRegistration:
assert button.get_attribute('type') == 'submit' assert button.get_attribute('type') == 'submit'
assert 'Register' in button.text assert 'Register' in button.text
link = selenium.find_element_by_class_name('links')
assert link.tag_name == 'a'
assert 'Login' in link.text
def test_user_can_register(self, selenium): def test_user_can_register(self, selenium):
user = register_valid_user(selenium) user = register_valid_user(selenium)