2023-10-06 11:32:08 +00:00
|
|
|
import allure
|
|
|
|
import pytest
|
|
|
|
from allure import step
|
|
|
|
|
|
|
|
import constants
|
|
|
|
from driver.aut import AUT
|
|
|
|
from gui.main_window import MainWindow
|
2023-12-13 16:16:35 +00:00
|
|
|
from . import marks
|
2023-10-06 11:32:08 +00:00
|
|
|
|
2023-12-13 16:16:35 +00:00
|
|
|
pytestmark = marks
|
2023-10-06 11:32:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703007',
|
2023-10-06 13:13:04 +00:00
|
|
|
'Change own display name from online identifier')
|
2023-10-06 11:32:08 +00:00
|
|
|
@pytest.mark.case(703007)
|
|
|
|
@pytest.mark.parametrize('user_account', [constants.user.user_account_one])
|
|
|
|
@pytest.mark.parametrize('new_name', [pytest.param('NewUserName')])
|
|
|
|
def test_change_own_display_name(main_screen: MainWindow, user_account, new_name):
|
|
|
|
with step('Open own profile popup and check name of user is correct'):
|
2023-12-13 08:20:56 +00:00
|
|
|
profile = main_screen.left_panel.open_online_identifier()
|
2023-12-12 15:43:22 +00:00
|
|
|
profile_popup = profile.open_profile_popup_from_online_identifier()
|
2023-10-06 11:32:08 +00:00
|
|
|
assert profile_popup.user_name == user_account.name
|
|
|
|
|
|
|
|
with step('Go to edit profile settings and change the name of the user'):
|
|
|
|
profile_popup.edit_profile().set_name(new_name)
|
|
|
|
|
|
|
|
with step('Open own profile popup and check name of user is correct'):
|
2023-12-13 08:20:56 +00:00
|
|
|
assert main_screen.left_panel.open_online_identifier().open_profile_popup_from_online_identifier().user_name == new_name
|
2023-10-06 11:32:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703002', 'Switch state to offline')
|
|
|
|
@pytest.mark.case(703002)
|
2023-10-06 13:13:04 +00:00
|
|
|
@pytest.mark.skip(reason="https://github.com/status-im/desktop-qa-automation/issues/149")
|
2023-10-06 11:32:08 +00:00
|
|
|
def test_switch_states_between_offline_and_online(aut: AUT, main_screen: MainWindow, user_account):
|
|
|
|
with (step('Open settings and switch state to offline')):
|
|
|
|
settings = main_screen.left_panel
|
|
|
|
settings.set_user_to_offline()
|
|
|
|
|
|
|
|
with step('Verify user appears offline'):
|
|
|
|
assert settings.user_is_offline()
|
|
|
|
|
|
|
|
with step('Restart application'):
|
|
|
|
aut.restart()
|
|
|
|
main_screen.authorize_user(user_account)
|
|
|
|
|
|
|
|
with step('Verify user appears offline'):
|
|
|
|
assert settings.user_is_offline()
|
|
|
|
|
|
|
|
with (step('Open settings and switch state to online')):
|
|
|
|
settings = main_screen.left_panel
|
|
|
|
settings.set_user_to_online()
|
|
|
|
|
|
|
|
with step('Restart application'):
|
|
|
|
aut.restart()
|
|
|
|
main_screen.authorize_user(user_account)
|
|
|
|
|
|
|
|
with step('Verify user appears online'):
|
|
|
|
assert settings.user_is_online()
|
|
|
|
|
|
|
|
|
|
|
|
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703004', 'Switch state to automatic')
|
|
|
|
@pytest.mark.case(703004)
|
2023-10-06 13:13:04 +00:00
|
|
|
@pytest.mark.skip(reason="https://github.com/status-im/desktop-qa-automation/issues/149")
|
2023-10-06 11:32:08 +00:00
|
|
|
def test_switch_state_to_automatic(aut: AUT, main_screen: MainWindow, user_account):
|
|
|
|
with step('Open settings and switch state to automatic'):
|
|
|
|
settings = main_screen.left_panel
|
|
|
|
settings.set_user_to_automatic()
|
|
|
|
|
|
|
|
with step('Verify user status set automatically to online'):
|
|
|
|
assert settings.user_is_set_to_automatic()
|
|
|
|
|
|
|
|
with step('Restart application'):
|
|
|
|
aut.restart()
|
|
|
|
main_screen.authorize_user(user_account)
|
|
|
|
|
|
|
|
with step('Verify user status set automatically to online'):
|
|
|
|
assert settings.user_is_set_to_automatic()
|