Fix for stopping sauce sessions in teardown

This commit is contained in:
Yevheniia Berdnyk 2022-06-17 03:57:19 +03:00
parent 25057b3968
commit 62a3ed6138
No known key found for this signature in database
GPG Key ID: 0642C73C66214825
17 changed files with 555 additions and 535 deletions

View File

@ -330,6 +330,14 @@ class LocalSharedMultipleDeviceTestCase(AbstractTestCase):
except WebDriverException: except WebDriverException:
pass pass
@pytest.fixture(scope='class', autouse=True)
def prepare(self, request):
try:
request.cls.prepare_devices(request)
finally:
for item, value in request.__dict__.items():
setattr(request.cls, item, value)
@classmethod @classmethod
def teardown_class(cls): def teardown_class(cls):
for driver in cls.drivers: for driver in cls.drivers:
@ -367,6 +375,14 @@ class SauceSharedMultipleDeviceTestCase(AbstractTestCase):
geth = {geth_names[i]: geth_contents[i] for i in range(len(geth_names))} geth = {geth_names[i]: geth_contents[i] for i in range(len(geth_names))}
test_suite_data.current_test.geth_paths = self.github_report.save_geth(geth) test_suite_data.current_test.geth_paths = self.github_report.save_geth(geth)
@pytest.fixture(scope='class', autouse=True)
def prepare(self, request):
try:
request.cls.prepare_devices(request)
finally:
for item, value in request.__dict__.items():
setattr(request.cls, item, value)
@classmethod @classmethod
def teardown_class(cls): def teardown_class(cls):
requests_session = requests.Session() requests_session = requests.Session()

View File

@ -217,6 +217,8 @@ def pytest_runtest_makereport(item, call):
outcome = yield outcome = yield
report = outcome.get_result() report = outcome.get_result()
is_sauce_env = item.config.getoption('env') == 'sauce'
def catch_error(): def catch_error():
error = report.longreprtext error = report.longreprtext
failure_pattern = 'E.*Message:|E.*Error:|E.*Failed:' failure_pattern = 'E.*Message:|E.*Error:|E.*Failed:'
@ -226,32 +228,36 @@ def pytest_runtest_makereport(item, call):
return error return error
if report.when == 'setup': if report.when == 'setup':
is_group = "xdist_group" in item.keywords._markers or "xdist_group" in item.parent.keywords._markers
error_intro, error = 'Test setup failed:', '' error_intro, error = 'Test setup failed:', ''
final_error = '%s %s' % (error_intro, error) final_error = '%s %s' % (error_intro, error)
if hasattr(report, 'wasxfail'): if hasattr(report, 'wasxfail'):
if '[NOTRUN]' in report.wasxfail: if '[NOTRUN]' in report.wasxfail:
test_suite_data.set_current_test(item.name, testrail_case_id=get_testrail_case_id(item)) test_suite_data.set_current_test(item.name, testrail_case_id=get_testrail_case_id(item))
test_suite_data.current_test.create_new_testrun() test_suite_data.current_test.create_new_testrun()
if "xdist_group" in item.keywords._markers: if is_group:
test_suite_data.current_test.group_name = item.instance.__class__.__name__ test_suite_data.current_test.group_name = item.instance.__class__.__name__
error_intro, error = 'Test is not run, e2e blocker ', report.wasxfail error_intro, error = 'Test is not run, e2e blocker ', report.wasxfail
final_error = "%s [[%s]]" % (error_intro, error) final_error = "%s [[%s]]" % (error_intro, error)
else: else:
if "xdist_group" in item.keywords._markers: if is_group:
test_suite_data.current_test.group_name = item.instance.__class__.__name__ test_suite_data.current_test.group_name = item.instance.__class__.__name__
error = catch_error() error = catch_error()
final_error = '%s %s [[%s]]' % (error_intro, error, report.wasxfail) final_error = '%s %s [[%s]]' % (error_intro, error, report.wasxfail)
else: else:
if "xdist_group" in item.keywords._markers and report.failed: if is_group and report.failed:
test_suite_data.current_test.group_name = item.instance.__class__.__name__ test_suite_data.current_test.group_name = item.instance.__class__.__name__
error = catch_error() error = catch_error()
final_error = '%s %s' % (error_intro, error) final_error = '%s %s' % (error_intro, error)
if is_sauce_env:
update_sauce_jobs(test_suite_data.current_test.group_name,
test_suite_data.current_test.testruns[-1].jobs,
report.passed)
if error: if error:
test_suite_data.current_test.testruns[-1].error = final_error test_suite_data.current_test.testruns[-1].error = final_error
github_report.save_test(test_suite_data.current_test) github_report.save_test(test_suite_data.current_test)
if report.when == 'call': if report.when == 'call':
is_sauce_env = item.config.getoption('env') == 'sauce'
current_test = test_suite_data.current_test current_test = test_suite_data.current_test
error = catch_error() error = catch_error()
if report.failed: if report.failed:

View File

@ -13,23 +13,23 @@ import pytest
@marks.critical @marks.critical
class TestCommandsMultipleDevicesMerged(MultipleSharedDeviceTestCase): class TestCommandsMultipleDevicesMerged(MultipleSharedDeviceTestCase):
@classmethod def prepare_devices(self):
def setup_class(cls): self.drivers, self.loop = create_shared_drivers(2)
cls.drivers, cls.loop = create_shared_drivers(2) self.device_1, self.device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
cls.device_1, cls.device_2 = SignInView(cls.drivers[0]), SignInView(cls.drivers[1]) self.sender = transaction_senders['ETH_STT_3']
cls.sender = transaction_senders['ETH_STT_3'] self.home_1 = self.device_1.recover_access(passphrase=self.sender['passphrase'], enable_notifications=True)
cls.home_1 = cls.device_1.recover_access(passphrase=cls.sender['passphrase'], enable_notifications=True) self.home_2 = self.device_2.create_user()
cls.home_2 = cls.device_2.create_user() for home in self.home_1, self.home_2:
for home in cls.home_1, cls.home_2:
profile = home.profile_button.click() profile = home.profile_button.click()
profile.profile_notifications_button.scroll_and_click() profile.profile_notifications_button.scroll_and_click()
profile.wallet_push_notifications.click() profile.wallet_push_notifications.click()
cls.recipient_public_key, cls.recipient_username = cls.home_2.get_public_key_and_username(return_username=True) self.recipient_public_key, self.recipient_username = self.home_2.get_public_key_and_username(
cls.wallet_1, cls.wallet_2 = cls.home_1.wallet_button.click(), cls.home_2.wallet_button.click() return_username=True)
[wallet.home_button.click() for wallet in (cls.wallet_1, cls.wallet_2)] self.wallet_1, self.wallet_2 = self.home_1.wallet_button.click(), self.home_2.wallet_button.click()
cls.chat_1 = cls.home_1.add_contact(cls.recipient_public_key) [wallet.home_button.click() for wallet in (self.wallet_1, self.wallet_2)]
cls.chat_1.send_message("hello!") self.chat_1 = self.home_1.add_contact(self.recipient_public_key)
cls.account_name_1 = cls.wallet_1.status_account_name self.chat_1.send_message("hello!")
self.account_name_1 = self.wallet_1.status_account_name
@marks.testrail_id(6253) @marks.testrail_id(6253)
def test_1_1_chat_command_send_tx_eth_outgoing_tx_push(self): def test_1_1_chat_command_send_tx_eth_outgoing_tx_push(self):
@ -212,20 +212,19 @@ class TestCommandsMultipleDevicesMerged(MultipleSharedDeviceTestCase):
@marks.critical @marks.critical
class TestOneToOneChatMultipleSharedDevices(MultipleSharedDeviceTestCase): class TestOneToOneChatMultipleSharedDevices(MultipleSharedDeviceTestCase):
@classmethod def prepare_devices(self):
def setup_class(cls): self.drivers, self.loop = create_shared_drivers(2)
cls.drivers, cls.loop = create_shared_drivers(2) self.device_1, self.device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
cls.device_1, cls.device_2 = SignInView(cls.drivers[0]), SignInView(cls.drivers[1]) self.home_1 = self.device_1.create_user(enable_notifications=True)
cls.home_1 = cls.device_1.create_user(enable_notifications=True) self.home_2 = self.device_2.create_user(enable_notifications=True)
cls.home_2 = cls.device_2.create_user(enable_notifications=True) self.profile_1 = self.home_1.profile_button.click()
cls.profile_1 = cls.home_1.profile_button.click() self.default_username_1 = self.profile_1.default_username_text.text
cls.default_username_1 = cls.profile_1.default_username_text.text self.profile_1.home_button.click()
cls.profile_1.home_button.click() self.public_key_2, self.default_username_2 = self.home_2.get_public_key_and_username(return_username=True)
cls.public_key_2, cls.default_username_2 = cls.home_2.get_public_key_and_username(return_username=True) self.chat_1 = self.home_1.add_contact(self.public_key_2)
cls.chat_1 = cls.home_1.add_contact(cls.public_key_2) self.chat_1.send_message('hey')
cls.chat_1.send_message('hey') self.home_2.home_button.double_click()
cls.home_2.home_button.double_click() self.chat_2 = self.home_2.get_chat(self.default_username_1).click()
cls.chat_2 = cls.home_2.get_chat(cls.default_username_1).click()
@marks.testrail_id(6315) @marks.testrail_id(6315)
def test_1_1_chat_message_reaction(self): def test_1_1_chat_message_reaction(self):
@ -621,33 +620,32 @@ class TestOneToOneChatMultipleSharedDevices(MultipleSharedDeviceTestCase):
@marks.critical @marks.critical
class TestContactBlockMigrateKeycardMultipleSharedDevices(MultipleSharedDeviceTestCase): class TestContactBlockMigrateKeycardMultipleSharedDevices(MultipleSharedDeviceTestCase):
@classmethod def prepare_devices(self):
def setup_class(cls): self.drivers, self.loop = create_shared_drivers(2)
cls.drivers, cls.loop = create_shared_drivers(2) self.device_1, self.device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
cls.device_1, cls.device_2 = SignInView(cls.drivers[0]), SignInView(cls.drivers[1]) self.sender = transaction_senders['ETH_2']
cls.sender = transaction_senders['ETH_2'] self.nick = "FFOO_brak!1234"
cls.nick = "FFOO_brak!1234" self.message = self.device_1.get_random_message()
cls.message = cls.device_1.get_random_message() self.pub_chat_name = self.device_1.get_random_chat_name()
cls.pub_chat_name = cls.device_1.get_random_chat_name() self.home_1 = self.device_1.recover_access(self.sender['passphrase'], keycard=True)
cls.home_1 = cls.device_1.recover_access(cls.sender['passphrase'], keycard=True) self.home_2 = self.device_2.create_user()
cls.home_2 = cls.device_2.create_user() self.profile_2 = self.home_2.profile_button.click()
cls.profile_2 = cls.home_2.profile_button.click() self.profile_2.privacy_and_security_button.click()
cls.profile_2.privacy_and_security_button.click() self.profile_2.backup_recovery_phrase_button.click()
cls.profile_2.backup_recovery_phrase_button.click() recovery_phrase = self.profile_2.backup_recovery_phrase()
recovery_phrase = cls.profile_2.backup_recovery_phrase() self.recovery_phrase = ' '.join(recovery_phrase.values())
cls.recovery_phrase = ' '.join(recovery_phrase.values()) self.public_key_2, self.default_username_2 = self.home_2.get_public_key_and_username(return_username=True)
cls.public_key_2, cls.default_username_2 = cls.home_2.get_public_key_and_username(return_username=True) self.chat_1 = self.home_1.add_contact(self.public_key_2, add_in_contacts=False)
cls.chat_1 = cls.home_1.add_contact(cls.public_key_2, add_in_contacts=False) self.chat_1.chat_options.click()
cls.chat_1.chat_options.click() self.chat_1.view_profile_button.click()
cls.chat_1.view_profile_button.click() self.chat_1.set_nickname(self.nick)
cls.chat_1.set_nickname(cls.nick) [home.home_button.click() for home in [self.home_1, self.home_2]]
[home.home_button.click() for home in [cls.home_1, cls.home_2]] self.home_2.add_contact(self.sender['public_key'])
cls.home_2.add_contact(cls.sender['public_key']) self.home_2.home_button.click()
cls.home_2.home_button.click() [home.join_public_chat(self.pub_chat_name) for home in [self.home_1, self.home_2]]
[home.join_public_chat(cls.pub_chat_name) for home in [cls.home_1, cls.home_2]] self.chat_2 = self.home_2.get_chat_view()
cls.chat_2 = cls.home_2.get_chat_view() self.chat_2.send_message(self.message)
cls.chat_2.send_message(cls.message) [home.home_button.click() for home in [self.home_1, self.home_2]]
[home.home_button.click() for home in [cls.home_1, cls.home_2]]
@marks.testrail_id(702186) @marks.testrail_id(702186)
def test_keycard_command_send_tx_eth_1_1_chat(self): def test_keycard_command_send_tx_eth_1_1_chat(self):
@ -963,26 +961,25 @@ class TestContactBlockMigrateKeycardMultipleSharedDevices(MultipleSharedDeviceTe
@marks.critical @marks.critical
class TestEnsStickersMultipleDevicesMerged(MultipleSharedDeviceTestCase): class TestEnsStickersMultipleDevicesMerged(MultipleSharedDeviceTestCase):
@classmethod def prepare_devices(self):
def setup_class(cls): self.drivers, self.loop = create_shared_drivers(2)
cls.drivers, cls.loop = create_shared_drivers(2) self.device_1, self.device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
cls.device_1, cls.device_2 = SignInView(cls.drivers[0]), SignInView(cls.drivers[1]) self.sender, self.reciever = transaction_senders['ETH_3'], ens_user
cls.sender, cls.reciever = transaction_senders['ETH_3'], ens_user self.home_1 = self.device_1.recover_access(passphrase=self.sender['passphrase'])
cls.home_1 = cls.device_1.recover_access(passphrase=cls.sender['passphrase']) self.home_2 = self.device_2.recover_access(ens_user['passphrase'], enable_notifications=True)
cls.home_2 = cls.device_2.recover_access(ens_user['passphrase'], enable_notifications=True) self.ens = '@%s' % self.reciever['ens']
cls.ens = '@%s' % cls.reciever['ens'] self.pub_chat_name = self.home_1.get_random_chat_name()
cls.pub_chat_name = cls.home_1.get_random_chat_name() self.chat_1 = self.home_1.join_public_chat(self.pub_chat_name)
cls.chat_1 = cls.home_1.join_public_chat(cls.pub_chat_name) self.chat_2 = self.home_2.join_public_chat(self.pub_chat_name)
cls.chat_2 = cls.home_2.join_public_chat(cls.pub_chat_name) [home.home_button.double_click() for home in (self.home_1, self.home_2)]
[home.home_button.double_click() for home in (cls.home_1, cls.home_2)] self.profile_2 = self.home_2.profile_button.click()
cls.profile_2 = cls.home_2.profile_button.click() self.profile_2.connect_existing_ens(self.reciever['ens'])
cls.profile_2.connect_existing_ens(cls.reciever['ens']) self.home_1.add_contact(self.reciever['ens'])
cls.home_1.add_contact(cls.reciever['ens']) self.home_2.home_button.click()
cls.home_2.home_button.click() self.home_2.add_contact(self.sender['public_key'])
cls.home_2.add_contact(cls.sender['public_key'])
# To avoid activity centre for restored users # To avoid activity centre for restored users
[chat.send_message("hey!") for chat in (cls.chat_1, cls.chat_2)] [chat.send_message("hey!") for chat in (self.chat_1, self.chat_2)]
[home.home_button.double_click() for home in (cls.home_1, cls.home_2)] [home.home_button.double_click() for home in (self.home_1, self.home_2)]
@marks.testrail_id(702152) @marks.testrail_id(702152)
def test_ens_purchased_in_profile(self): def test_ens_purchased_in_profile(self):
@ -1105,14 +1102,16 @@ class TestEnsStickersMultipleDevicesMerged(MultipleSharedDeviceTestCase):
'ENS username is not resolved in chat input after selecting it in mention suggestions list!') 'ENS username is not resolved in chat input after selecting it in mention suggestions list!')
self.chat_1.send_message_button.click() self.chat_1.send_message_button.click()
self.home_2.just_fyi('check that PN is received and after tap you are redirected to chat, mention is highligted') self.home_2.just_fyi(
'check that PN is received and after tap you are redirected to chat, mention is highligted')
pn = self.home_2.get_pn(self.reciever['username']) pn = self.home_2.get_pn(self.reciever['username'])
if pn: if pn:
pn.click() pn.click()
else: else:
self.errors.append('No PN on mention in public chat! ') self.errors.append('No PN on mention in public chat! ')
self.home_2.click_system_back_button(2) self.home_2.click_system_back_button(2)
if self.home_2.element_starts_with_text(self.reciever['ens']).is_element_differs_from_template('ment_new.png', 2): if self.home_2.element_starts_with_text(self.reciever['ens']).is_element_differs_from_template('ment_new.png',
2):
self.errors.append('Mention is not highlighted!') self.errors.append('Mention is not highlighted!')
self.errors.verify_no_errors() self.errors.verify_no_errors()

