2022-06-25 21:23:15 +02:00
|
|
|
from selenium.webdriver.common.by import By
|
|
|
|
|
2022-03-23 12:36:41 +01:00
|
|
|
from .utils import register_valid_user
|
2020-09-13 21:39:44 +02:00
|
|
|
|
|
|
|
|
|
|
|
class TestProfile:
|
|
|
|
def test_it_displays_user_profile(self, selenium):
|
|
|
|
user = register_valid_user(selenium)
|
|
|
|
|
2022-06-25 21:23:15 +02:00
|
|
|
app_menu = selenium.find_element(By.CLASS_NAME, 'nav-items-user-menu')
|
|
|
|
profile_link = app_menu.find_elements(By.CLASS_NAME, 'nav-item')[1]
|
2022-03-23 12:36:41 +01:00
|
|
|
profile_link.click()
|
|
|
|
selenium.implicitly_wait(1)
|
|
|
|
|
2022-06-25 21:23:15 +02:00
|
|
|
user_header = selenium.find_element(By.CLASS_NAME, 'user-header')
|
2021-10-31 21:04:47 +01:00
|
|
|
assert user['username'] in user_header.text
|
|
|
|
assert '0\nworkouts' in user_header.text
|
|
|
|
assert '0\nkm' in user_header.text
|
|
|
|
assert '0\nsports' in user_header.text
|
2020-09-13 21:39:44 +02:00
|
|
|
|
2022-06-25 21:23:15 +02:00
|
|
|
user_infos = selenium.find_element(By.ID, 'user-infos')
|
2021-10-31 21:04:47 +01:00
|
|
|
assert 'Registration date' in user_infos.text
|
|
|
|
assert 'First name' in user_infos.text
|
|
|
|
assert 'Last name' in user_infos.text
|
|
|
|
assert 'Birth date' in user_infos.text
|
|
|
|
assert 'Location' in user_infos.text
|
|
|
|
assert 'Bio' in user_infos.text
|