2020-09-13 21:39:44 +02:00
|
|
|
from .utils import register_valid_user
|
|
|
|
|
|
|
|
|
|
|
|
class TestLogout:
|
|
|
|
def test_user_can_log_out(self, selenium):
|
|
|
|
user = register_valid_user(selenium)
|
2021-10-31 21:04:47 +01:00
|
|
|
user_menu = selenium.find_element_by_class_name('nav-items-user-menu')
|
|
|
|
logout_link = user_menu.find_elements_by_class_name('nav-item')[2]
|
2020-09-13 21:39:44 +02:00
|
|
|
|
2021-10-31 21:04:47 +01:00
|
|
|
logout_link.click()
|
2020-09-13 21:39:44 +02:00
|
|
|
selenium.implicitly_wait(1)
|
|
|
|
|
2021-10-31 21:04:47 +01:00
|
|
|
nav = selenium.find_element_by_id('nav').text
|
2020-09-13 21:39:44 +02:00
|
|
|
assert 'Register' in nav
|
|
|
|
assert 'Login' in nav
|
|
|
|
assert user['username'] not in nav
|
|
|
|
assert 'Logout' not in nav
|