View File

@ -9,37 +9,36 @@ from views.chat_view import ChatView
@marks.critical @marks.critical
class TestGroupChatMultipleDeviceMerged(MultipleSharedDeviceTestCase): class TestGroupChatMultipleDeviceMerged(MultipleSharedDeviceTestCase):
@classmethod def prepare_devices(self):
def setup_class(cls): self.drivers, self.loop = create_shared_drivers(3)
cls.drivers, cls.loop = create_shared_drivers(3) self.message_before_adding = 'message before adding new user'
cls.message_before_adding = 'message before adding new user' self.message_to_admin = 'Hey, admin!'
cls.message_to_admin = 'Hey, admin!'
cls.homes, cls.public_keys, cls.usernames, cls.chats = {}, {}, {}, {} self.homes, self.public_keys, self.usernames, self.chats = {}, {}, {}, {}
for key in cls.drivers: for key in self.drivers:
sign_in = SignInView(cls.drivers[key]) sign_in = SignInView(self.drivers[key])
cls.homes[key] = sign_in.create_user(enable_notifications=True) self.homes[key] = sign_in.create_user(enable_notifications=True)
SignInView(cls.drivers[2]).put_app_to_background_and_back() SignInView(self.drivers[2]).put_app_to_background_and_back()
cls.public_keys[key], cls.usernames[key] = sign_in.get_public_key_and_username(True) self.public_keys[key], self.usernames[key] = sign_in.get_public_key_and_username(True)
sign_in.home_button.click() sign_in.home_button.click()
SignInView(cls.drivers[0]).put_app_to_background_and_back() SignInView(self.drivers[0]).put_app_to_background_and_back()
cls.chat_name = cls.homes[0].get_random_chat_name() self.chat_name = self.homes[0].get_random_chat_name()
cls.homes[0].just_fyi('Admin adds future members to contacts') self.homes[0].just_fyi('Admin adds future members to contacts')
for i in range(1, 3): for i in range(1, 3):
cls.homes[0].add_contact(cls.public_keys[i]) self.homes[0].add_contact(self.public_keys[i])
cls.homes[0].home_button.double_click() self.homes[0].home_button.double_click()
cls.homes[0].just_fyi('Member adds admin to contacts to see PNs and put app in background') self.homes[0].just_fyi('Member adds admin to contacts to see PNs and put app in background')
cls.homes[1].add_contact(cls.public_keys[0]) self.homes[1].add_contact(self.public_keys[0])
cls.homes[1].home_button.double_click() self.homes[1].home_button.double_click()
cls.homes[0].just_fyi('Admin creates group chat') self.homes[0].just_fyi('Admin creates group chat')
cls.chats[0] = cls.homes[0].create_group_chat([cls.usernames[1]], cls.chat_name) self.chats[0] = self.homes[0].create_group_chat([self.usernames[1]], self.chat_name)
for i in range(1, 3): for i in range(1, 3):
cls.chats[i] = ChatView(cls.drivers[i]) self.chats[i] = ChatView(self.drivers[i])
cls.chats[0].send_message(cls.message_before_adding) self.chats[0].send_message(self.message_before_adding)
@marks.testrail_id(3994) @marks.testrail_id(3994)
def test_group_chat_push_system_messages_when_invited(self): def test_group_chat_push_system_messages_when_invited(self):

View File

@ -12,17 +12,16 @@ from tests.users import basic_user, transaction_senders
@marks.critical @marks.critical
class TestOnboardingOneDeviceMerged(MultipleSharedDeviceTestCase): class TestOnboardingOneDeviceMerged(MultipleSharedDeviceTestCase):
@classmethod def prepare_devices(self):
def setup_class(cls): self.drivers, self.loop = create_shared_drivers(1)
cls.drivers, cls.loop = create_shared_drivers(1) self.sign_in = SignInView(self.drivers[0])
cls.sign_in = SignInView(cls.drivers[0]) self.password = basic_user['special_chars_password']
cls.password = basic_user['special_chars_password']
cls.home = cls.sign_in.create_user(password=cls.password) self.home = self.sign_in.create_user(password=self.password)
cls.public_chat_name = cls.home.get_random_chat_name() self.public_chat_name = self.home.get_random_chat_name()
cls.chat = cls.home.join_public_chat(cls.public_chat_name) self.chat = self.home.join_public_chat(self.public_chat_name)
cls.profile = cls.home.profile_button.click() self.profile = self.home.profile_button.click()
cls.username = cls.profile.default_username_text.text self.username = self.profile.default_username_text.text
@marks.testrail_id(700742) @marks.testrail_id(700742)
def test_onboarding_home_initial_popup(self): def test_onboarding_home_initial_popup(self):
@ -195,7 +194,8 @@ class TestOnboardingOneDeviceMerged(MultipleSharedDeviceTestCase):
self.sign_in.just_fyi('Checking case when %s' % cases[1]) self.sign_in.just_fyi('Checking case when %s' % cases[1])
self.sign_in.create_password_input.send_keys('123456') self.sign_in.create_password_input.send_keys('123456')
[field.send_keys('123456') for field in (self.sign_in.create_password_input, self.sign_in.confirm_your_password_input)] [field.send_keys('123456') for field in
(self.sign_in.create_password_input, self.sign_in.confirm_your_password_input)]
self.sign_in.confirm_your_password_input.delete_last_symbols(1) self.sign_in.confirm_your_password_input.delete_last_symbols(1)
self.sign_in.create_password_input.delete_last_symbols(1) self.sign_in.create_password_input.delete_last_symbols(1)
self.sign_in.next_button.click() self.sign_in.next_button.click()
@ -226,15 +226,15 @@ class TestOnboardingOneDeviceMerged(MultipleSharedDeviceTestCase):
@pytest.mark.xdist_group(name="two_1") @pytest.mark.xdist_group(name="two_1")
@marks.critical @marks.critical
class TestRestoreOneDeviceMerged(MultipleSharedDeviceTestCase): class TestRestoreOneDeviceMerged(MultipleSharedDeviceTestCase):
@classmethod
def setup_class(cls):
cls.user = transaction_senders['ETH_ADI_STT_2']
cls.drivers, cls.loop = create_shared_drivers(1)
cls.sign_in = SignInView(cls.drivers[0])
cls.passphrase = fill_string_with_char(cls.user['passphrase'].upper(), ' ', 3, True, True)
cls.password = basic_user['special_chars_password']
cls.home = cls.sign_in.recover_access(passphrase=cls.passphrase, password=cls.password) def prepare_devices(self):
self.user = transaction_senders['ETH_ADI_STT_2']
self.drivers, self.loop = create_shared_drivers(1)
self.sign_in = SignInView(self.drivers[0])
self.passphrase = fill_string_with_char(self.user['passphrase'].upper(), ' ', 3, True, True)
self.password = basic_user['special_chars_password']
self.home = self.sign_in.recover_access(passphrase=self.passphrase, password=self.password)
@marks.testrail_id(700748) @marks.testrail_id(700748)
def test_restore_uppercase_whitespaces_seed_phrase_special_char_passw_logcat(self): def test_restore_uppercase_whitespaces_seed_phrase_special_char_passw_logcat(self):

View File

