2019-07-22 23:19:30 +00:00
|
|
|
import random
|
|
|
|
|
2018-10-17 08:55:33 +00:00
|
|
|
from tests import marks, common_password, get_current_time, unique_password
|
2018-06-29 17:27:30 +00:00
|
|
|
from tests.base_test_case import SingleDeviceTestCase
|
|
|
|
from views.sign_in_view import SignInView
|
2019-02-26 18:05:22 +00:00
|
|
|
from tests.users import basic_user
|
2018-06-29 17:27:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
@marks.all
|
|
|
|
@marks.account
|
|
|
|
class TestCreateAccount(SingleDeviceTestCase):
|
|
|
|
|
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()
|
2020-01-28 12:00:05 +00:00
|
|
|
sign_in.your_keys_more_icon.click()
|
2019-07-09 11:37:18 +00:00
|
|
|
sign_in.generate_new_key_button.click()
|
|
|
|
sign_in.generate_key_button.click()
|
2019-05-13 07:58:41 +00:00
|
|
|
sign_in.next_button.click()
|
|
|
|
sign_in.next_button.click()
|
2019-07-09 11:37:18 +00:00
|
|
|
sign_in.create_password_input.set_value(common_password)
|
|
|
|
sign_in.next_button.click()
|
|
|
|
sign_in.confirm_your_password_input.set_value(common_password)
|
2019-05-13 07:58:41 +00:00
|
|
|
sign_in.next_button.click()
|
2019-11-18 09:38:34 +00:00
|
|
|
sign_in.lets_go_button.click()
|
2019-07-09 11:37:18 +00:00
|
|
|
|
2018-06-29 17:27:30 +00:00
|
|
|
if sign_in.get_public_key() == public_key:
|
2019-10-21 12:48:45 +00:00
|
|
|
self.driver.fail('New account was not created')
|
2018-06-29 17:27:30 +00:00
|
|
|
|
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)
|
2019-07-22 23:19:30 +00:00
|
|
|
sign_in.get_started_button.click()
|
|
|
|
sign_in.generate_key_button.click()
|
|
|
|
account_button = sign_in.get_account_by_position(random.randint(1, 4))
|
|
|
|
username = account_button.username.text
|
|
|
|
account_button.click()
|
|
|
|
sign_in.next_button.click()
|
|
|
|
sign_in.next_button.click()
|
|
|
|
sign_in.create_password_input.set_value(common_password)
|
|
|
|
sign_in.next_button.click()
|
|
|
|
sign_in.confirm_your_password_input.set_value(common_password)
|
|
|
|
sign_in.next_button.click()
|
2020-01-21 13:59:01 +00:00
|
|
|
sign_in.lets_go_button.wait_for_element(10)
|
2019-11-18 09:38:34 +00:00
|
|
|
sign_in.lets_go_button.click()
|
2019-07-22 23:19:30 +00:00
|
|
|
home_view = sign_in.get_home_view()
|
2020-01-07 12:33:47 +00:00
|
|
|
texts = ['Chat and transact privately with friends',
|
|
|
|
'Jump into a public chat and meet new people',
|
2019-12-26 11:56:59 +00:00
|
|
|
'#status']
|
2019-11-18 09:38:34 +00:00
|
|
|
for text in texts:
|
|
|
|
if not home_view.element_by_text(text).is_element_displayed():
|
|
|
|
self.errors.append("'%s' text is not shown" % text)
|
2020-04-03 11:01:55 +00:00
|
|
|
sign_in.element_by_text("#status").click()
|
|
|
|
sign_in.back_button.click()
|
2019-07-22 23:19:30 +00:00
|
|
|
profile_view = home_view.profile_button.click()
|
2019-08-23 10:24:52 +00:00
|
|
|
shown_username = profile_view.default_username_text.text
|
|
|
|
if shown_username != username:
|
|
|
|
self.errors.append("Default username '%s' doesn't match '%s'" % (shown_username, username))
|
2019-11-18 09:38:34 +00:00
|
|
|
profile_view.home_button.click()
|
2020-04-03 11:01:55 +00:00
|
|
|
home_view.cross_icon_iside_welcome_screen_button.click()
|
|
|
|
home_view.delete_chat_long_press("#status")
|
2019-11-18 09:38:34 +00:00
|
|
|
if home_view.element_by_text(texts[0]).is_element_displayed():
|
|
|
|
self.errors.append("'%s' text is shown, but welcome view was closed" % texts[0])
|
|
|
|
home_view.relogin()
|
|
|
|
if home_view.element_by_text(texts[0]).is_element_displayed():
|
|
|
|
self.errors.append("'%s' text is shown after relogin, but welcome view was closed" % texts[0])
|
|
|
|
text_after_closing_welcome_screen = "Your chats will appear here. To start new chats press the ⊕ button"
|
|
|
|
if not home_view.element_by_text(text_after_closing_welcome_screen).is_element_displayed():
|
|
|
|
self.errors.append("'%s' text is not shown after welcome view was closed" % text_after_closing_welcome_screen)
|
|
|
|
|
2019-10-29 08:25:57 +00:00
|
|
|
self.errors.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)
|
2019-07-11 15:44:12 +00:00
|
|
|
sign_in.get_started_button.click()
|
|
|
|
sign_in.generate_key_button.click()
|
|
|
|
sign_in.next_button.click()
|
|
|
|
sign_in.next_button.click()
|
|
|
|
sign_in.create_password_input.set_value('12345')
|
2018-06-30 12:17:38 +00:00
|
|
|
|
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()
|
2019-07-11 15:44:12 +00:00
|
|
|
if sign_in.confirm_your_password_input.is_element_displayed():
|
2018-06-30 12:17:38 +00:00
|
|
|
self.errors.append('Next button is clickable when password is less then 6 symbols')
|
|
|
|
|
2019-07-11 15:44:12 +00:00
|
|
|
sign_in.create_password_input.set_value('123456')
|
2018-06-30 12:17:38 +00:00
|
|
|
sign_in.next_button.click()
|
2019-07-11 15:44:12 +00:00
|
|
|
sign_in.confirm_your_password_input.set_value('1234567')
|
2018-06-30 12:17:38 +00:00
|
|
|
sign_in.next_button.click()
|
|
|
|
|
|
|
|
if not sign_in.find_text_part(mismatch_error):
|
|
|
|
self.errors.append("'%s' is not shown")
|
2019-10-29 08:25:57 +00:00
|
|
|
self.errors.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)
|
2019-09-24 14:22:20 +00:00
|
|
|
values_in_logcat = sign_in.find_values_in_logcat(password=unique_password)
|
|
|
|
if values_in_logcat:
|
|
|
|
self.driver.fail(values_in_logcat)
|
2019-02-26 18:05:22 +00:00
|
|
|
|
|
|
|
@marks.testrail_id(5718)
|
|
|
|
@marks.medium
|
|
|
|
def test_special_characters_in_password_when_creating_new_account(self):
|
|
|
|
sign_in = SignInView(self.driver)
|
|
|
|
sign_in.create_user(password=basic_user['special_chars_password'])
|
|
|
|
sign_in.relogin(password=basic_user['special_chars_password'])
|