2018-10-23 14:49:29 +00:00
|
|
|
from tests.base_test_case import BaseTestCase
|
|
|
|
from views.sign_in_view import SignInView
|
2018-11-09 21:26:36 +00:00
|
|
|
import pytest
|
2018-10-23 14:49:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
class TestCreateAccount(BaseTestCase):
|
|
|
|
|
2018-11-09 21:26:36 +00:00
|
|
|
@pytest.mark.testrail_id(5565)
|
2018-10-23 14:49:29 +00:00
|
|
|
def test_create_account(self):
|
|
|
|
sign_in = SignInView()
|
|
|
|
sign_in.create_account_button.click()
|
|
|
|
sign_in.create_password_input.input_value('123456')
|
|
|
|
sign_in.next_button.click()
|
|
|
|
sign_in.confirm_password_input.input_value('123456')
|
|
|
|
sign_in.next_button.click()
|
|
|
|
sign_in.username_input.input_value('test')
|
|
|
|
sign_in.next_button.click()
|
|
|
|
sign_in.home_button.find_element()
|
|
|
|
|
2018-11-09 21:26:36 +00:00
|
|
|
@pytest.mark.testrail_id(5570)
|
2018-10-23 14:49:29 +00:00
|
|
|
def test_create_account_proceed_with_enter(self):
|
|
|
|
sign_in = SignInView()
|
|
|
|
sign_in.create_account_button.click()
|
2018-10-24 21:01:30 +00:00
|
|
|
sign_in.create_password_input.input_value('123456')
|
|
|
|
sign_in.press_enter()
|
|
|
|
sign_in.confirm_password_input.input_value('123456')
|
|
|
|
sign_in.press_enter()
|
|
|
|
sign_in.username_input.input_value('test')
|
|
|
|
sign_in.press_enter()
|
2018-10-23 14:49:29 +00:00
|
|
|
sign_in.home_button.find_element()
|
|
|
|
|
2018-11-09 21:26:36 +00:00
|
|
|
@pytest.mark.testrail_id(5568)
|
2018-10-23 14:49:29 +00:00
|
|
|
def test_create_account_go_back(self):
|
|
|
|
sign_in = SignInView()
|
|
|
|
sign_in.create_account_button.click()
|
|
|
|
sign_in.create_password_input.find_element()
|
|
|
|
sign_in.back_button.click()
|
|
|
|
sign_in.create_account_button.click()
|
2018-10-24 21:01:30 +00:00
|
|
|
sign_in.create_password_input.input_value('123456')
|
|
|
|
sign_in.press_enter()
|
2018-10-23 14:49:29 +00:00
|
|
|
sign_in.confirm_password_input.find_element()
|
|
|
|
sign_in.back_button.click()
|
|
|
|
sign_in.create_password_input.find_element()
|
2018-10-24 21:01:30 +00:00
|
|
|
sign_in.create_password_input.input_value('123456')
|
|
|
|
sign_in.press_enter()
|
|
|
|
sign_in.confirm_password_input.input_value('123456')
|
|
|
|
sign_in.press_enter()
|
2018-10-23 14:49:29 +00:00
|
|
|
sign_in.username_input.find_element()
|
|
|
|
sign_in.back_button.verify_element_is_not_present()
|
|
|
|
|
2018-11-09 21:26:36 +00:00
|
|
|
@pytest.mark.testrail_id(5567)
|
2018-10-23 14:49:29 +00:00
|
|
|
def test_switch_accounts(self):
|
|
|
|
sign_in = SignInView()
|
|
|
|
sign_in.create_account(username='user_1')
|
|
|
|
profile = sign_in.profile_button.click()
|
|
|
|
profile.log_out_button.click()
|
|
|
|
sign_in.other_accounts_button.click()
|
|
|
|
sign_in.create_account(username='user_2')
|
|
|
|
sign_in.profile_button.click()
|
|
|
|
profile.log_out_button.click()
|
|
|
|
sign_in.other_accounts_button.click()
|
|
|
|
sign_in.element_by_text('user_2').click()
|
2018-10-24 21:01:30 +00:00
|
|
|
sign_in.password_input.input_value('qwerty')
|
|
|
|
sign_in.press_enter()
|
2018-10-23 14:49:29 +00:00
|
|
|
sign_in.profile_button.click()
|
|
|
|
profile.find_text('user_2')
|
2018-11-16 09:53:05 +00:00
|
|
|
|
|
|
|
@pytest.mark.testrail_id(5650)
|
|
|
|
def test_status_log(self):
|
|
|
|
sign_in = SignInView()
|
|
|
|
sign_in.create_account()
|
|
|
|
with open('/root/.local/share/Status/Status.log') as f:
|
|
|
|
if 'mnemonic' in f.read():
|
|
|
|
pytest.fail("'mnemonic' is in Status.log!")
|