@ -11,27 +11,26 @@ from views.sign_in_view import SignInView
@marks.skip @marks.skip
class TestPairingMultipleDevicesMerged(MultipleSharedDeviceTestCase): class TestPairingMultipleDevicesMerged(MultipleSharedDeviceTestCase):
@classmethod def prepare_devices(self):
def setup_class(cls):
from views.dbs.main_pairing.data import seed_phrase, password from views.dbs.main_pairing.data import seed_phrase, password
cls.drivers, cls.loop = create_shared_drivers(2) self.drivers, self.loop = create_shared_drivers(2)
cls.device_1, cls.device_2 = SignInView(cls.drivers[0]), SignInView(cls.drivers[1]) self.device_1, self.device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
cls.home_1 = cls.device_1.import_db(seed_phrase=seed_phrase, import_db_folder_name='main_pairing', self.home_1 = self.device_1.import_db(seed_phrase=seed_phrase, import_db_folder_name='main_pairing',
password=password) password=password)
cls.home_2 = cls.device_2.recover_access(seed_phrase) self.home_2 = self.device_2.recover_access(seed_phrase)
cls.home_1.just_fyi('Pair main and secondary devices') self.home_1.just_fyi('Pair main and secondary devices')
[cls.profile_1, cls.profile_2] = [home.profile_button.click() for home in (cls.home_1, cls.home_2)] [self.profile_1, self.profile_2] = [home.profile_button.click() for home in (self.home_1, self.home_2)]
name_1, name_2 = 'device_1', 'a_%s_2' % cls.device_2.get_unique_amount() name_1, name_2 = 'device_1', 'a_%s_2' % self.device_2.get_unique_amount()
cls.profile_2.discover_and_advertise_device(name_2) self.profile_2.discover_and_advertise_device(name_2)
cls.profile_1.sync_settings_button.scroll_and_click() self.profile_1.sync_settings_button.scroll_and_click()
cls.profile_1.devices_button.scroll_to_element() self.profile_1.devices_button.scroll_to_element()
cls.profile_1.devices_button.click() self.profile_1.devices_button.click()
cls.home_1.element_by_text_part(name_2).scroll_and_click() self.home_1.element_by_text_part(name_2).scroll_and_click()
cls.profile_1.sync_all_button.click() self.profile_1.sync_all_button.click()
cls.profile_1.sync_all_button.wait_for_visibility_of_element(20) self.profile_1.sync_all_button.wait_for_visibility_of_element(20)
[profile.get_back_to_home_view() for profile in [cls.profile_1, cls.profile_2]] [profile.get_back_to_home_view() for profile in [self.profile_1, self.profile_2]]
[home.home_button.click() for home in [cls.home_1, cls.home_2]] [home.home_button.click() for home in [self.home_1, self.home_2]]
def test_pairing_initial_sync_chats(self): def test_pairing_initial_sync_chats(self):
self.profile_2.just_fyi("Check chats and previews") self.profile_2.just_fyi("Check chats and previews")
@ -92,62 +91,61 @@ class TestPairingMultipleDevicesMerged(MultipleSharedDeviceTestCase):
@marks.critical @marks.critical
class TestPairingSyncMultipleDevicesMerged(MultipleSharedDeviceTestCase): class TestPairingSyncMultipleDevicesMerged(MultipleSharedDeviceTestCase):
@classmethod def prepare_devices(self):
def setup_class(cls): self.drivers, self.loop = create_shared_drivers(2)
cls.drivers, cls.loop = create_shared_drivers(2) self.no_contact_nickname = 'no_contact_nickname'
cls.no_contact_nickname = 'no_contact_nickname' self.device_1, self.device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
cls.device_1, cls.device_2 = SignInView(cls.drivers[0]), SignInView(cls.drivers[1]) self.home_1 = self.device_1.create_user()
cls.home_1 = cls.device_1.create_user()
cls.name_1, cls.name_2 = 'device_%s' % cls.drivers[0].number, 'device_%s' % cls.drivers[1].number self.name_1, self.name_2 = 'device_%s' % self.drivers[0].number, 'device_%s' % self.drivers[1].number
cls.message_before_sync, cls.message_after_sync = 'sent before sync', 'sent after sync' self.message_before_sync, self.message_after_sync = 'sent before sync', 'sent after sync'
cls.contact_before_sync = basic_user self.contact_before_sync = basic_user
cls.public_chat_before_sync, cls.public_chat_after_sync = cls.home_1.get_random_chat_name(), 'after-pairing' self.public_chat_before_sync, self.public_chat_after_sync = self.home_1.get_random_chat_name(), 'after-pairing'
cls.home_1.just_fyi("(main device): get recovery phrase") self.home_1.just_fyi("(main device): get recovery phrase")
cls.profile_1 = cls.home_1.profile_button.click() self.profile_1 = self.home_1.profile_button.click()
cls.profile_1.privacy_and_security_button.click() self.profile_1.privacy_and_security_button.click()
cls.profile_1.backup_recovery_phrase_button.click() self.profile_1.backup_recovery_phrase_button.click()
cls.profile_1.ok_continue_button.click() self.profile_1.ok_continue_button.click()
cls.recovery_phrase = cls.profile_1.get_recovery_phrase() self.recovery_phrase = self.profile_1.get_recovery_phrase()
cls.profile_1.close_button.click() self.profile_1.close_button.click()
cls.profile_1.home_button.click() self.profile_1.home_button.click()
cls.profile_1.get_recovery_phrase() self.profile_1.get_recovery_phrase()
cls.device_2.put_app_to_background_and_back() self.device_2.put_app_to_background_and_back()
cls.home_1.just_fyi('Add contact, 1-1 chat (main device): 3-random, contact with ENS, start 1-1') self.home_1.just_fyi('Add contact, 1-1 chat (main device): 3-random, contact with ENS, start 1-1')
cls.chat_1 = cls.home_1.add_contact(cls.contact_before_sync['public_key']) self.chat_1 = self.home_1.add_contact(self.contact_before_sync['public_key'])
cls.chat_1.send_message(cls.message_before_sync) self.chat_1.send_message(self.message_before_sync)
cls.chat_1.home_button.click() self.chat_1.home_button.click()
cls.home_1.add_contact(ens_user['ens']) self.home_1.add_contact(ens_user['ens'])
cls.chat_1.home_button.click() self.chat_1.home_button.click()
cls.home_1.just_fyi('Chats, contacts (main device): join public chat, block user, set nickname') self.home_1.just_fyi('Chats, contacts (main device): join public chat, block user, set nickname')
public_chat_1 = cls.home_1.join_public_chat(cls.public_chat_before_sync) public_chat_1 = self.home_1.join_public_chat(self.public_chat_before_sync)
public_chat_1.home_button.click() public_chat_1.home_button.click()
cls.home_1.add_contact(transaction_senders['A']['public_key'], add_in_contacts=False, self.home_1.add_contact(transaction_senders['A']['public_key'], add_in_contacts=False,
nickname=cls.no_contact_nickname) nickname=self.no_contact_nickname)
cls.chat_1.open_user_profile_from_1_1_chat() self.chat_1.open_user_profile_from_1_1_chat()
cls.chat_1.block_contact() self.chat_1.block_contact()
cls.device_2.just_fyi("(secondary device): restore same multiaccount on another device") self.device_2.just_fyi("(secondary device): restore same multiaccount on another device")
cls.home_2 = cls.device_2.recover_access(passphrase=' '.join(cls.recovery_phrase.values())) self.home_2 = self.device_2.recover_access(passphrase=' '.join(self.recovery_phrase.values()))
cls.profile_1, cls.profile_2 = cls.home_1.profile_button.click(), cls.home_2.profile_button.click() self.profile_1, self.profile_2 = self.home_1.profile_button.click(), self.home_2.profile_button.click()
cls.device_2.just_fyi('Nicknames (main device): set nickname for contact') self.device_2.just_fyi('Nicknames (main device): set nickname for contact')
cls.profile_1.profile_button.click() self.profile_1.profile_button.click()
cls.profile_1.open_contact_from_profile(cls.contact_before_sync['username']) self.profile_1.open_contact_from_profile(self.contact_before_sync['username'])
cls.nickname = 'my_basic_user' self.nickname = 'my_basic_user'
cls.chat_1.set_nickname(cls.nickname) self.chat_1.set_nickname(self.nickname)
cls.device_1.get_back_to_home_view() self.device_1.get_back_to_home_view()
cls.device_2.just_fyi('Pair main and secondary devices') self.device_2.just_fyi('Pair main and secondary devices')
cls.profile_2.discover_and_advertise_device(cls.name_2) self.profile_2.discover_and_advertise_device(self.name_2)
cls.profile_1.discover_and_advertise_device(cls.name_1) self.profile_1.discover_and_advertise_device(self.name_1)
cls.profile_1.get_toggle_device_by_name(cls.name_2).wait_and_click() self.profile_1.get_toggle_device_by_name(self.name_2).wait_and_click()
cls.profile_1.sync_all_button.click() self.profile_1.sync_all_button.click()
cls.profile_1.sync_all_button.wait_for_visibility_of_element(20) self.profile_1.sync_all_button.wait_for_visibility_of_element(20)
[device.profile_button.double_click() for device in (cls.profile_1, cls.profile_2)] [device.profile_button.double_click() for device in (self.profile_1, self.profile_2)]
@marks.testrail_id(702194) @marks.testrail_id(702194)
def test_pairing_sync_initial_contacts_blocked_users(self): def test_pairing_sync_initial_contacts_blocked_users(self):

View File

@ -15,22 +15,21 @@ from selenium.common.exceptions import NoSuchElementException
@marks.critical @marks.critical
class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase): class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase):
@classmethod def prepare_devices(self):
def setup_class(cls): self.drivers, self.loop = create_shared_drivers(2)
cls.drivers, cls.loop = create_shared_drivers(2) device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
device_1, device_2 = SignInView(cls.drivers[0]), SignInView(cls.drivers[1]) self.home_1, self.home_2 = device_1.create_user(), device_2.create_user()
cls.home_1, cls.home_2 = device_1.create_user(), device_2.create_user() profile_1 = self.home_1.profile_button.click()
profile_1 = cls.home_1.profile_button.click() self.username_1 = profile_1.default_username_text.text
cls.username_1 = profile_1.default_username_text.text
profile_1.home_button.click() profile_1.home_button.click()
cls.pub_chat_delete_long_press = 'pub-chat' self.pub_chat_delete_long_press = 'pub-chat'
cls.text_message = 'hello' self.text_message = 'hello'
cls.home_1.join_public_chat(cls.pub_chat_delete_long_press) self.home_1.join_public_chat(self.pub_chat_delete_long_press)
[home.home_button.click() for home in (cls.home_1, cls.home_2)] [home.home_button.click() for home in (self.home_1, self.home_2)]
cls.public_chat_name = cls.home_1.get_random_chat_name() self.public_chat_name = self.home_1.get_random_chat_name()
cls.chat_1 = cls.home_1.join_public_chat(cls.public_chat_name) self.chat_1 = self.home_1.join_public_chat(self.public_chat_name)
cls.chat_2 = cls.home_2.join_public_chat(cls.public_chat_name) self.chat_2 = self.home_2.join_public_chat(self.public_chat_name)
cls.chat_1.send_message(cls.text_message) self.chat_1.send_message(self.text_message)
@marks.testrail_id(5313) @marks.testrail_id(5313)
def test_public_chat_message_send_check_timestamps_while_on_different_tab(self): def test_public_chat_message_send_check_timestamps_while_on_different_tab(self):
@ -229,14 +228,13 @@ class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase):
@marks.critical @marks.critical
class TestPublicChatBrowserOneDeviceMerged(MultipleSharedDeviceTestCase): class TestPublicChatBrowserOneDeviceMerged(MultipleSharedDeviceTestCase):
@classmethod def prepare_devices(self):
def setup_class(cls): self.drivers, self.loop = create_shared_drivers(1)
cls.drivers, cls.loop = create_shared_drivers(1) self.sign_in = SignInView(self.drivers[0])
cls.sign_in = SignInView(cls.drivers[0])
cls.home = cls.sign_in.create_user() self.home = self.sign_in.create_user()
cls.public_chat_name = cls.home.get_random_chat_name() self.public_chat_name = self.home.get_random_chat_name()
cls.chat = cls.home.join_public_chat(cls.public_chat_name) self.chat = self.home.join_public_chat(self.public_chat_name)
@marks.testrail_id(5675) @marks.testrail_id(5675)
def test_public_chat_fetch_more_history(self): def test_public_chat_fetch_more_history(self):

View File

