2018-06-29 17:27:30 +00:00
|
|
|
import pytest
|
2018-08-23 13:50:19 +00:00
|
|
|
from tests import marks, common_password, get_current_time, test_fairy_warning_text, unique_password
|
2018-06-29 17:27:30 +00:00
|
|
|
from tests.base_test_case import SingleDeviceTestCase
|
|
|
|
from views.sign_in_view import SignInView
|
|
|
|
|
|
|
|
|
|
|
|
@marks.all
|
|
|
|
@marks.account
|
|
|
|
class TestCreateAccount(SingleDeviceTestCase):
|
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5300)
|
|
|
|
@marks.critical
|
2018-06-29 17:27:30 +00:00
|
|
|
def test_create_account(self):
|
2018-08-10 10:09:19 +00:00
|
|
|
sign_in = SignInView(self.driver, skip_popups=False)
|
|
|
|
if not sign_in.element_by_text_part(test_fairy_warning_text).is_element_displayed():
|
2018-06-29 17:27:30 +00:00
|
|
|
self.errors.append('TestFairy warning is not shown')
|
2018-08-10 10:09:19 +00:00
|
|
|
sign_in.accept_agreements()
|
2018-06-29 17:27:30 +00:00
|
|
|
if not sign_in.i_have_account_button.is_element_displayed():
|
|
|
|
self.errors.append("'I have an account' button is not displayed")
|
|
|
|
sign_in.create_account_button.click()
|
|
|
|
sign_in.password_input.set_value(common_password)
|
|
|
|
sign_in.next_button.click()
|
|
|
|
sign_in.confirm_password_input.set_value(common_password)
|
|
|
|
sign_in.next_button.click()
|
|
|
|
|
|
|
|
sign_in.element_by_text_part('Display name').wait_for_element(30)
|
|
|
|
sign_in.name_input.send_keys('user_%s' % get_current_time())
|
|
|
|
|
|
|
|
sign_in.next_button.click()
|
2018-08-10 10:09:19 +00:00
|
|
|
self.verify_no_errors()
|
2018-06-29 17:27:30 +00:00
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5356)
|
|
|
|
@marks.critical
|
2018-06-29 17:27:30 +00:00
|
|
|
def test_switch_users_and_add_new_account(self):
|
|
|
|
sign_in = SignInView(self.driver)
|
|
|
|
sign_in.create_user()
|
|
|
|
public_key = sign_in.get_public_key()
|
|
|
|
profile = sign_in.get_profile_view()
|
2018-07-17 16:27:00 +00:00
|
|
|
profile.logout()
|
2018-07-16 12:57:01 +00:00
|
|
|
if sign_in.ok_button.is_element_displayed():
|
|
|
|
sign_in.ok_button.click()
|
2018-07-17 16:27:00 +00:00
|
|
|
sign_in.other_accounts_button.click()
|
2018-06-29 17:27:30 +00:00
|
|
|
sign_in.create_user()
|
|
|
|
if sign_in.get_public_key() == public_key:
|
|
|
|
pytest.fail('New account was not created')
|
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5379)
|
|
|
|
@marks.high
|
2018-06-29 17:27:30 +00:00
|
|
|
def test_home_view(self):
|
|
|
|
sign_in = SignInView(self.driver)
|
|
|
|
home = sign_in.create_user()
|
2018-07-18 12:19:52 +00:00
|
|
|
if not home.welcome_image.is_element_displayed():
|
|
|
|
self.errors.append('Welcome image is not shown')
|
2018-06-29 17:27:30 +00:00
|
|
|
for text in ['Welcome to Status',
|
2018-08-07 13:23:31 +00:00
|
|
|
'Tap the plus (+) button to get started']:
|
2018-06-29 17:27:30 +00:00
|
|
|
if not home.element_by_text(text).is_element_displayed():
|
|
|
|
self.errors.append("'%s' text is not shown" % text)
|
|
|
|
home.profile_button.click()
|
|
|
|
home.home_button.click()
|
2018-09-05 15:39:22 +00:00
|
|
|
text = 'Your Home screen will house your recent chats and DApp history. Tap the plus (+) button to get started.'
|
2018-06-29 17:27:30 +00:00
|
|
|
if not home.element_by_text(text).is_element_displayed():
|
|
|
|
self.errors.append("'%s' text is not shown" % text)
|
|
|
|
self.verify_no_errors()
|
2018-06-30 12:17:38 +00:00
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5460)
|
|
|
|
@marks.medium
|
2018-06-30 12:17:38 +00:00
|
|
|
def test_create_account_short_and_mismatch_password(self):
|
|
|
|
sign_in = SignInView(self.driver)
|
|
|
|
sign_in.create_account_button.click()
|
|
|
|
sign_in.password_input.set_value('12345')
|
|
|
|
|
2018-08-08 15:30:48 +00:00
|
|
|
mismatch_error = "Passwords don't match"
|
2018-06-30 12:17:38 +00:00
|
|
|
|
|
|
|
sign_in.next_button.click()
|
|
|
|
if sign_in.confirm_password_input.is_element_displayed():
|
|
|
|
self.errors.append('Next button is clickable when password is less then 6 symbols')
|
|
|
|
|
|
|
|
sign_in.password_input.set_value('123456')
|
|
|
|
sign_in.next_button.click()
|
|
|
|
sign_in.confirm_password_input.set_value('1234567')
|
|
|
|
sign_in.next_button.click()
|
|
|
|
|
|
|
|
if not sign_in.find_text_part(mismatch_error):
|
|
|
|
self.errors.append("'%s' is not shown")
|
|
|
|
self.verify_no_errors()
|
2018-07-09 19:47:50 +00:00
|
|
|
|
2018-09-28 15:30:06 +00:00
|
|
|
@marks.testrail_id(5414)
|
|
|
|
@marks.critical
|
2018-08-23 13:50:19 +00:00
|
|
|
@marks.logcat
|
2018-07-09 19:47:50 +00:00
|
|
|
def test_password_in_logcat_creating_account(self):
|
|
|
|
sign_in = SignInView(self.driver)
|
2018-08-23 13:50:19 +00:00
|
|
|
sign_in.create_user(password=unique_password)
|
|
|
|
sign_in.check_no_values_in_logcat(password=unique_password)
|