@ -12,22 +12,23 @@ from views.sign_in_view import SignInView
@pytest.mark.xdist_group(name="one_1") @pytest.mark.xdist_group(name="one_1")
@marks.critical @marks.critical
class TestSendTxDeviceMerged(MultipleSharedDeviceTestCase): class TestSendTxDeviceMerged(MultipleSharedDeviceTestCase):
@classmethod
def setup_class(cls): def prepare_devices(self):
cls.user = transaction_senders['ETH_STT_4'] self.user = transaction_senders['ETH_STT_4']
cls.recipient_address = '0x%s' % transaction_senders['ETH_ADI_STT_3']['address'] self.recipient_address = '0x%s' % transaction_senders['ETH_ADI_STT_3']['address']
cls.drivers, cls.loop = create_shared_drivers(1) self.drivers, self.loop = create_shared_drivers(1)
[cls.amount_adi, cls.amount_eth, cls.amount_stt] = ['0.000%s' % str(random.randint(100, 999)) + '1' for _ in range(3)] [self.amount_adi, self.amount_eth, self.amount_stt] = ['0.000%s' % str(random.randint(100, 999)) + '1' for _ in
cls.sign_in = SignInView(cls.drivers[0]) range(3)]
cls.home = cls.sign_in.recover_access(cls.user['passphrase']) self.sign_in = SignInView(self.drivers[0])
cls.wallet = cls.home.wallet_button.click() self.home = self.sign_in.recover_access(self.user['passphrase'])
cls.assets = ('ETH', 'ADI', 'STT') self.wallet = self.home.wallet_button.click()
[cls.wallet.wait_balance_is_changed(asset) for asset in cls.assets] self.assets = ('ETH', 'ADI', 'STT')
cls.initial_balances = dict() [self.wallet.wait_balance_is_changed(asset) for asset in self.assets]
for asset in cls.assets: self.initial_balances = dict()
cls.initial_balances[asset] = cls.wallet.get_asset_amount_by_name(asset) for asset in self.assets:
cls.wallet.send_transaction(amount=cls.amount_eth, recipient=cls.recipient_address) self.initial_balances[asset] = self.wallet.get_asset_amount_by_name(asset)
cls.wallet.send_transaction(amount=cls.amount_adi, recipient=cls.recipient_address, asset_name='ADI') self.wallet.send_transaction(amount=self.amount_eth, recipient=self.recipient_address)
self.wallet.send_transaction(amount=self.amount_adi, recipient=self.recipient_address, asset_name='ADI')
@marks.testrail_id(700763) @marks.testrail_id(700763)
def test_send_tx_eth_check_logcat(self): def test_send_tx_eth_check_logcat(self):
@ -267,20 +268,20 @@ class TestSendTxDeviceMerged(MultipleSharedDeviceTestCase):
@pytest.mark.xdist_group(name="two_1") @pytest.mark.xdist_group(name="two_1")
@marks.critical @marks.critical
class TestKeycardTxOneDeviceMerged(MultipleSharedDeviceTestCase): class TestKeycardTxOneDeviceMerged(MultipleSharedDeviceTestCase):
@classmethod
def setup_class(cls):
cls.user = transaction_senders['ETH_STT_ADI_1']
cls.address = '0x%s' % transaction_senders['ETH_7']['address']
cls.drivers, cls.loop = create_shared_drivers(1)
cls.sign_in = SignInView(cls.drivers[0])
cls.home = cls.sign_in.recover_access(passphrase=cls.user['passphrase'], keycard=True) def prepare_devices(self):
cls.wallet = cls.home.wallet_button.click() self.user = transaction_senders['ETH_STT_ADI_1']
cls.assets = ('ETH', 'ADI', 'STT') self.address = '0x%s' % transaction_senders['ETH_7']['address']
[cls.wallet.wait_balance_is_changed(asset) for asset in cls.assets] self.drivers, self.loop = create_shared_drivers(1)
cls.initial_balances = dict() self.sign_in = SignInView(self.drivers[0])
for asset in cls.assets:
cls.initial_balances[asset] = cls.wallet.get_asset_amount_by_name(asset) self.home = self.sign_in.recover_access(passphrase=self.user['passphrase'], keycard=True)
self.wallet = self.home.wallet_button.click()
self.assets = ('ETH', 'ADI', 'STT')
[self.wallet.wait_balance_is_changed(asset) for asset in self.assets]
self.initial_balances = dict()
for asset in self.assets:
self.initial_balances[asset] = self.wallet.get_asset_amount_by_name(asset)
@marks.testrail_id(700767) @marks.testrail_id(700767)
def test_keycard_send_tx_eth(self): def test_keycard_send_tx_eth(self):
@ -417,7 +418,8 @@ class TestKeycardTxOneDeviceMerged(MultipleSharedDeviceTestCase):
self.sign_in.accept_tos_checkbox.enable() self.sign_in.accept_tos_checkbox.enable()
self.sign_in.get_started_button.click() self.sign_in.get_started_button.click()
self.sign_in.generate_key_button.click_until_presence_of_element(self.sign_in.next_button) self.sign_in.generate_key_button.click_until_presence_of_element(self.sign_in.next_button)
self.sign_in.next_button.click_until_absense_of_element(self.sign_in.element_by_translation_id("intro-wizard-title2")) self.sign_in.next_button.click_until_absense_of_element(
self.sign_in.element_by_translation_id("intro-wizard-title2"))
keycard_flow = self.sign_in.keycard_storage_button.click() keycard_flow = self.sign_in.keycard_storage_button.click()
keycard_flow.confirm_pin_and_proceed() keycard_flow.confirm_pin_and_proceed()
seed_phrase = keycard_flow.backup_seed_phrase() seed_phrase = keycard_flow.backup_seed_phrase()

View File

@ -13,19 +13,18 @@ from support.utilities import get_merged_txs_list
@marks.critical @marks.critical
class TestWalletManagementDeviceMerged(MultipleSharedDeviceTestCase): class TestWalletManagementDeviceMerged(MultipleSharedDeviceTestCase):
@classmethod def prepare_devices(self):
def setup_class(cls): self.user = wallet_users['D']
cls.user = wallet_users['D'] self.account_seed_collectibles = 'acc_collectibles'
cls.account_seed_collectibles = 'acc_collectibles' self.drivers, self.loop = create_shared_drivers(1)
cls.drivers, cls.loop = create_shared_drivers(1) self.sign_in = SignInView(self.drivers[0])
cls.sign_in = SignInView(cls.drivers[0]) self.sign_in.switch_to_mobile(before_login=True)
cls.sign_in.switch_to_mobile(before_login=True) self.home = self.sign_in.recover_access(self.user['passphrase'])
cls.home = cls.sign_in.recover_access(cls.user['passphrase']) self.wallet = self.home.wallet_button.click()
cls.wallet = cls.home.wallet_button.click() [self.wallet.wait_balance_is_changed(asset) for asset in ('ETH', 'MDS', 'STT')]
[cls.wallet.wait_balance_is_changed(asset) for asset in ('ETH', 'MDS', 'STT')] self.initial_balances = {'ETH': self.wallet.get_asset_amount_by_name('ETH'),
cls.initial_balances = {'ETH': cls.wallet.get_asset_amount_by_name('ETH'),
'ADI': 0, 'ADI': 0,
'STT': cls.wallet.get_asset_amount_by_name('STT')} 'STT': self.wallet.get_asset_amount_by_name('STT')}
@marks.testrail_id(700756) @marks.testrail_id(700756)
def test_wallet_tx_history_copy_tx_hash_on_cellular(self): def test_wallet_tx_history_copy_tx_hash_on_cellular(self):
@ -246,7 +245,8 @@ class TestWalletManagementDeviceMerged(MultipleSharedDeviceTestCase):
self.wallet.accounts_status_account.swipe_left_on_element() self.wallet.accounts_status_account.swipe_left_on_element()
if not self.wallet.get_account_by_name(account_name_private).is_element_displayed(): if not self.wallet.get_account_by_name(account_name_private).is_element_displayed():
self.errors.append("Unhidden %s is shown on main wallet view after hiding via 'Show icon'" % account_name_private) self.errors.append(
"Unhidden %s is shown on main wallet view after hiding via 'Show icon'" % account_name_private)
for asset in self.initial_balances: for asset in self.initial_balances:
self.wallet.wait_balance_is_changed(asset=asset, initial_balance=self.initial_balances[asset]) self.wallet.wait_balance_is_changed(asset=asset, initial_balance=self.initial_balances[asset])

View File

@ -9,19 +9,18 @@ from views.sign_in_view import SignInView
@marks.medium @marks.medium
class TestActivityCenterMultipleDeviceMedium(MultipleSharedDeviceTestCase): class TestActivityCenterMultipleDeviceMedium(MultipleSharedDeviceTestCase):
@classmethod def prepare_devices(self):
def setup_class(cls): self.drivers, self.loop = create_shared_drivers(2)
cls.drivers, cls.loop = create_shared_drivers(2) self.device_1, self.device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
cls.device_1, cls.device_2 = SignInView(cls.drivers[0]), SignInView(cls.drivers[1]) self.home_1, self.home_2 = self.device_1.create_user(enable_notifications=True), self.device_2.create_user()
cls.home_1, cls.home_2 = cls.device_1.create_user(enable_notifications=True), cls.device_2.create_user() self.public_key_user_1, self.username_1 = self.home_1.get_public_key_and_username(return_username=True)
cls.public_key_user_1, cls.username_1 = cls.home_1.get_public_key_and_username(return_username=True) self.public_key_user_2, self.username_2 = self.home_2.get_public_key_and_username(return_username=True)
cls.public_key_user_2, cls.username_2 = cls.home_2.get_public_key_and_username(return_username=True) [self.group_chat_name_1, self.group_chat_name_2, self.group_chat_name_3, self.group_chat_name_4, \
[cls.group_chat_name_1, cls.group_chat_name_2, cls.group_chat_name_3, cls.group_chat_name_4, \ self.group_chat_name_5] = "GroupChat1", "GroupChat2", "GroupChat3", "GroupChat4", "GroupChat5"
cls.group_chat_name_5] = "GroupChat1", "GroupChat2", "GroupChat3", "GroupChat4", "GroupChat5"
cls.message_from_sender = "Message sender" self.message_from_sender = "Message sender"
cls.home_2.home_button.double_click() self.home_2.home_button.double_click()
cls.device_2_one_to_one_chat = cls.home_2.add_contact(cls.public_key_user_1) self.device_2_one_to_one_chat = self.home_2.add_contact(self.public_key_user_1)
@marks.testrail_id(702183) @marks.testrail_id(702183)
def test_activity_center_reject_chats_no_pn(self): def test_activity_center_reject_chats_no_pn(self):
@ -161,7 +160,7 @@ class TestActivityCenterMultipleDeviceMedium(MultipleSharedDeviceTestCase):
self.home_1.just_fyi("Device1 joins Group chat 3") self.home_1.just_fyi("Device1 joins Group chat 3")
group_chat_1 = self.home_1.get_chat(self.group_chat_name_3).click() group_chat_1 = self.home_1.get_chat(self.group_chat_name_3).click()
group_chat_1.join_chat_button.click_if_shown() group_chat_1.join_chat_button.click()
group_chat_1.home_button.double_click() group_chat_1.home_button.double_click()
self.home_2.just_fyi("Device2 mentions Device1 in Group chat 3") self.home_2.just_fyi("Device2 mentions Device1 in Group chat 3")
@ -177,7 +176,8 @@ class TestActivityCenterMultipleDeviceMedium(MultipleSharedDeviceTestCase):
self.home_1.notifications_unread_badge.click_until_absense_of_element(self.home_1.plus_button) self.home_1.notifications_unread_badge.click_until_absense_of_element(self.home_1.plus_button)
self.home_1.just_fyi("Check that notification from group is presented in Activity Center") self.home_1.just_fyi("Check that notification from group is presented in Activity Center")
if not self.home_1.get_chat_from_activity_center_view(self.username_2).chat_message_preview == group_chat_message: if not self.home_1.get_chat_from_activity_center_view(
self.username_2).chat_message_preview == group_chat_message:
self.errors.append("No mention in Activity Center for Group Chat") self.errors.append("No mention in Activity Center for Group Chat")
self.home_1.just_fyi("Open group chat where user mentioned") self.home_1.just_fyi("Open group chat where user mentioned")

View File

@ -10,12 +10,11 @@ from tests.users import basic_user, ens_user, ens_user_ropsten, transaction_send
@marks.medium @marks.medium
class TestBrowserProfileOneDevice(MultipleSharedDeviceTestCase): class TestBrowserProfileOneDevice(MultipleSharedDeviceTestCase):
@classmethod def prepare_devices(self):
def setup_class(cls): self.drivers, self.loop = create_shared_drivers(1)
cls.drivers, cls.loop = create_shared_drivers(1) self.sign_in = SignInView(self.drivers[0])
cls.sign_in = SignInView(cls.drivers[0]) self.home = self.sign_in.create_user()
cls.home = cls.sign_in.create_user() self.wiki_texts = ['Español', '日本語', 'Français', '中文', 'Português']
cls.wiki_texts = ['Español', '日本語', 'Français', '中文', 'Português']
@marks.testrail_id(702149) @marks.testrail_id(702149)
def test_browser_can_access_images_by_link(self): def test_browser_can_access_images_by_link(self):

View File

@ -1,35 +1,36 @@
import random import random
from time import sleep from time import sleep
import emoji import emoji
import pytest import pytest
from tests.base_test_case import MultipleSharedDeviceTestCase, create_shared_drivers
from tests import bootnode_address, mailserver_address, mailserver_ams, used_fleet, background_service_message from tests import bootnode_address, mailserver_address, mailserver_ams, used_fleet, background_service_message
from tests.users import transaction_senders, ens_user
from tests import marks from tests import marks
from tests.base_test_case import MultipleSharedDeviceTestCase, create_shared_drivers
from tests.users import transaction_senders, ens_user
from views.sign_in_view import SignInView from views.sign_in_view import SignInView
@pytest.mark.xdist_group(name="two_2") @pytest.mark.xdist_group(name="two_2")
@marks.medium @marks.medium
class TestTimelineHistoryNodesBootnodesMultipleDeviceMergedMedium(MultipleSharedDeviceTestCase): class TestTimelineHistoryNodesBootnodesMultipleDeviceMergedMedium(MultipleSharedDeviceTestCase):
@classmethod
def setup_class(cls): def prepare_devices(self):
cls.drivers, cls.loop = create_shared_drivers(2) self.drivers, self.loop = create_shared_drivers(2)
device_1, device_2 = SignInView(cls.drivers[0]), SignInView(cls.drivers[1]) device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
cls.home_1, cls.home_2 = device_1.create_user(), device_2.create_user() self.home_1, self.home_2 = device_1.create_user(), device_2.create_user()
cls.profile_1, cls.profile_2 = cls.home_1.profile_button.click(), cls.home_2.profile_button.click() self.profile_1, self.profile_2 = self.home_1.profile_button.click(), self.home_2.profile_button.click()
cls.public_key_1, cls.username_1 = cls.profile_1.get_public_key_and_username(return_username=True) self.public_key_1, self.username_1 = self.profile_1.get_public_key_and_username(return_username=True)
cls.public_key_2, cls.username_2 = cls.profile_2.get_public_key_and_username(return_username=True) self.public_key_2, self.username_2 = self.profile_2.get_public_key_and_username(return_username=True)
cls.text_message = 'hello' self.text_message = 'hello'
[home.home_button.click() for home in (cls.home_1, cls.home_2)] [home.home_button.click() for home in (self.home_1, self.home_2)]
cls.public_chat_name = cls.home_1.get_random_chat_name() self.public_chat_name = self.home_1.get_random_chat_name()
cls.chat_1, cls.chat_2 = cls.home_1.join_public_chat(cls.public_chat_name), cls.home_2.join_public_chat( self.chat_1, self.chat_2 = self.home_1.join_public_chat(self.public_chat_name), self.home_2.join_public_chat(
cls.public_chat_name) self.public_chat_name)
cls.chat_1.send_message(cls.text_message) self.chat_1.send_message(self.text_message)
[home.home_button.click() for home in (cls.home_1, cls.home_2)] [home.home_button.click() for home in (self.home_1, self.home_2)]
cls.home_1.add_contact(cls.public_key_2, add_in_contacts=False) self.home_1.add_contact(self.public_key_2, add_in_contacts=False)
cls.home_2.add_contact(cls.public_key_1, add_in_contacts=False) self.home_2.add_contact(self.public_key_1, add_in_contacts=False)
@marks.testrail_id(702284) @marks.testrail_id(702284)
def test_public_chat_timeline_different_statuses_reaction(self): def test_public_chat_timeline_different_statuses_reaction(self):
@ -252,7 +253,8 @@ class TestTimelineHistoryNodesBootnodesMultipleDeviceMergedMedium(MultipleShared
public_chat_2.send_message_button.click() public_chat_2.send_message_button.click()
public_chat_2.back_button.click() public_chat_2.back_button.click()
self.profile_1.just_fyi('join same public chat and try to reconnect via "Tap to reconnect" and check "Connecting"') self.profile_1.just_fyi(
'join same public chat and try to reconnect via "Tap to reconnect" and check "Connecting"')
self.profile_1.home_button.double_click() self.profile_1.home_button.double_click()
public_chat_1 = self.home_1.join_public_chat(public_chat_name) public_chat_1 = self.home_1.join_public_chat(public_chat_name)
public_chat_1.reopen_app() public_chat_1.reopen_app()
@ -295,39 +297,40 @@ class TestTimelineHistoryNodesBootnodesMultipleDeviceMergedMedium(MultipleShared
@marks.medium @marks.medium
class TestChatMediumMultipleDevice(MultipleSharedDeviceTestCase): class TestChatMediumMultipleDevice(MultipleSharedDeviceTestCase):
@classmethod def prepare_devices(self):
def setup_class(cls): self.drivers, self.loop = create_shared_drivers(2)
cls.drivers, cls.loop = create_shared_drivers(2) self.device_1, self.device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
cls.device_1, cls.device_2 = SignInView(cls.drivers[0]), SignInView(cls.drivers[1]) self.home_1, self.home_2 = self.device_1.create_user(enable_notifications=True), self.device_2.create_user()
cls.home_1, cls.home_2 = cls.device_1.create_user(enable_notifications=True), cls.device_2.create_user() self.public_key_1, self.default_username_1 = self.home_1.get_public_key_and_username(return_username=True)
cls.public_key_1, cls.default_username_1 = cls.home_1.get_public_key_and_username(return_username=True) self.public_key_2, self.default_username_2 = self.home_2.get_public_key_and_username(return_username=True)
cls.public_key_2, cls.default_username_2 = cls.home_2.get_public_key_and_username(return_username=True) [home.home_button.click() for home in (self.home_1, self.home_2)]
[home.home_button.click() for home in (cls.home_1, cls.home_2)]
cls.home_1.just_fyi("Creating 1-1 chats") self.home_1.just_fyi("Creating 1-1 chats")
cls.chat_1 = cls.home_1.add_contact(cls.public_key_2) self.chat_1 = self.home_1.add_contact(self.public_key_2)
cls.chat_2 = cls.home_2.add_contact(cls.public_key_1) self.chat_2 = self.home_2.add_contact(self.public_key_1)
cls.home_2.just_fyi('Install free sticker pack and use it in 1-1 chat') self.home_2.just_fyi('Install free sticker pack and use it in 1-1 chat')
cls.chat_2.install_sticker_pack_by_name() self.chat_2.install_sticker_pack_by_name()
[home.home_button.click() for home in (cls.home_1, cls.home_2)] [home.home_button.click() for home in (self.home_1, self.home_2)]
cls.home_1.just_fyi("Creating group chats") self.home_1.just_fyi("Creating group chats")
cls.initial_group_chat_name = "GroupChat before rename" self.initial_group_chat_name = "GroupChat before rename"
cls.new_group_chat_name = "GroupChat after rename" self.new_group_chat_name = "GroupChat after rename"
cls.group_chat_1 = cls.home_1.create_group_chat(user_names_to_add=[cls.default_username_2], group_chat_name=cls.initial_group_chat_name) self.group_chat_1 = self.home_1.create_group_chat(user_names_to_add=[self.default_username_2],
cls.group_chat_2 = cls.home_2.get_chat(cls.initial_group_chat_name).click() group_chat_name=self.initial_group_chat_name)
cls.group_chat_2.join_chat_button.click_if_shown() self.group_chat_2 = self.home_2.get_chat(self.initial_group_chat_name).click()
[home.home_button.click() for home in (cls.home_1, cls.home_2)] self.group_chat_2.join_chat_button.click_if_shown()
[home.home_button.click() for home in (self.home_1, self.home_2)]
cls.home_1.just_fyi("Creating public chats") self.home_1.just_fyi("Creating public chats")
cls.public_chat_name = cls.home_1.get_random_chat_name() self.public_chat_name = self.home_1.get_random_chat_name()
cls.public_chat_1, cls.public_chat_2 = cls.home_1.join_public_chat(cls.public_chat_name), cls.home_2.join_public_chat(cls.public_chat_name) self.public_chat_1, self.public_chat_2 = self.home_1.join_public_chat(
[home.home_button.click() for home in (cls.home_1, cls.home_2)] self.public_chat_name), self.home_2.join_public_chat(self.public_chat_name)
[home.home_button.click() for home in (self.home_1, self.home_2)]
cls.home_1.get_chat(cls.default_username_2).click() self.home_1.get_chat(self.default_username_2).click()
cls.home_2.get_chat(cls.default_username_1).click() self.home_2.get_chat(self.default_username_1).click()
cls.message_1, cls.message_2, cls.message_3, cls.message_4 = "Message1", "Message2", "Message3", "Message4" self.message_1, self.message_2, self.message_3, self.message_4 = "Message1", "Message2", "Message3", "Message4"
@marks.testrail_id(702066) @marks.testrail_id(702066)
@marks.xfail(reason="may fail on setup with remote disconnected error, needs investigation") @marks.xfail(reason="may fail on setup with remote disconnected error, needs investigation")
@ -516,7 +519,8 @@ class TestChatMediumMultipleDevice(MultipleSharedDeviceTestCase):
self.group_chat_1.rename_chat_via_group_info(self.new_group_chat_name) self.group_chat_1.rename_chat_via_group_info(self.new_group_chat_name)
for chat in (self.group_chat_1, self.group_chat_2): for chat in (self.group_chat_1, self.group_chat_2):
if not chat.element_by_text( if not chat.element_by_text(
chat.create_system_message(self.default_username_1, self.initial_group_chat_name)).is_element_displayed(): chat.create_system_message(self.default_username_1,
self.initial_group_chat_name)).is_element_displayed():
self.errors.append('Initial system message about creating chat was changed!') self.errors.append('Initial system message about creating chat was changed!')
if not chat.element_by_text( if not chat.element_by_text(
chat.changed_group_name_system_message(self.default_username_1, chat.changed_group_name_system_message(self.default_username_1,
@ -611,7 +615,8 @@ class TestChatMediumMultipleDevice(MultipleSharedDeviceTestCase):
nickname_expected = emoji_unicode + special_char + cyrrilic nickname_expected = emoji_unicode + special_char + cyrrilic
chat_1 = self.home_1.add_contact(ens, add_in_contacts=False, nickname=nickname_to_set) chat_1 = self.home_1.add_contact(ens, add_in_contacts=False, nickname=nickname_to_set)
if chat_1.user_name_text.text != nickname_expected: if chat_1.user_name_text.text != nickname_expected:
self.errors.append('Expected special char nickname %s does not match actual %s' % (nickname_expected, chat_1.user_name_text.text)) self.errors.append('Expected special char nickname %s does not match actual %s' % (
nickname_expected, chat_1.user_name_text.text))
self.home_1.just_fyi('Can remove nickname without adding to contact') self.home_1.just_fyi('Can remove nickname without adding to contact')
chat_1.chat_options.click() chat_1.chat_options.click()
@ -648,7 +653,8 @@ class TestChatMediumMultipleDevice(MultipleSharedDeviceTestCase):
if not chat_1.chat_element_by_text(message_text).is_element_displayed(): if not chat_1.chat_element_by_text(message_text).is_element_displayed():
self.errors.append("ENS name is not resolved on sent message") self.errors.append("ENS name is not resolved on sent message")
self.home_1.just_fyi('Set nickname via group info and check that can mention by nickname /username in group chat') self.home_1.just_fyi(
'Set nickname via group info and check that can mention by nickname /username in group chat')
nickname = 'funny_bunny' nickname = 'funny_bunny'
device_2_options = chat_1.get_user_options(full_ens) device_2_options = chat_1.get_user_options(full_ens)
device_2_options.view_profile_button.click() device_2_options.view_profile_button.click()
@ -699,30 +705,30 @@ class TestChatMediumMultipleDevice(MultipleSharedDeviceTestCase):
@pytest.mark.xdist_group(name="one_3") @pytest.mark.xdist_group(name="one_3")
@marks.medium @marks.medium
class TestGroupChatMultipleDeviceMediumMerged(MultipleSharedDeviceTestCase): class TestGroupChatMultipleDeviceMediumMerged(MultipleSharedDeviceTestCase):
@classmethod
def setup_class(cls):
cls.drivers, cls.loop = create_shared_drivers(3)
cls.sign_ins, cls.homes, cls.public_keys, cls.usernames, cls.chats = {}, {}, {}, {}, {}
for key in cls.drivers:
cls.sign_ins[key] = SignInView(cls.drivers[key])
cls.homes[key] = cls.sign_ins[key].create_user()
SignInView(cls.drivers[2]).put_app_to_background_and_back()
cls.public_keys[key], cls.usernames[key] = cls.sign_ins[key].get_public_key_and_username(True)
cls.sign_ins[key].home_button.click()
SignInView(cls.drivers[0]).put_app_to_background_and_back()
for member in (cls.public_keys[1], cls.public_keys[2]): def prepare_devices(self):
cls.homes[0].add_contact(member) self.drivers, self.loop = create_shared_drivers(3)
cls.homes[0].home_button.click() self.sign_ins, self.homes, self.public_keys, self.usernames, self.chats = {}, {}, {}, {}, {}
[SignInView(cls.drivers[i]).put_app_to_background_and_back() for i in range(1, 3)] for key in self.drivers:
cls.chat_name = cls.homes[0].get_random_chat_name() self.sign_ins[key] = SignInView(self.drivers[key])
cls.invite_chat_name = '%s_invite' % cls.homes[0].get_random_chat_name() self.homes[key] = self.sign_ins[key].create_user()
cls.chats[0] = cls.homes[0].create_group_chat([], cls.invite_chat_name) SignInView(self.drivers[2]).put_app_to_background_and_back()
cls.chats[0].home_button.double_click() self.public_keys[key], self.usernames[key] = self.sign_ins[key].get_public_key_and_username(True)
self.sign_ins[key].home_button.click()
SignInView(self.drivers[0]).put_app_to_background_and_back()
cls.chats[0] = cls.homes[0].create_group_chat([cls.usernames[1], cls.usernames[2]], cls.chat_name) for member in (self.public_keys[1], self.public_keys[2]):
self.homes[0].add_contact(member)
self.homes[0].home_button.click()
[SignInView(self.drivers[i]).put_app_to_background_and_back() for i in range(1, 3)]
self.chat_name = self.homes[0].get_random_chat_name()
self.invite_chat_name = '%s_invite' % self.homes[0].get_random_chat_name()
self.chats[0] = self.homes[0].create_group_chat([], self.invite_chat_name)
self.chats[0].home_button.double_click()
self.chats[0] = self.homes[0].create_group_chat([self.usernames[1], self.usernames[2]], self.chat_name)
for i in range(1, 3): for i in range(1, 3):
cls.chats[i] = cls.homes[i].get_chat(cls.chat_name).click() self.chats[i] = self.homes[i].get_chat(self.chat_name).click()
@marks.testrail_id(702259) @marks.testrail_id(702259)
def test_group_chat_remove_member(self): def test_group_chat_remove_member(self):
@ -782,32 +788,32 @@ class TestGroupChatMultipleDeviceMediumMerged(MultipleSharedDeviceTestCase):
@marks.medium @marks.medium
class TestChatKeycardMentionsMediumMultipleDevice(MultipleSharedDeviceTestCase): class TestChatKeycardMentionsMediumMultipleDevice(MultipleSharedDeviceTestCase):
@classmethod def prepare_devices(self):
def setup_class(cls): self.drivers, self.loop = create_shared_drivers(2)
cls.drivers, cls.loop = create_shared_drivers(2) self.device_1, self.device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
cls.device_1, cls.device_2 = SignInView(cls.drivers[0]), SignInView(cls.drivers[1]) self.sender = transaction_senders['ETH_STT_1']
cls.sender = transaction_senders['ETH_STT_1']
cls.device_1.just_fyi('Grab user data for transactions and public chat, set up wallets') self.device_1.just_fyi('Grab user data for transactions and public chat, set up wallets')
cls.home_1 = cls.device_1.create_user(keycard=True, enable_notifications=True) self.home_1 = self.device_1.create_user(keycard=True, enable_notifications=True)
cls.device_2.put_app_to_background_and_back() self.device_2.put_app_to_background_and_back()
cls.recipient_public_key, cls.recipient_username = cls.home_1.get_public_key_and_username(return_username=True) self.recipient_public_key, self.recipient_username = self.home_1.get_public_key_and_username(
cls.amount = cls.device_1.get_unique_amount() return_username=True)
cls.asset_name = 'STT' self.amount = self.device_1.get_unique_amount()
cls.wallet_1 = cls.home_1.wallet_button.click() self.asset_name = 'STT'
cls.wallet_1.select_asset(cls.asset_name) self.wallet_1 = self.home_1.wallet_button.click()
cls.wallet_1.home_button.click() self.wallet_1.select_asset(self.asset_name)
self.wallet_1.home_button.click()
cls.home_2 = cls.device_2.recover_access(passphrase=cls.sender['passphrase'], self.home_2 = self.device_2.recover_access(passphrase=self.sender['passphrase'],
keycard=True, enable_notifications=True) keycard=True, enable_notifications=True)
cls.wallet_2 = cls.home_2.wallet_button.click() self.wallet_2 = self.home_2.wallet_button.click()
cls.initial_amount_stt = cls.wallet_2.get_asset_amount_by_name('STT') self.initial_amount_stt = self.wallet_2.get_asset_amount_by_name('STT')
cls.wallet_2.home_button.click() self.wallet_2.home_button.click()
cls.device_2.just_fyi('Add recipient to contact and send 1 message') self.device_2.just_fyi('Add recipient to contact and send 1 message')
cls.chat_2 = cls.home_2.add_contact(cls.recipient_public_key) self.chat_2 = self.home_2.add_contact(self.recipient_public_key)
cls.chat_2.send_message("test message") self.chat_2.send_message("test message")
cls.chat_1 = cls.home_1.get_chat(cls.sender['username']).click() self.chat_1 = self.home_1.get_chat(self.sender['username']).click()
@marks.testrail_id(702294) @marks.testrail_id(702294)
def test_chat_1_1_unread_counter_highligted(self): def test_chat_1_1_unread_counter_highligted(self):
@ -839,7 +845,8 @@ class TestChatKeycardMentionsMediumMultipleDevice(MultipleSharedDeviceTestCase):
self.errors.append("Preview message is not hightligted or text is not shown! ") self.errors.append("Preview message is not hightligted or text is not shown! ")
self.home_1.get_chat(self.sender['username']).click() self.home_1.get_chat(self.sender['username']).click()
self.home_1.home_button.double_click() self.home_1.home_button.double_click()
if not self.home_1.get_chat(self.sender['username']).chat_preview.is_element_differs_from_template('highligted_preview.png', 0): if not self.home_1.get_chat(self.sender['username']).chat_preview.is_element_differs_from_template(
'highligted_preview.png', 0):
self.errors.append("Preview message is still highlighted after opening ") self.errors.append("Preview message is still highlighted after opening ")
self.errors.verify_no_errors() self.errors.verify_no_errors()
@ -896,7 +903,8 @@ class TestChatKeycardMentionsMediumMultipleDevice(MultipleSharedDeviceTestCase):
[home.wallet_button.click() for home in (self.home_1, self.home_2)] [home.wallet_button.click() for home in (self.home_1, self.home_2)]
self.wallet_2.wait_balance_is_changed('STT', self.initial_amount_stt) self.wallet_2.wait_balance_is_changed('STT', self.initial_amount_stt)
self.wallet_1.wait_balance_is_changed('STT', scan_tokens=True) self.wallet_1.wait_balance_is_changed('STT', scan_tokens=True)
[wallet.find_transaction_in_history(amount=self.amount, asset='STT') for wallet in (self.wallet_1, self.wallet_2)] [wallet.find_transaction_in_history(amount=self.amount, asset='STT') for wallet in
(self.wallet_1, self.wallet_2)]
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(702296) @marks.testrail_id(702296)
@ -966,7 +974,8 @@ class TestChatKeycardMentionsMediumMultipleDevice(MultipleSharedDeviceTestCase):
if blocked_chat_user.is_element_displayed(): if blocked_chat_user.is_element_displayed():
self.errors.append("Chat with blocked user is reappeared after fetching new messages from offline") self.errors.append("Chat with blocked user is reappeared after fetching new messages from offline")
self.device_1.just_fyi("check that PNs are still enabled in profile after closing 'background notification centre' " self.device_1.just_fyi(
"check that PNs are still enabled in profile after closing 'background notification centre' "
"message and relogin") "message and relogin")
self.device_1.open_notification_bar() self.device_1.open_notification_bar()
if not self.device_1.element_by_text_part(background_service_message).is_element_displayed(): if not self.device_1.element_by_text_part(background_service_message).is_element_displayed():

View File

@ -1,18 +1,10 @@
import re
import random
import string
import pytest import pytest
from tests import marks, mailserver_ams, mailserver_gc, mailserver_hk, used_fleet, common_password, test_dapp_name,\
test_dapp_url, pair_code, unique_password
from tests.base_test_case import create_shared_drivers, MultipleSharedDeviceTestCase
from tests.users import user_mainnet, chat_users, dummy_user, recovery_users, transaction_senders, basic_user,\
wallet_users, ens_user_ropsten, ens_user
from selenium.common.exceptions import NoSuchElementException from selenium.common.exceptions import NoSuchElementException
from tests.base_test_case import SingleDeviceTestCase, MultipleDeviceTestCase from tests import marks, test_dapp_url
from views.send_transaction_view import SendTransactionView from tests.base_test_case import create_shared_drivers, MultipleSharedDeviceTestCase
from views.chat_view import ChatView from tests.users import dummy_user, transaction_senders, basic_user, \
ens_user_ropsten, ens_user
from views.sign_in_view import SignInView from views.sign_in_view import SignInView
@ -20,25 +12,24 @@ from views.sign_in_view import SignInView
@marks.medium @marks.medium
class TestDeeplinkChatProfileOneDevice(MultipleSharedDeviceTestCase): class TestDeeplinkChatProfileOneDevice(MultipleSharedDeviceTestCase):
@classmethod def prepare_devices(self):
def setup_class(cls): self.drivers, self.loop = create_shared_drivers(1)
cls.drivers, cls.loop = create_shared_drivers(1) self.sign_in = SignInView(self.drivers[0])
cls.sign_in = SignInView(cls.drivers[0]) self.home = self.sign_in.create_user()
cls.home = cls.sign_in.create_user() self.public_key, self.default_username = self.home.get_public_key_and_username(return_username=True)
cls.public_key, cls.default_username = cls.home.get_public_key_and_username(return_username=True) self.home.home_button.click()
cls.home.home_button.click() self.public_chat_name = 'pubchat'
cls.public_chat_name = 'pubchat' self.nickname = 'dummy_user'
cls.nickname = 'dummy_user' self.search_list_1 = {
cls.search_list_1 = {
basic_user['username']: basic_user['username'], basic_user['username']: basic_user['username'],
ens_user_ropsten['username']: ens_user_ropsten['ens'], ens_user_ropsten['username']: ens_user_ropsten['ens'],
cls.public_chat_name: cls.public_chat_name, self.public_chat_name: self.public_chat_name,
cls.nickname: cls.nickname, self.nickname: self.nickname,
dummy_user['username']: cls.nickname, dummy_user['username']: self.nickname,
ens_user_ropsten['ens']: ens_user_ropsten['ens'] ens_user_ropsten['ens']: ens_user_ropsten['ens']
} }
cls.public_chat = cls.home.join_public_chat(cls.public_chat_name) self.public_chat = self.home.join_public_chat(self.public_chat_name)
cls.public_chat.get_back_to_home_view() self.public_chat.get_back_to_home_view()
@marks.testrail_id(702244) @marks.testrail_id(702244)
def test_deep_link_with_invalid_user_public_key_own_profile_key(self): def test_deep_link_with_invalid_user_public_key_own_profile_key(self):
@ -117,7 +108,8 @@ class TestDeeplinkChatProfileOneDevice(MultipleSharedDeviceTestCase):
self.public_chat.chat_options.click() self.public_chat.chat_options.click()
self.public_chat.share_chat_button.click() self.public_chat.share_chat_button.click()
self.public_chat.share_via_messenger() self.public_chat.share_via_messenger()
if not self.public_chat.element_by_text_part('https://join.status.im/%s' % self.public_chat_name).is_element_present(): if not self.public_chat.element_by_text_part(
'https://join.status.im/%s' % self.public_chat_name).is_element_present():
self.errors.append("Can't share link to public chat") self.errors.append("Can't share link to public chat")
for _ in range(2): for _ in range(2):
self.public_chat.click_system_back_button() self.public_chat.click_system_back_button()
@ -260,7 +252,8 @@ class TestDeeplinkChatProfileOneDevice(MultipleSharedDeviceTestCase):
message_input.delete_last_symbols(2) message_input.delete_last_symbols(2)
current_text = message_input.text current_text = message_input.text
if current_text != message_text[:-2]: if current_text != message_text[:-2]:
self.errors.append("Message input text '%s' doesn't match expected '%s'" % (current_text, message_text[:-2])) self.errors.append(
"Message input text '%s' doesn't match expected '%s'" % (current_text, message_text[:-2]))
"""self.home.just_fyi('Cutting message text from input field') """self.home.just_fyi('Cutting message text from input field')
message_input.cut_text() message_input.cut_text()
@ -273,7 +266,8 @@ class TestDeeplinkChatProfileOneDevice(MultipleSharedDeviceTestCase):
self.home.just_fyi('Pasting the cut message back to the input field') self.home.just_fyi('Pasting the cut message back to the input field')
message_input.paste_text_from_clipboard() message_input.paste_text_from_clipboard()
if current_text != message_text[:-2]: if current_text != message_text[:-2]:
self.errors.append("Message input text '%s' doesn't match expected '%s'" % (current_text, message_text[:-2])) self.errors.append(
"Message input text '%s' doesn't match expected '%s'" % (current_text, message_text[:-2]))
chat.send_message_button.click() chat.send_message_button.click()

View File

@ -1,4 +1,5 @@
import pytest import pytest
from tests import marks from tests import marks
from tests.base_test_case import MultipleSharedDeviceTestCase, create_shared_drivers from tests.base_test_case import MultipleSharedDeviceTestCase, create_shared_drivers
from views.sign_in_view import SignInView from views.sign_in_view import SignInView
@ -8,63 +9,64 @@ from views.sign_in_view import SignInView
@marks.medium @marks.medium
class TestPairingSyncMediumMultipleDevicesMerged(MultipleSharedDeviceTestCase): class TestPairingSyncMediumMultipleDevicesMerged(MultipleSharedDeviceTestCase):
@classmethod def prepare_devices(self):
def setup_class(cls): self.drivers, self.loop = create_shared_drivers(3)
cls.drivers, cls.loop = create_shared_drivers(3) self.device_1, self.device_2, self.device_3 = SignInView(self.drivers[0]), SignInView(
cls.device_1, cls.device_2, cls.device_3 = SignInView(cls.drivers[0]), SignInView(cls.drivers[1]), SignInView(cls.drivers[2]) self.drivers[1]), SignInView(self.drivers[2])
cls.home_1 = cls.device_1.create_user() self.home_1 = self.device_1.create_user()
cls.profile_1 = cls.home_1.profile_button.click() self.profile_1 = self.home_1.profile_button.click()
cls.profile_1.privacy_and_security_button.click() self.profile_1.privacy_and_security_button.click()
cls.profile_1.backup_recovery_phrase_button.click() self.profile_1.backup_recovery_phrase_button.click()
cls.profile_1.ok_continue_button.click() self.profile_1.ok_continue_button.click()
cls.recovery_phrase = cls.profile_1.get_recovery_phrase() self.recovery_phrase = self.profile_1.get_recovery_phrase()
cls.profile_1.close_button.click() self.profile_1.close_button.click()
cls.profile_1.home_button.click() self.profile_1.home_button.click()
cls.device_2.put_app_to_background_and_back() self.device_2.put_app_to_background_and_back()
cls.home_3 = cls.device_3.create_user() self.home_3 = self.device_3.create_user()
cls.public_key_3, cls.username_3 = cls.home_3.get_public_key_and_username(return_username=True) self.public_key_3, self.username_3 = self.home_3.get_public_key_and_username(return_username=True)
cls.device_3.home_button.click() self.device_3.home_button.click()
cls.device_1.put_app_to_background_and_back() self.device_1.put_app_to_background_and_back()
cls.comm_before_sync_name, cls.channel, cls.message = 'b-%s' % cls.home_1.get_random_chat_name(), 'some-rand-chann', 'comm_message' self.comm_before_sync_name, self.channel, self.message = 'b-%s' % self.home_1.get_random_chat_name(), 'some-rand-chann', 'comm_message'
cls.device_1_name, cls.device_2_name, cls.group_chat_name = 'creator', 'paired', 'some group chat' self.device_1_name, self.device_2_name, self.group_chat_name = 'creator', 'paired', 'some group chat'
cls.comm_after_sync_name = 'a-public-%s' % cls.home_1.get_random_chat_name() self.comm_after_sync_name = 'a-public-%s' % self.home_1.get_random_chat_name()
cls.channel_after_sync, cls.message_after_sync = 'chann-after-sync', 'sent after sync' self.channel_after_sync, self.message_after_sync = 'chann-after-sync', 'sent after sync'
cls.device_1.just_fyi('Create community, create group chat, edit user picture') self.device_1.just_fyi('Create community, create group chat, edit user picture')
cls.comm_before_1 = cls.home_1.create_community(cls.comm_before_sync_name) self.comm_before_1 = self.home_1.create_community(self.comm_before_sync_name)
cls.channel_before_1 = cls.comm_before_1.add_channel(cls.channel) self.channel_before_1 = self.comm_before_1.add_channel(self.channel)
cls.channel_before_1.send_message(cls.message) self.channel_before_1.send_message(self.message)
cls.home_1.home_button.double_click() self.home_1.home_button.double_click()
cls.device_3.put_app_to_background_and_back() self.device_3.put_app_to_background_and_back()
cls.device_2.put_app_to_background_and_back() self.device_2.put_app_to_background_and_back()
cls.device_1.just_fyi('Edit profile picture') self.device_1.just_fyi('Edit profile picture')
cls.home_1.profile_button.double_click() self.home_1.profile_button.double_click()
cls.profile_1.edit_profile_picture('sauce_logo.png') self.profile_1.edit_profile_picture('sauce_logo.png')
cls.device_1.just_fyi('Add contact, start group chat') self.device_1.just_fyi('Add contact, start group chat')
cls.home_1.home_button.click() self.home_1.home_button.click()
cls.home_1.add_contact(cls.public_key_3) self.home_1.add_contact(self.public_key_3)
cls.home_1.get_back_to_home_view() self.device_2.put_app_to_background_and_back()
cls.chat_1 = cls.home_1.create_group_chat([cls.username_3], cls.group_chat_name) self.home_1.get_back_to_home_view()
cls.chat_3 = cls.home_3.get_chat(cls.group_chat_name).click() self.chat_1 = self.home_1.create_group_chat([self.username_3], self.group_chat_name)
cls.chat_3.join_chat_button.click_if_shown() self.chat_3 = self.home_3.get_chat(self.group_chat_name).click()
self.chat_3.join_chat_button.click_if_shown()
cls.device_2.just_fyi("(secondary device): restore same multiaccount on another device") self.device_2.just_fyi("(secondary device): restore same multiaccount on another device")
cls.home_2 = cls.device_2.recover_access(passphrase=' '.join(cls.recovery_phrase.values())) self.home_2 = self.device_2.recover_access(passphrase=' '.join(self.recovery_phrase.values()))
cls.profile_1, cls.profile_2 = cls.home_1.profile_button.click(), cls.home_2.profile_button.click() self.profile_1, self.profile_2 = self.home_1.profile_button.click(), self.home_2.profile_button.click()
cls.device_1.put_app_to_background_and_back() self.device_1.put_app_to_background_and_back()
cls.device_2.just_fyi('Pair main and secondary devices') self.device_2.just_fyi('Pair main and secondary devices')
cls.name_1, cls.name_2 = 'device_%s' % cls.device_1.driver.number, 'device_%s' % cls.device_2.driver.number self.name_1, self.name_2 = 'device_%s' % self.device_1.driver.number, 'device_%s' % self.device_2.driver.number
cls.profile_2.discover_and_advertise_device(cls.name_2) self.profile_2.discover_and_advertise_device(self.name_2)
cls.profile_1.discover_and_advertise_device(cls.name_1) self.profile_1.discover_and_advertise_device(self.name_1)
cls.profile_1.get_toggle_device_by_name(cls.name_2).wait_and_click() self.profile_1.get_toggle_device_by_name(self.name_2).wait_and_click()
cls.profile_1.sync_all_button.click() self.profile_1.sync_all_button.click()
cls.profile_1.sync_all_button.wait_for_visibility_of_element(20) self.profile_1.sync_all_button.wait_for_visibility_of_element(20)
[device.profile_button.double_click() for device in (cls.profile_1, cls.profile_2)] [device.profile_button.double_click() for device in (self.profile_1, self.profile_2)]
[device.home_button.double_click() for device in (cls.profile_1, cls.profile_2, cls.device_3)] [device.home_button.double_click() for device in (self.profile_1, self.profile_2, self.device_3)]
@marks.testrail_id(702269) @marks.testrail_id(702269)
@marks.xfail(reason="too long setup, can fail with Remote end closed connection") @marks.xfail(reason="too long setup, can fail with Remote end closed connection")
@ -151,7 +153,7 @@ class TestPairingSyncMediumMultipleDevicesMerged(MultipleSharedDeviceTestCase):
self.chat_1.record_audio_message(message_length_in_seconds=3) self.chat_1.record_audio_message(message_length_in_seconds=3)
self.device_1.send_message_button.click() self.device_1.send_message_button.click()
self.chat_1.chat_message_input.click() self.chat_1.chat_message_input.click()
for chat in(self.chat_1, self.chat_2, self.chat_3): for chat in (self.chat_1, self.chat_2, self.chat_3):
if not chat.play_pause_audio_message_button.is_element_displayed(30): if not chat.play_pause_audio_message_button.is_element_displayed(30):
self.errors.append('Audio message is not shown in chat after sending!') self.errors.append('Audio message is not shown in chat after sending!')
self.errors.verify_no_errors() self.errors.verify_no_errors()

View File

@ -1,26 +1,25 @@
import pytest import pytest
from tests import marks from tests import marks
from tests.users import transaction_senders, basic_user, ens_user_ropsten, ens_user
from views.web_views.base_web_view import BaseWebView
from tests.base_test_case import create_shared_drivers, MultipleSharedDeviceTestCase from tests.base_test_case import create_shared_drivers, MultipleSharedDeviceTestCase
from views.send_transaction_view import SendTransactionView from tests.users import transaction_senders, basic_user, ens_user_ropsten, ens_user
from views.chat_view import ChatView from views.chat_view import ChatView
from views.sign_in_view import SignInView
from views.profile_view import ProfileView from views.profile_view import ProfileView
from views.send_transaction_view import SendTransactionView
from views.sign_in_view import SignInView
from views.web_views.base_web_view import BaseWebView
@pytest.mark.xdist_group(name="one_2") @pytest.mark.xdist_group(name="one_2")
@marks.medium @marks.medium
class TestPermissionsScanQrOneDevice(MultipleSharedDeviceTestCase): class TestPermissionsScanQrOneDevice(MultipleSharedDeviceTestCase):
@classmethod def prepare_devices(self):
def setup_class(cls): self.drivers, self.loop = create_shared_drivers(1)
cls.drivers, cls.loop = create_shared_drivers(1) self.sign_in = SignInView(self.drivers[0])
cls.sign_in = SignInView(cls.drivers[0]) self.home = self.sign_in.recover_access(transaction_senders['C']['passphrase'])
cls.home = cls.sign_in.recover_access(transaction_senders['C']['passphrase']) self.public_key = self.home.get_public_key_and_username()
cls.public_key = cls.home.get_public_key_and_username() self.home.home_button.click()
cls.home.home_button.click()
@marks.testrail_id(702289) @marks.testrail_id(702289)
def test_permissions_deny_access_camera_and_gallery(self): def test_permissions_deny_access_camera_and_gallery(self):

View File

@ -1,45 +1,43 @@
from views.chat_view import CommunityView import time
import pytest import pytest
from tests import common_password
from tests import marks from tests import marks
from tests.base_test_case import MultipleSharedDeviceTestCase, create_shared_drivers from tests.base_test_case import MultipleSharedDeviceTestCase, create_shared_drivers
from views.chat_view import CommunityView
from views.sign_in_view import SignInView from views.sign_in_view import SignInView
import time
from tests import bootnode_address, mailserver_address, mailserver_ams, mailserver_hk, used_fleet, common_password
from tests.users import transaction_senders, basic_user, ens_user
from tests import marks
from tests.base_test_case import MultipleDeviceTestCase
from views.sign_in_view import SignInView
@pytest.mark.xdist_group(name='five_2') @pytest.mark.xdist_group(name='five_2')
@marks.medium @marks.medium
class TestProfileGapsCommunityMediumMultipleDevicesMerged(MultipleSharedDeviceTestCase): class TestProfileGapsCommunityMediumMultipleDevicesMerged(MultipleSharedDeviceTestCase):
@classmethod def prepare_devices(self):
def setup_class(cls): self.drivers, self.loop = create_shared_drivers(2)
cls.drivers, cls.loop = create_shared_drivers(2) self.device_1, self.device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
cls.device_1, cls.device_2 = SignInView(cls.drivers[0]), SignInView(cls.drivers[1]) self.home_1, self.home_2 = self.device_1.create_user(), self.device_2.create_user(enable_notifications=True)
cls.home_1, cls.home_2 = cls.device_1.create_user(), cls.device_2.create_user(enable_notifications=True) self.public_key_1, self.default_username_1 = self.home_1.get_public_key_and_username(return_username=True)
cls.public_key_1, cls.default_username_1 = cls.home_1.get_public_key_and_username(return_username=True) self.public_key_2, self.default_username_2 = self.home_2.get_public_key_and_username(return_username=True)
cls.public_key_2, cls.default_username_2 = cls.home_2.get_public_key_and_username(return_username=True) [home.home_button.click() for home in (self.home_1, self.home_2)]
[home.home_button.click() for home in (cls.home_1, cls.home_2)]
cls.home_1.just_fyi("Creating 1-1 chats") self.home_1.just_fyi("Creating 1-1 chats")
cls.chat_1 = cls.home_1.add_contact(cls.public_key_2) self.chat_1 = self.home_1.add_contact(self.public_key_2)
cls.first_message = 'first message' self.first_message = 'first message'
cls.chat_2 = cls.home_2.add_contact(cls.public_key_1, add_in_contacts=False) self.chat_2 = self.home_2.add_contact(self.public_key_1, add_in_contacts=False)
[home.home_button.click() for home in (cls.home_1, cls.home_2)] [home.home_button.click() for home in (self.home_1, self.home_2)]
cls.home_1.just_fyi("Creating group chat") self.home_1.just_fyi("Creating group chat")
cls.group_chat_name = "gr_chat_%s" % cls.home_1.get_random_chat_name() self.group_chat_name = "gr_chat_%s" % self.home_1.get_random_chat_name()
cls.group_chat_1 = cls.home_1.create_group_chat(user_names_to_add=[cls.default_username_2], self.group_chat_1 = self.home_1.create_group_chat(user_names_to_add=[self.default_username_2],
group_chat_name=cls.group_chat_name) group_chat_name=self.group_chat_name)
cls.group_chat_2 = cls.home_2.get_chat(cls.group_chat_name).click() self.group_chat_2 = self.home_2.get_chat(self.group_chat_name).click()
[home.home_button.click() for home in (cls.home_1, cls.home_2)] [home.home_button.click() for home in (self.home_1, self.home_2)]
cls.home_1.just_fyi("Creating public chats") self.home_1.just_fyi("Creating public chats")
cls.public_chat_name = cls.home_1.get_random_chat_name() self.public_chat_name = self.home_1.get_random_chat_name()
cls.public_chat_1, cls.public_chat_2 = cls.home_1.join_public_chat( self.public_chat_1, self.public_chat_2 = self.home_1.join_public_chat(
cls.public_chat_name), cls.home_2.join_public_chat(cls.public_chat_name) self.public_chat_name), self.home_2.join_public_chat(self.public_chat_name)
@marks.testrail_id(702281) @marks.testrail_id(702281)
def test_profile_show_profile_picture_and_online_indicator_settings(self): def test_profile_show_profile_picture_and_online_indicator_settings(self):
@ -87,7 +85,8 @@ class TestProfileGapsCommunityMediumMultipleDevicesMerged(MultipleSharedDeviceTe
self.errors.append('Profile picture was not updated on user Profile view') self.errors.append('Profile picture was not updated on user Profile view')
profile_2.close_button.click() profile_2.close_button.click()
self.home_2.home_button.double_click() self.home_2.home_button.double_click()
if not self.home_2.get_chat(self.default_username_1).chat_image.is_element_image_similar_to_template(logo_chats): if not self.home_2.get_chat(self.default_username_1).chat_image.is_element_image_similar_to_template(
logo_chats):
self.errors.append('User profile picture was not updated on Chats view') self.errors.append('User profile picture was not updated on Chats view')
profile_1.just_fyi('Check profile image updated in user profile view in Group chat views') profile_1.just_fyi('Check profile image updated in user profile view in Group chat views')
@ -97,7 +96,8 @@ class TestProfileGapsCommunityMediumMultipleDevicesMerged(MultipleSharedDeviceTe
group_chat_1 = self.home_1.get_chat(self.group_chat_name).click() group_chat_1 = self.home_1.get_chat(self.group_chat_name).click()
group_chat_1.send_message(group_chat_message) group_chat_1.send_message(group_chat_message)
self.group_chat_2.chat_element_by_text(group_chat_message).wait_for_element(20) self.group_chat_2.chat_element_by_text(group_chat_message).wait_for_element(20)
if not self.group_chat_2.chat_element_by_text(group_chat_message).member_photo.is_element_image_similar_to_template( if not self.group_chat_2.chat_element_by_text(
group_chat_message).member_photo.is_element_image_similar_to_template(
logo_default): logo_default):
self.errors.append('User profile picture was not updated in message Group chat view') self.errors.append('User profile picture was not updated in message Group chat view')
self.home_2.put_app_to_background() self.home_2.put_app_to_background()
@ -154,7 +154,8 @@ class TestProfileGapsCommunityMediumMultipleDevicesMerged(MultipleSharedDeviceTe
profile_2.element_by_translation_id("everyone").click() profile_2.element_by_translation_id("everyone").click()
group_chat_1.send_message(group_chat_message) group_chat_1.send_message(group_chat_message)
profile_2.home_button.click(desired_view='home') profile_2.home_button.click(desired_view='home')
if not self.home_2.get_chat(self.default_username_1).chat_image.is_element_image_similar_to_template(logo_chats): if not self.home_2.get_chat(self.default_username_1).chat_image.is_element_image_similar_to_template(
logo_chats):
self.errors.append('User profile picture is not returned to default after user removed from Contacts') self.errors.append('User profile picture is not returned to default after user removed from Contacts')
self.errors.verify_no_errors() self.errors.verify_no_errors()
@ -247,7 +248,8 @@ class TestProfileGapsCommunityMediumMultipleDevicesMerged(MultipleSharedDeviceTe
self.home_1.just_fyi("Approve membership") self.home_1.just_fyi("Approve membership")
community_1.handle_membership_request(self.default_username_2, approve=True) community_1.handle_membership_request(self.default_username_2, approve=True)
if not community_1.element_by_text(self.default_username_2).is_element_displayed(): if not community_1.element_by_text(self.default_username_2).is_element_displayed():
self.errors.append("New member %s is not shown as added to community on info page!" % self.default_username_2) self.errors.append(
"New member %s is not shown as added to community on info page!" % self.default_username_2)
if not community_2.community_info_picture.is_element_image_similar_to_template(community_pic): if not community_2.community_info_picture.is_element_image_similar_to_template(community_pic):
self.errors.append("Community image is different!") self.errors.append("Community image is different!")
channel_2 = community_2.get_chat(channel_name).click() channel_2 = community_2.get_chat(channel_name).click()
@ -263,5 +265,3 @@ class TestProfileGapsCommunityMediumMultipleDevicesMerged(MultipleSharedDeviceTe
self.errors.append("Message from member is not shown for community channel!") self.errors.append("Message from member is not shown for community channel!")
self.errors.verify_no_errors() self.errors.verify_no_errors()

View File

@ -2,8 +2,9 @@ import random
import string import string
import pytest import pytest
from tests.base_test_case import MultipleSharedDeviceTestCase, create_shared_drivers
from tests import common_password, marks, test_dapp_name from tests import common_password, marks, test_dapp_name
from tests.base_test_case import MultipleSharedDeviceTestCase, create_shared_drivers
from tests.users import transaction_senders, basic_user, ens_user_ropsten from tests.users import transaction_senders, basic_user, ens_user_ropsten
from views.sign_in_view import SignInView from views.sign_in_view import SignInView
@ -12,16 +13,15 @@ from views.sign_in_view import SignInView
@marks.medium @marks.medium
class TestKeycardMediumMultipleDevicesMerged(MultipleSharedDeviceTestCase): class TestKeycardMediumMultipleDevicesMerged(MultipleSharedDeviceTestCase):
@classmethod def prepare_devices(self):
def setup_class(cls): self.user = transaction_senders['ETH_STT_4']
cls.user = transaction_senders['ETH_STT_4'] self.drivers, self.loop = create_shared_drivers(1)
cls.drivers, cls.loop = create_shared_drivers(1) self.sign_in = SignInView(self.drivers[0])
cls.sign_in = SignInView(cls.drivers[0]) self.home = self.sign_in.recover_access(passphrase=self.user['passphrase'], keycard=True)
cls.home = cls.sign_in.recover_access(passphrase=cls.user['passphrase'], keycard=True) self.profile = self.home.get_profile_view()
cls.profile = cls.home.get_profile_view() self.wallet = self.home.wallet_button.click()
cls.wallet = cls.home.wallet_button.click() self.wallet.wait_balance_is_changed('STT')
cls.wallet.wait_balance_is_changed('STT') self.home.home_button.click()
cls.home.home_button.click()
@marks.testrail_id(702317) @marks.testrail_id(702317)
def test_keycard_testdapp_sign_typed_message(self): def test_keycard_testdapp_sign_typed_message(self):
@ -202,21 +202,20 @@ class TestKeycardMediumMultipleDevicesMerged(MultipleSharedDeviceTestCase):
@marks.medium @marks.medium
class TestWalletTestDappMediumMultipleDevicesMerged(MultipleSharedDeviceTestCase): class TestWalletTestDappMediumMultipleDevicesMerged(MultipleSharedDeviceTestCase):
@classmethod def prepare_devices(self):
def setup_class(cls): self.user = transaction_senders['ETH_5']
cls.user = transaction_senders['ETH_5'] self.drivers, self.loop = create_shared_drivers(1)
cls.drivers, cls.loop = create_shared_drivers(1) self.sign_in = SignInView(self.drivers[0])
cls.sign_in = SignInView(cls.drivers[0]) self.home = self.sign_in.recover_access(passphrase=self.user['passphrase'])
cls.home = cls.sign_in.recover_access(passphrase=cls.user['passphrase']) self.profile = self.home.get_profile_view()
cls.profile = cls.home.get_profile_view() self.wallet = self.home.wallet_button.click()
cls.wallet = cls.home.wallet_button.click() self.wallet.wait_balance_is_changed()
cls.wallet.wait_balance_is_changed() self.wallet.just_fyi('create new account in multiaccount')
cls.wallet.just_fyi('create new account in multiaccount') self.status_account = self.home.status_account_name
cls.status_account = cls.home.status_account_name self.account_name = 'Subaccount'
cls.account_name = 'Subaccount' self.wallet.add_account(self.account_name)
cls.wallet.add_account(cls.account_name) self.sub_acc_address = self.wallet.get_wallet_address(self.account_name)
cls.sub_acc_address = cls.wallet.get_wallet_address(cls.account_name) self.home.wallet_button.double_click()
cls.home.wallet_button.double_click()
@marks.testrail_id(702324) @marks.testrail_id(702324)
def test_testdapp_request_public_key(self): def test_testdapp_request_public_key(self):