e2e: browser group

This commit is contained in:
Churikova Tetiana 2022-03-14 17:16:26 +01:00
parent 8e85d15a86
commit 2ae875f82a
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
14 changed files with 358 additions and 447 deletions

View File

@ -100,6 +100,7 @@ class TestrailReport(BaseTestReport):
test_cases['critical'] = 730 test_cases['critical'] = 730
test_cases['medium'] = 736 test_cases['medium'] = 736
test_cases['upgrade'] = 881 test_cases['upgrade'] = 881
## tests pr
test_cases['public_chat'] = 50654 test_cases['public_chat'] = 50654
test_cases['one_to_one_chat'] = 50655 test_cases['one_to_one_chat'] = 50655
test_cases['group_chat'] = 50656 test_cases['group_chat'] = 50656
@ -108,6 +109,7 @@ class TestrailReport(BaseTestReport):
test_cases['wallet'] = 50661 test_cases['wallet'] = 50661
test_cases['send_tx'] = 50662 test_cases['send_tx'] = 50662
test_cases['keycard_tx'] = 50663 test_cases['keycard_tx'] = 50663
test_cases['browser'] = 50812
test_pr = list() test_pr = list()
for key in test_cases: for key in test_cases:
if key != 'medium' and key != 'upgrade': if key != 'medium' and key != 'upgrade':

View File

@ -9,6 +9,7 @@ from tests.users import basic_user, transaction_senders, recovery_users
@pytest.mark.xdist_group(name="onboarding_1") @pytest.mark.xdist_group(name="onboarding_1")
@marks.critical
class TestOnboardingOneDeviceMerged(MultipleSharedDeviceTestCase): class TestOnboardingOneDeviceMerged(MultipleSharedDeviceTestCase):
@classmethod @classmethod
@ -24,7 +25,6 @@ class TestOnboardingOneDeviceMerged(MultipleSharedDeviceTestCase):
cls.username = cls.profile.default_username_text.text cls.username = cls.profile.default_username_text.text
@marks.testrail_id(700742) @marks.testrail_id(700742)
@marks.critical
def test_onboarding_home_initial_popup(self): def test_onboarding_home_initial_popup(self):
self.home.home_button.double_click() self.home.home_button.double_click()
texts = ["chat-and-transact", "invite-friends"] texts = ["chat-and-transact", "invite-friends"]
@ -39,7 +39,6 @@ class TestOnboardingOneDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(700743) @marks.testrail_id(700743)
@marks.critical
def test_onboarding_share_contact_address(self): def test_onboarding_share_contact_address(self):
self.profile = self.home.profile_button.click() self.profile = self.home.profile_button.click()
@ -68,7 +67,6 @@ class TestOnboardingOneDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(700744) @marks.testrail_id(700744)
@marks.critical
def test_onboarding_share_wallet_address(self): def test_onboarding_share_wallet_address(self):
self.home.just_fyi("Copying wallet address") self.home.just_fyi("Copying wallet address")
wallet = self.home.wallet_button.click() wallet = self.home.wallet_button.click()
@ -96,7 +94,6 @@ class TestOnboardingOneDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(700745) @marks.testrail_id(700745)
@marks.critical
def test_onboarding_backup_seed_phrase_restore_same_login_logcat(self): def test_onboarding_backup_seed_phrase_restore_same_login_logcat(self):
self.home.just_fyi("Check that badge on profile about back up seed phrase is presented") self.home.just_fyi("Check that badge on profile about back up seed phrase is presented")
if self.home.profile_button.counter.text != '1': if self.home.profile_button.counter.text != '1':
@ -144,7 +141,6 @@ class TestOnboardingOneDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(700746) @marks.testrail_id(700746)
@marks.critical
def test_onboarding_cant_sign_in_with_invalid_password_logcat(self): def test_onboarding_cant_sign_in_with_invalid_password_logcat(self):
self.home.profile_button.click() self.home.profile_button.click()
self.profile.logout() self.profile.logout()
@ -168,7 +164,6 @@ class TestOnboardingOneDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(700747) @marks.testrail_id(700747)
@marks.critical
def test_onboarding_add_new_multiaccount_username_by_position_pass_validation(self): def test_onboarding_add_new_multiaccount_username_by_position_pass_validation(self):
self.home.profile_button.click() self.home.profile_button.click()
self.profile.logout() self.profile.logout()
@ -227,8 +222,9 @@ class TestOnboardingOneDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@pytest.mark.xdist_group(name="recover_1") @pytest.mark.xdist_group(name="restore_1")
class TestRecoverOneDeviceMerged(MultipleSharedDeviceTestCase): @marks.critical
class TestRestoreOneDeviceMerged(MultipleSharedDeviceTestCase):
@classmethod @classmethod
def setup_class(cls): def setup_class(cls):
cls.user = transaction_senders['A'] cls.user = transaction_senders['A']
@ -240,8 +236,7 @@ class TestRecoverOneDeviceMerged(MultipleSharedDeviceTestCase):
cls.home = cls.sign_in.recover_access(passphrase=cls.passphrase, password=cls.password) cls.home = cls.sign_in.recover_access(passphrase=cls.passphrase, password=cls.password)
@marks.testrail_id(700748) @marks.testrail_id(700748)
@marks.critical def test_restore_uppercase_whitespaces_seed_phrase_special_char_passw_logcat(self):
def test_recover_uppercase_whitespaces_seed_phrase_special_char_passw_logcat(self):
profile = self.home.profile_button.click() profile = self.home.profile_button.click()
public_key, username = self.sign_in.get_public_key_and_username(return_username=True) public_key, username = self.sign_in.get_public_key_and_username(return_username=True)
@ -258,8 +253,7 @@ class TestRecoverOneDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(700749) @marks.testrail_id(700749)
@marks.critical def test_restore_set_up_wallet_sign_phrase(self):
def test_recover_set_up_wallet_sign_phrase(self):
wallet = self.sign_in.wallet_button.click() wallet = self.sign_in.wallet_button.click()
wallet.just_fyi("Initiating some transaction so the wallet signing phrase pop-up appears") wallet.just_fyi("Initiating some transaction so the wallet signing phrase pop-up appears")
@ -308,8 +302,7 @@ class TestRecoverOneDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(700750) @marks.testrail_id(700750)
@marks.critical def test_restore_validation_seed_phrase_field(self):
def test_recover_validation_seed_phrase_field(self):
validations = [ validations = [
{ {
'case': 'empty value', 'case': 'empty value',

View File

@ -588,74 +588,3 @@ class TestCreateAccount(SingleDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
class TestKeycardCreateMultiaccountMultipleDevice(MultipleDeviceTestCase):
@marks.testrail_id(5689)
@marks.critical
def test_keycard_create_login_restore_unlock_same_seed(self):
self.create_drivers(2)
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
device_1.just_fyi("Create keycard account and save seed phrase")
device_1.accept_tos_checkbox.enable()
device_1.get_started_button.click()
device_1.generate_key_button.click_until_presence_of_element(device_1.next_button)
device_1.next_button.click_until_absense_of_element(device_1.element_by_translation_id("intro-wizard-title2"))
keycard_flow = device_1.keycard_storage_button.click()
keycard_flow.confirm_pin_and_proceed()
seed_phrase = keycard_flow.backup_seed_phrase()
device_1.maybe_later_button.wait_for_visibility_of_element(30)
device_1.maybe_later_button.click_until_presence_of_element(device_1.lets_go_button)
device_1.lets_go_button.click_until_absense_of_element(device_1.lets_go_button)
device_1.profile_button.wait_for_visibility_of_element(30)
device_2.just_fyi("Restore same multiaccount from seed phrase on another device")
device_2.recover_access(seed_phrase)
device_1.just_fyi('Check that after creating keycard account balance is 0, not ...')
wallet_1 = device_1.wallet_button.click()
wallet_address = wallet_1.get_wallet_address()
wallet_1.wallet_button.double_click()
if wallet_1.status_account_total_usd_value.text != '0':
self.errors.append("Account USD value is not 0, it is %s" % wallet_1.status_account_total_usd_value.text)
public_key, default_username = device_1.get_public_key_and_username(return_username=True)
profile_1 = device_1.get_profile_view()
profile_1.logout()
profile_1.just_fyi('Check that can login with keycard account')
device_1.multi_account_on_login_button.wait_for_visibility_of_element(5)
device_1.multi_account_on_login_button.click()
if not keycard_flow.element_by_text_part(default_username).is_element_displayed():
self.errors.append("%s is not found on keycard login screen!" % default_username)
keycard_flow.enter_default_pin()
if not device_1.home_button.is_element_displayed(10):
self.errors.append('Keycard user is not logged in')
device_2.just_fyi("Check username and wallet address on another device")
wallet_2 = device_2.wallet_button.click()
wallet_address_2 = wallet_2.get_wallet_address()
wallet_2.wallet_button.double_click()
if wallet_address != wallet_address_2:
self.errors.append('Wallet address on restored multiaccount is not equal to created keycard multiaccount')
public_key_2, default_username_2 = device_2.get_public_key_and_username(return_username=True)
if public_key != public_key_2:
self.errors.append('Public key on restored multiaccount is not equal to created keycard multiaccount')
if default_username_2 != default_username:
self.errors.append('Username on restored multiaccount is not equal to created keycard multiaccount')
device_1.just_fyi('Unlock keycard multiaccount at attempt to restore same multiaccount from seed')
device_1.profile_button.click()
profile_1.logout()
device_1.access_key_button.click()
device_1.enter_seed_phrase_button.click()
device_1.seedphrase_input.click()
device_1.seedphrase_input.set_value(seed_phrase)
device_1.next_button.click()
device_1.element_by_translation_id("unlock", uppercase=True).click()
keycard_flow.enter_default_pin()
device_1_home = device_1.home_button.click()
device_1_home.plus_button.click()
if not device_1_home.start_new_chat_button.is_element_displayed():
self.errors.append("Can't proceed using account after it's re-recover twice.")
self.errors.verify_no_errors()

View File

@ -391,40 +391,6 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
self.errors.append("Support channel is not suggested for requesting a feature") self.errors.append("Support channel is not suggested for requesting a feature")
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(5738)
@marks.high
def test_dapps_permissions(self):
home = SignInView(self.driver).create_user()
account_name = home.status_account_name
home.just_fyi('open Status Test Dapp, allow all and check permissions in Profile')
web_view = home.open_status_test_dapp()
dapp = home.dapp_tab_button.click()
profile = home.profile_button.click()
profile.privacy_and_security_button.click()
profile.dapp_permissions_button.click()
profile.element_by_text(test_dapp_name).click()
if not profile.element_by_text(account_name).is_element_displayed():
self.errors.append('Wallet permission was not granted')
if not profile.element_by_translation_id("chat-key").is_element_displayed():
self.errors.append('Contact code permission was not granted')
profile.just_fyi('revoke access and check that they are asked second time')
profile.revoke_access_button.click()
profile.back_button.click()
profile.dapp_tab_button.click()
web_view.open_tabs_button.click()
web_view.empty_tab_button.click()
dapp.open_url(test_dapp_url)
if not dapp.element_by_text_part(account_name).is_element_displayed():
self.errors.append('Wallet permission is not asked')
if dapp.allow_button.is_element_displayed():
dapp.allow_button.click(times_to_click=1)
if not dapp.element_by_translation_id("your-contact-code").is_element_displayed():
self.errors.append('Profile permission is not asked')
self.errors.verify_no_errors()
@marks.testrail_id(5368) @marks.testrail_id(5368)
@marks.medium @marks.medium

View File

@ -10,6 +10,7 @@ from support.utilities import get_merged_txs_list
@pytest.mark.xdist_group(name="wallet_management_1") @pytest.mark.xdist_group(name="wallet_management_1")
@marks.critical
class TestWalletManagementDeviceMerged(MultipleSharedDeviceTestCase): class TestWalletManagementDeviceMerged(MultipleSharedDeviceTestCase):
@classmethod @classmethod
@ -27,7 +28,6 @@ class TestWalletManagementDeviceMerged(MultipleSharedDeviceTestCase):
'STT': cls.wallet.get_asset_amount_by_name('STT')} 'STT': cls.wallet.get_asset_amount_by_name('STT')}
@marks.testrail_id(700756) @marks.testrail_id(700756)
@marks.critical
def test_wallet_tx_history_copy_tx_hash_on_lte(self): def test_wallet_tx_history_copy_tx_hash_on_lte(self):
self.wallet.accounts_status_account.click() self.wallet.accounts_status_account.click()
address = wallet_users['D']['address'] address = wallet_users['D']['address']
@ -79,7 +79,6 @@ class TestWalletManagementDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(700759) @marks.testrail_id(700759)
@marks.critical
def test_wallet_add_account_generate_new(self): def test_wallet_add_account_generate_new(self):
self.wallet.just_fyi("Switching off LTE mode and navigating to home view") self.wallet.just_fyi("Switching off LTE mode and navigating to home view")
self.wallet.driver.set_network_connection(6) self.wallet.driver.set_network_connection(6)
@ -117,7 +116,6 @@ class TestWalletManagementDeviceMerged(MultipleSharedDeviceTestCase):
self.drivers[0].fail('Delete account option is shown on added account "On Status Tree"!') self.drivers[0].fail('Delete account option is shown on added account "On Status Tree"!')
@marks.testrail_id(700758) @marks.testrail_id(700758)
@marks.critical
def test_wallet_manage_assets(self): def test_wallet_manage_assets(self):
asset = "HND" asset = "HND"
self.sign_in.just_fyi("Getting back to main wallet view") self.sign_in.just_fyi("Getting back to main wallet view")
@ -146,7 +144,6 @@ class TestWalletManagementDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(700760) @marks.testrail_id(700760)
@marks.critical
def test_wallet_add_delete_watch_only_account(self): def test_wallet_add_delete_watch_only_account(self):
self.wallet.get_back_to_home_view() self.wallet.get_back_to_home_view()
self.wallet.accounts_status_account.swipe_left_on_element() self.wallet.accounts_status_account.swipe_left_on_element()
@ -195,7 +192,6 @@ class TestWalletManagementDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(700761) @marks.testrail_id(700761)
@marks.critical
def test_wallet_add_hide_unhide_account_private_key(self): def test_wallet_add_hide_unhide_account_private_key(self):
self.wallet.get_back_to_home_view() self.wallet.get_back_to_home_view()
if not self.wallet.add_account_button.is_element_displayed(3): if not self.wallet.add_account_button.is_element_displayed(3):
@ -256,7 +252,6 @@ class TestWalletManagementDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(700762) @marks.testrail_id(700762)
@marks.critical
@marks.skip @marks.skip
# TODO: skipped due to #13016 # TODO: skipped due to #13016
def test_wallet_add_account_seed_phrase_collectibles_mainnet_rinkeby(self): def test_wallet_add_account_seed_phrase_collectibles_mainnet_rinkeby(self):
@ -365,7 +360,6 @@ class TestWalletManagementDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(700766) @marks.testrail_id(700766)
@marks.high
def test_wallet_fetching_balance_after_offline_insufficient_funds_errors(self): def test_wallet_fetching_balance_after_offline_insufficient_funds_errors(self):
self.sign_in.driver.reset() self.sign_in.driver.reset()
sender = wallet_users['E'] sender = wallet_users['E']

View File

@ -4,7 +4,6 @@ from views.sign_in_view import SignInView
class TestBrowsing(SingleDeviceTestCase): class TestBrowsing(SingleDeviceTestCase):
@marks.testrail_id(5395) @marks.testrail_id(5395)
@marks.medium @marks.medium
def test_back_forward_refresh_navigation_history_kept_after_relogin(self): def test_back_forward_refresh_navigation_history_kept_after_relogin(self):
@ -48,142 +47,6 @@ class TestBrowsing(SingleDeviceTestCase):
if not element_on_start_page.is_element_displayed(30): if not element_on_start_page.is_element_displayed(30):
self.driver.fail("Page failed to be refreshed") self.driver.fail("Page failed to be refreshed")
@marks.testrail_id(6210)
@marks.high
def test_open_blocked_secure_not_secure_inlalid_offline_urls(self):
home = SignInView(self.driver).create_user()
dapp = home.dapp_tab_button.click()
for url in ('metamask.site', 'cryptokitties.domainname'):
dapp.just_fyi('Checking blocked website %s' % url)
dapp_detail = dapp.open_url(url)
dapp_detail.element_by_translation_id('browsing-site-blocked-title')
if dapp_detail.browser_refresh_page_button.is_element_displayed():
self.errors.append("Refresh button is present in blocked site")
dapp_detail.go_back_button.click()
dapp_detail.open_tabs_button.click()
dapp.element_by_text_part(url[:8]).click()
dapp_detail.continue_anyway_button.click()
if dapp_detail.element_by_text('This site is blocked').is_element_displayed():
self.errors.append("Failed to open Dapp after 'Continue anyway' tapped for %s" % url)
dapp_detail.open_tabs_button.click()
dapp_detail.empty_tab_button.click()
dapp.just_fyi('Checking connection is not secure warning')
web_page = dapp.open_url('http://www.dvwa.co.uk')
web_page.url_edit_box_lock_icon.click_until_presence_of_element(
web_page.element_by_translation_id("browser-not-secure"))
dapp_detail.open_tabs_button.click()
dapp_detail.empty_tab_button.click()
for url in ('https://www.bbc.com', 'https://instant.airswap.io'):
dapp.just_fyi('Checking connection is secure for %s' % url)
web_page = dapp.open_url(url)
web_page.wait_for_d_aap_to_load()
web_page.url_edit_box_lock_icon.click_until_presence_of_element(
web_page.element_by_translation_id("browser-secure"))
dapp_detail.open_tabs_button.click()
dapp_detail.empty_tab_button.click()
dapp.just_fyi('Checking opening invalid link')
# home.dapp_tab_button.double_click()
browsing_view = dapp.open_url('invalid.takoe')
browsing_view.element_by_translation_id("web-view-error").wait_for_element(20)
browsing_view.dapp_tab_button.double_click()
dapp.just_fyi('Checking offline state')
home.toggle_airplane_mode()
dapp_detail.open_tabs_button.click()
dapp_detail.empty_tab_button.click()
browsing_view = dapp.open_url('status.im')
offline_texts = ['Unable to load page', 'ERR_INTERNET_DISCONNECTED']
for text in offline_texts:
browsing_view.element_by_text_part(text).wait_for_element(15)
home.toggle_airplane_mode()
browsing_view.browser_refresh_page_button.click_until_presence_of_element(
browsing_view.element_by_text_part('An Open Source Community'))
self.errors.verify_no_errors()
@marks.testrail_id(5390)
@marks.high
def test_delete_close_all_tabs(self):
home_view = SignInView(self.driver).create_user()
dapp_view = home_view.dapp_tab_button.click()
urls = {
'google.com': 'Google',
'status.im': 'Status - Private',
'bbc.com': 'bbc.com'
}
for url in urls:
browsing_view = dapp_view.open_url(url)
browsing_view.open_tabs_button.click()
browsing_view.empty_tab_button.click()
home_view.just_fyi('Close one tab, relogin and check that it is not reappearing')
browsing_view.remove_tab(name=urls['bbc.com'])
home_view.relogin()
home_view.dapp_tab_button.click()
browsing_view.open_tabs_button.click()
if browsing_view.element_by_text_part(urls['bbc.com']).is_element_displayed():
self.errors.append('Closed tab is present after re-login')
home_view.just_fyi('Close all tabs via "Close all", relogin and check that it is not reappearing')
browsing_view.close_all_button.click()
home_view.relogin()
home_view.dapp_tab_button.click()
browsing_view.open_tabs_button.click()
for url in urls:
if browsing_view.element_by_text_part(urls[url]).is_element_displayed():
self.errors.append('Closed tab %s present after re-login after "Close all"' % url)
self.errors.verify_no_errors()
@marks.testrail_id(6633)
@marks.high
def test_browser_managing_bookmarks(self):
home_view = SignInView(self.driver).create_user()
dapp_view = home_view.dapp_tab_button.click()
home_view.just_fyi('Add some url to bookmarks with default name')
browsing_view = dapp_view.open_url('status.im')
default_bookmark_name = browsing_view.add_to_bookmarks()
browsing_view.browser_previous_page_button.click()
if not browsing_view.element_by_text(default_bookmark_name).is_element_displayed():
self.errors.append("Bookmark with default name is not added!")
home_view.just_fyi('Add some url to bookmarks with custom name')
custom_name = 'Custom BBC'
dapp_view.open_url('bbc.com')
browsing_view.add_to_bookmarks(custom_name)
browsing_view.open_tabs_button.click()
browsing_view.empty_tab_button.click()
if not browsing_view.element_by_text(custom_name).is_element_displayed():
self.driver.fail("Bookmark with custom name is not added!")
home_view.just_fyi('Check deleting bookmark on long tap and that it is deleted after relogin')
dapp_view.browser_entry_long_press(custom_name)
dapp_view.delete_bookmark_button.click()
if browsing_view.element_by_text(custom_name).is_element_displayed():
self.errors.append("Bookmark with custom name is not deleted!")
profile_view = dapp_view.profile_button.click()
profile_view.relogin()
profile_view.dapp_tab_button.click()
if browsing_view.element_by_text(custom_name).is_element_displayed():
self.errors.append("Bookmark with custom name is reappeared after relogin!")
home_view.just_fyi('Check "Edit bookmark" and "Open in new tab"')
edited_name = 'My Fav Status'
dapp_view.browser_entry_long_press(default_bookmark_name)
dapp_view.edit_bookmark_button.click()
browsing_view.edit_bookmark_name(edited_name)
if not browsing_view.element_by_text(edited_name).is_element_displayed():
self.driver.fail("Edited bookmark name is not shown!")
dapp_view.browser_entry_long_press(edited_name)
dapp_view.open_in_new_tab_button.click()
browsing_view.options_button.click()
if not browsing_view.element_by_translation_id('remove-favourite').is_element_displayed():
self.errors.append("Remove favourite is not shown on added bookmark!")
self.errors.verify_no_errors()
@marks.testrail_id(5424) @marks.testrail_id(5424)
@marks.medium @marks.medium
def test_open_url_with_non_english_text_connect_revoke_wallet_new_tab_open_chat_options(self): def test_open_url_with_non_english_text_connect_revoke_wallet_new_tab_open_chat_options(self):

View File

@ -8,7 +8,6 @@ from views.sign_in_view import SignInView
class TestDeepLinks(SingleDeviceTestCase): class TestDeepLinks(SingleDeviceTestCase):
@marks.testrail_id(5441) @marks.testrail_id(5441)
@marks.medium @marks.medium
def test_open_user_profile_using_deep_link(self): def test_open_user_profile_using_deep_link(self):

View File

@ -6,14 +6,15 @@ import emoji
import pytest import pytest
from dateutil import parser from dateutil import parser
from tests import marks from tests import marks, test_dapp_name, test_dapp_url
from tests.base_test_case import MultipleDeviceTestCase, SingleDeviceTestCase, create_shared_drivers, \ from tests.base_test_case import MultipleDeviceTestCase, create_shared_drivers, \
MultipleSharedDeviceTestCase MultipleSharedDeviceTestCase
from views.sign_in_view import SignInView from views.sign_in_view import SignInView
from selenium.common.exceptions import NoSuchElementException from selenium.common.exceptions import NoSuchElementException
@pytest.mark.xdist_group(name="public_chat_2") @pytest.mark.xdist_group(name="public_chat_2")
@marks.critical
class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase): class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase):
@classmethod @classmethod
@ -33,8 +34,7 @@ class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase):
cls.chat_1.send_message(cls.text_message) cls.chat_1.send_message(cls.text_message)
@marks.testrail_id(5313) @marks.testrail_id(5313)
@marks.critical def test_public_chat_message_send_check_timestamps_while_on_different_tab(self):
def test_public_message_send_check_timestamps_while_on_different_tab(self):
message = self.text_message message = self.text_message
self.chat_2.dapp_tab_button.click() self.chat_2.dapp_tab_button.click()
sent_time_variants = self.chat_1.convert_device_time_to_chat_timestamp() sent_time_variants = self.chat_1.convert_device_time_to_chat_timestamp()
@ -49,8 +49,7 @@ class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(700734) @marks.testrail_id(700734)
@marks.critical def test_public_chat_message_edit(self):
def test_public_message_edit(self):
message_before_edit, message_after_edit = self.text_message, "Message AFTER edit 2" message_before_edit, message_after_edit = self.text_message, "Message AFTER edit 2"
self.chat_1.edit_message_in_chat(message_before_edit, message_after_edit) self.chat_1.edit_message_in_chat(message_before_edit, message_after_edit)
for chat in (self.chat_1, self.chat_2): for chat in (self.chat_1, self.chat_2):
@ -61,8 +60,7 @@ class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(700735) @marks.testrail_id(700735)
@marks.critical def test_public_chat_message_delete(self):
def test_public_message_delete(self):
message_to_delete = 'delete me, please' message_to_delete = 'delete me, please'
self.chat_1.send_message(message_to_delete) self.chat_1.send_message(message_to_delete)
self.chat_1.delete_message_in_chat(message_to_delete) self.chat_1.delete_message_in_chat(message_to_delete)
@ -72,8 +70,7 @@ class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(700719) @marks.testrail_id(700719)
@marks.critical def test_public_chat_emoji_send_copy_paste_reply(self):
def test_public_emoji_send_copy_paste_reply(self):
emoji_name = random.choice(list(emoji.EMOJI_UNICODE)) emoji_name = random.choice(list(emoji.EMOJI_UNICODE))
emoji_unicode = emoji.EMOJI_UNICODE[emoji_name] emoji_unicode = emoji.EMOJI_UNICODE[emoji_name]
emoji_message = emoji.emojize(emoji_name) emoji_message = emoji.emojize(emoji_name)
@ -100,8 +97,7 @@ class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(5360) @marks.testrail_id(5360)
@marks.critical def test_public_chat_unread_messages_counter(self):
def test_public_unread_messages_counter(self):
self.chat_1.send_message('пиу') self.chat_1.send_message('пиу')
home_1 = self.chat_1.home_button.click() home_1 = self.chat_1.home_button.click()
message = 'test message' message = 'test message'
@ -114,8 +110,7 @@ class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(700718) @marks.testrail_id(700718)
@marks.critical def test_public_chat_unread_messages_counter_for_mention_relogin(self):
def test_public_unread_messages_counter_for_mentions_relogin(self):
message = 'test message2' message = 'test message2'
[chat.home_button.double_click() for chat in (self.chat_1, self.chat_2)] [chat.home_button.double_click() for chat in (self.chat_1, self.chat_2)]
chat_element = self.home_1.get_chat('#' + self.public_chat_name) chat_element = self.home_1.get_chat('#' + self.public_chat_name)
@ -140,8 +135,7 @@ class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(5319) @marks.testrail_id(5319)
@marks.critical def test_public_chat_delete_chat_long_press(self):
def test_public_delete_chat_long_press(self):
[chat.home_button.double_click() for chat in (self.chat_1, self.chat_2)] [chat.home_button.double_click() for chat in (self.chat_1, self.chat_2)]
self.home_1.delete_chat_long_press('#%s' % self.pub_chat_delete_long_press) self.home_1.delete_chat_long_press('#%s' % self.pub_chat_delete_long_press)
self.home_2.just_fyi("Send message to deleted chat") self.home_2.just_fyi("Send message to deleted chat")
@ -154,8 +148,7 @@ class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase):
self.drivers[0].fail('Deleted public chat reappears after relogin') self.drivers[0].fail('Deleted public chat reappears after relogin')
@marks.testrail_id(700736) @marks.testrail_id(700736)
@marks.critical def test_public_chat_link_send_open(self):
def test_public_link_send_open(self):
[chat.home_button.double_click() for chat in (self.chat_1, self.chat_2)] [chat.home_button.double_click() for chat in (self.chat_1, self.chat_2)]
[home.get_chat('#' + self.public_chat_name).click() for home in (self.home_1, self.home_2)] [home.get_chat('#' + self.public_chat_name).click() for home in (self.home_1, self.home_2)]
url_message = 'http://status.im' url_message = 'http://status.im'
@ -166,8 +159,7 @@ class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase):
self.drivers[0].fail('URL was not opened from public chat') self.drivers[0].fail('URL was not opened from public chat')
@marks.testrail_id(700737) @marks.testrail_id(700737)
@marks.critical def test_public_chat_links_with_previews_github_youtube_twitter_gif_send_enable(self):
def test_public_links_with_previews_github_youtube_twitter_gif_send_enable(self):
[chat.home_button.double_click() for chat in (self.chat_1, self.chat_2)] [chat.home_button.double_click() for chat in (self.chat_1, self.chat_2)]
[home.get_chat('#' + self.public_chat_name).click() for home in (self.home_1, self.home_2)] [home.get_chat('#' + self.public_chat_name).click() for home in (self.home_1, self.home_2)]
giphy_url = 'https://giphy.com/gifs/this-is-fine-QMHoU66sBXqqLqYvGO' giphy_url = 'https://giphy.com/gifs/this-is-fine-QMHoU66sBXqqLqYvGO'
@ -210,8 +202,7 @@ class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(6270) @marks.testrail_id(6270)
@marks.critical def test_public_chat_mark_all_messages_as_read(self):
def test_public_mark_all_messages_as_read(self):
[chat.home_button.double_click() for chat in (self.chat_1, self.chat_2)] [chat.home_button.double_click() for chat in (self.chat_1, self.chat_2)]
self.home_2.get_chat('#' + self.public_chat_name).click() self.home_2.get_chat('#' + self.public_chat_name).click()
self.chat_2.send_message(self.text_message) self.chat_2.send_message(self.text_message)
@ -231,8 +222,9 @@ class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@pytest.mark.xdist_group(name="public_chat_1") @pytest.mark.xdist_group(name="public_chat_browser_1")
class TestPublicChatOneDeviceMerged(MultipleSharedDeviceTestCase): @marks.critical
class TestPublicChatBrowserOneDeviceMerged(MultipleSharedDeviceTestCase):
@classmethod @classmethod
def setup_class(cls): def setup_class(cls):
@ -244,8 +236,7 @@ class TestPublicChatOneDeviceMerged(MultipleSharedDeviceTestCase):
cls.chat = cls.home.join_public_chat(cls.public_chat_name) cls.chat = cls.home.join_public_chat(cls.public_chat_name)
@marks.testrail_id(5675) @marks.testrail_id(5675)
@marks.critical def test_public_chat_fetch_more_history(self):
def test_public_fetch_more_history(self):
self.home.just_fyi("Check that can fetch previous history for several days") self.home.just_fyi("Check that can fetch previous history for several days")
device_time = parser.parse(self.drivers[0].device_time) device_time = parser.parse(self.drivers[0].device_time)
yesterday = (device_time - timedelta(days=1)).strftime("%b %-d, %Y") yesterday = (device_time - timedelta(days=1)).strftime("%b %-d, %Y")
@ -287,8 +278,7 @@ class TestPublicChatOneDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(5396) @marks.testrail_id(5396)
@marks.critical def test_public_chat_navigate_to_chat_when_relaunch(self):
def test_public_navigate_to_chat_when_relaunch(self):
text_message = 'some_text' text_message = 'some_text'
self.home.home_button.double_click() self.home.home_button.double_click()
self.home.get_chat('#%s' % self.public_chat_name).click() self.home.get_chat('#%s' % self.public_chat_name).click()
@ -298,8 +288,7 @@ class TestPublicChatOneDeviceMerged(MultipleSharedDeviceTestCase):
self.drivers[0].fail("Not navigated to chat view after reopening app") self.drivers[0].fail("Not navigated to chat view after reopening app")
@marks.testrail_id(700738) @marks.testrail_id(700738)
@marks.critical def test_public_chat_tag_message(self):
def test_public_tag_message(self):
tag_message = '#wuuut' tag_message = '#wuuut'
self.home.home_button.double_click() self.home.home_button.double_click()
self.home.get_chat('#%s' % self.public_chat_name).click() self.home.get_chat('#%s' % self.public_chat_name).click()
@ -316,7 +305,6 @@ class TestPublicChatOneDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(700739) @marks.testrail_id(700739)
@marks.critical
def test_public_chat_open_using_deep_link(self): def test_public_chat_open_using_deep_link(self):
self.drivers[0].close_app() self.drivers[0].close_app()
chat_name = self.home.get_random_chat_name() chat_name = self.home.get_random_chat_name()
@ -327,6 +315,164 @@ class TestPublicChatOneDeviceMerged(MultipleSharedDeviceTestCase):
except (AssertionError, NoSuchElementException): except (AssertionError, NoSuchElementException):
self.driver.fail("Public chat '%s' is not opened" % chat_name) self.driver.fail("Public chat '%s' is not opened" % chat_name)
@marks.testrail_id(702072)
def test_browser_blocked_url(self):
dapp = self.home.dapp_tab_button.click()
for url in ('metamask.site', 'cryptokitties.domainname'):
dapp.just_fyi('Checking blocked website %s' % url)
dapp_detail = dapp.open_url(url)
dapp_detail.element_by_translation_id('browsing-site-blocked-title')
if dapp_detail.browser_refresh_page_button.is_element_displayed():
self.errors.append("Refresh button is present in blocked site")
dapp_detail.go_back_button.click()
dapp_detail.open_tabs_button.click()
dapp.element_by_text_part(url[:8]).click()
dapp_detail.continue_anyway_button.click()
if dapp_detail.element_by_text('This site is blocked').is_element_displayed():
self.errors.append("Failed to open Dapp after 'Continue anyway' tapped for %s" % url)
dapp_detail.open_tabs_button.click()
dapp_detail.empty_tab_button.click()
self.errors.verify_no_errors()
@marks.testrail_id(702073)
def test_browser_connection_is_secure_not_secure_warning(self):
dapp = self.home.dapp_tab_button.click()
web_page = dapp.open_url('http://www.dvwa.co.uk')
web_page.url_edit_box_lock_icon.click_until_presence_of_element(
web_page.element_by_translation_id("browser-not-secure"))
web_page.open_tabs_button.click()
web_page.empty_tab_button.click()
dapp.just_fyi('Checking connection is secure for Airswap')
web_page = dapp.open_url('https://instant.airswap.io')
web_page.wait_for_d_aap_to_load()
web_page.url_edit_box_lock_icon.click_until_presence_of_element(
web_page.element_by_translation_id("browser-secure"))
web_page.open_tabs_button.click()
web_page.empty_tab_button.click()
@marks.testrail_id(702074)
def test_browser_invalid_url(self):
dapp = self.home.dapp_tab_button.click()
browsing_view = dapp.open_url('invalid.takoe')
browsing_view.element_by_translation_id("web-view-error").wait_for_element(20)
@marks.testrail_id(702075)
def test_browser_offline(self):
dapp = self.home.dapp_tab_button.click()
self.home.toggle_airplane_mode()
browsing_view = dapp.open_url('status.im')
offline_texts = ['Unable to load page', 'ERR_INTERNET_DISCONNECTED']
for text in offline_texts:
browsing_view.element_by_text_part(text).wait_for_element(15)
self.home.toggle_airplane_mode()
browsing_view.browser_refresh_page_button.click_until_presence_of_element(
browsing_view.element_by_text_part('An Open Source Community'))
@marks.testrail_id(702076)
def test_browser_delete_close_tabs(self):
dapp = self.home.dapp_tab_button.click()
urls = {
'google.com': 'Google',
'status.im': 'Status - Private',
'bbc.com': 'bbc.com'
}
for url in urls:
web_page = dapp.open_url(url)
web_page.open_tabs_button.click()
web_page.empty_tab_button.click()
self.home.just_fyi('Delete one tab')
web_page.remove_tab(name=urls['bbc.com'])
if web_page.element_by_text_part(urls['bbc.com']).is_element_displayed():
self.errors.append('Closed tab is present after deletion')
self.home.just_fyi('Close all tabs via "Close all", relogin and check that it is not reappearing')
web_page.close_all_button.click()
self.home.reopen_app()
web_page.dapp_tab_button.click()
web_page.open_tabs_button.click()
if web_page.element_by_text_part(urls['status.im']).is_element_displayed():
self.errors.append('Tabs are not closed or reappeared after re-login!')
self.errors.verify_no_errors()
@marks.testrail_id(702077)
def test_browser_bookmarks_create_edit_remove(self):
dapp = self.home.dapp_tab_button.click()
self.home.just_fyi('Add some url to bookmarks with default name')
web_page = dapp.open_url('status.im')
default_bookmark_name = web_page.add_to_bookmarks()
web_page.browser_previous_page_button.click()
if not web_page.element_by_text(default_bookmark_name).is_element_displayed():
self.errors.append("Bookmark with default name is not added!")
self.home.just_fyi('Add some url to bookmarks with custom name')
custom_name = 'Custom BBC'
dapp.open_url('bbc.com')
web_page.add_to_bookmarks(custom_name)
web_page.open_tabs_button.click()
web_page.empty_tab_button.click()
if not web_page.element_by_text(custom_name).is_element_displayed():
self.driver.fail("Bookmark with custom name is not added!")
self.home.just_fyi('Checking "Open in new tab"')
dapp.browser_entry_long_press(custom_name)
dapp.open_in_new_tab_button.click()
web_page.options_button.click()
if not web_page.element_by_translation_id('remove-favourite').is_element_displayed():
self.errors.append("Remove favourite is not shown on added bookmark!")
dapp.click_system_back_button()
self.home.just_fyi('Check deleting bookmark')
web_page.open_tabs_button.click()
web_page.empty_tab_button.click()
dapp.browser_entry_long_press(custom_name)
dapp.delete_bookmark_button.click()
if web_page.element_by_text(custom_name).is_element_displayed():
self.errors.append("Bookmark with custom name is not deleted!")
self.home.just_fyi('Check "Edit bookmark" and "Open in new tab"')
edited_name = 'My Fav Status'
dapp.browser_entry_long_press(default_bookmark_name)
dapp.edit_bookmark_button.click()
web_page.edit_bookmark_name(edited_name)
if not web_page.element_by_text(edited_name).is_element_displayed():
self.driver.fail("Edited bookmark name is not shown!")
self.errors.verify_no_errors()
@marks.testrail_id(702078)
def test_browser_web3_permissions_testdapp(self):
self.home.home_button.double_click()
self.home.just_fyi('open Status Test Dapp, allow all and check permissions in Profile')
web_view = self.home.open_status_test_dapp()
dapp = self.home.dapp_tab_button.click()
profile = self.home.profile_button.click()
profile.privacy_and_security_button.click()
profile.dapp_permissions_button.click()
profile.element_by_text(test_dapp_name).click()
if not profile.element_by_text(self.home.status_account_name).is_element_displayed():
self.errors.append('Wallet permission was not granted')
if not profile.element_by_translation_id("chat-key").is_element_displayed():
self.errors.append('Contact code permission was not granted')
profile.just_fyi('revoke access and check that they are asked second time')
profile.revoke_access_button.click()
profile.back_button.click()
profile.dapp_tab_button.click()
web_view.open_tabs_button.click()
web_view.empty_tab_button.click()
dapp.open_url(test_dapp_url)
if not dapp.element_by_text_part(self.home.status_account_name).is_element_displayed():
self.errors.append('Wallet permission is not asked')
if dapp.allow_button.is_element_displayed():
dapp.allow_button.click(times_to_click=1)
if not dapp.element_by_translation_id("your-contact-code").is_element_displayed():
self.errors.append('Profile permission is not asked')
self.errors.verify_no_errors()
class TestPublicChatMultipleDevice(MultipleDeviceTestCase): class TestPublicChatMultipleDevice(MultipleDeviceTestCase):

View File

@ -1,127 +0,0 @@
from tests import marks, unique_password, common_password
from tests.base_test_case import SingleDeviceTestCase
from tests.users import transaction_senders
from views.sign_in_view import SignInView
class TestTransactionDApp(SingleDeviceTestCase):
@marks.testrail_id(5309)
@marks.critical
@marks.transaction
def test_request_stt_from_dapp(self):
sender = transaction_senders['ETH_STT_4']
home = SignInView(self.driver).recover_access(sender['passphrase'], unique_password)
wallet = home.wallet_button.click()
wallet.scan_tokens()
initial_amount_stt = wallet.get_asset_amount_by_name('STT')
status_test_dapp = home.open_status_test_dapp()
status_test_dapp.wait_for_d_aap_to_load()
status_test_dapp.assets_button.click()
status_test_dapp.request_stt_button.wait_for_element(60)
send_transaction = status_test_dapp.request_stt_button.click()
if not send_transaction.onboarding_message.is_element_displayed(30):
self.driver.fail('It seems onboarding screen is not shown.')
home.ok_got_it_button.click()
home.cancel_button.click()
send_transaction = status_test_dapp.request_stt_button.click()
send_transaction.sign_transaction(unique_password)
status_test_dapp.wallet_button.click()
send_transaction.just_fyi('Verify that wallet balance is updated')
wallet.wait_balance_is_changed('STT', initial_amount_stt, scan_tokens=True)
send_transaction.just_fyi('Check logcat for sensitive data')
values_in_logcat = send_transaction.find_values_in_logcat(password=unique_password)
if values_in_logcat:
self.driver.fail(values_in_logcat)
@marks.testrail_id(5342)
@marks.critical
@marks.transaction
def test_sign_message_and_2tx_in_batch_and_transactions_filters_from_daap(self):
password = 'password_for_daap'
home = SignInView(self.driver).recover_access(passphrase=transaction_senders['ETH_9']['passphrase'],
password=password)
wallet = home.wallet_button.click()
status_test_dapp = home.open_status_test_dapp()
status_test_dapp.wait_for_d_aap_to_load()
status_test_dapp.transactions_button.click()
wallet.just_fyi("Checking signing message")
send_transaction = status_test_dapp.sign_message_button.click()
status_test_dapp.set_up_wallet_when_sending_tx()
if not send_transaction.element_by_text("Test message").is_element_displayed():
self.errors.append("No message shown when signing!")
send_transaction.enter_password_input.send_keys(password)
send_transaction.sign_button.click()
if not status_test_dapp.element_by_text_part('Signed message').is_element_displayed():
self.errors.append('Message was not signed')
send_transaction.just_fyi('Check logcat for sensitive data')
values_in_logcat = send_transaction.find_values_in_logcat(password=password)
if values_in_logcat:
self.errors.append("When signing message from dapp: %s" % values_in_logcat)
wallet.just_fyi("Checking send 2 txs in batch")
status_test_dapp.send_two_tx_in_batch_button.scroll_to_element()
send_transaction = status_test_dapp.send_two_tx_in_batch_button.click()
send_transaction.sign_transaction(password)
if not send_transaction.sign_with_password.is_element_displayed(10):
self.driver.fail('Second send transaction screen did not appear!')
send_transaction.sign_transaction(password)
wallet.just_fyi("Checking send 2 txs one after another")
status_test_dapp.send_two_tx_one_by_one_button.scroll_to_element()
send_transaction = status_test_dapp.send_two_tx_one_by_one_button.click()
send_transaction.sign_transaction(password)
if not send_transaction.sign_with_password.is_element_displayed(20):
self.driver.fail('Second send transaction screen did not appear!')
send_transaction.sign_transaction(password)
wallet.just_fyi("Checking test filters")
status_test_dapp.test_filters_button.scroll_and_click()
for element in status_test_dapp.element_by_text('eth_uninstallFilter'), status_test_dapp.ok_button:
if element.is_element_displayed(10):
self.driver.fail("'Test filters' button produced an error")
self.errors.verify_no_errors()
@marks.testrail_id(5784)
@marks.medium
@marks.transaction
def test_sign_typed_message_deploy_simple_contract_request_pub_key_from_dapp(self):
user = transaction_senders['ETH_5']
home = SignInView(self.driver).recover_access(passphrase=user['passphrase'])
home.just_fyi("Checking requesting public key from dapp")
status_test_dapp = home.open_status_test_dapp(allow_all=False)
status_test_dapp.status_api_button.click_until_presence_of_element(status_test_dapp.request_contact_code_button)
status_test_dapp.request_contact_code_button.click_until_presence_of_element(status_test_dapp.deny_button)
status_test_dapp.deny_button.click()
if status_test_dapp.element_by_text(user['public_key']).is_element_displayed():
self.errors.append('Public key is returned but access was not allowed')
status_test_dapp.request_contact_code_button.click_until_presence_of_element(status_test_dapp.deny_button)
status_test_dapp.allow_button.click()
if not status_test_dapp.element_by_text(user['public_key']).is_element_displayed():
self.errors.append('Public key is not returned')
status_test_dapp.get_empty_dapp_tab()
home.wallet_button.click()
home.just_fyi("Checking sign typed message")
home.open_status_test_dapp(allow_all=True)
status_test_dapp.transactions_button.click_until_presence_of_element(status_test_dapp.sign_typed_message_button)
send_transaction = status_test_dapp.sign_typed_message_button.click()
send_transaction.enter_password_input.send_keys(common_password)
send_transaction.sign_button.click_until_absense_of_element(send_transaction.sign_button)
if not status_test_dapp.element_by_text_part('0x1673d96e836').is_element_displayed(30):
self.errors.append("Hash of signed typed message is not shown!")
home.just_fyi("Checking deploy simple contract")
send_transaction = status_test_dapp.deploy_contract_button.click()
send_transaction.sign_transaction()
if not status_test_dapp.element_by_text('Contract deployed at: ').is_element_displayed(240):
self.errors.append('Contract was not created')
for text in ['Call contract get function',
'Call contract set function', 'Call function 2 times in a row']:
status_test_dapp.element_by_text(text).scroll_to_element()
self.errors.verify_no_errors()

View File

@ -7,6 +7,7 @@ from views.sign_in_view import SignInView
@pytest.mark.xdist_group(name="keycard_tx_1") @pytest.mark.xdist_group(name="keycard_tx_1")
@marks.critical
class TestKeycardTxOneDeviceMerged(MultipleSharedDeviceTestCase): class TestKeycardTxOneDeviceMerged(MultipleSharedDeviceTestCase):
@classmethod @classmethod
def setup_class(cls): def setup_class(cls):
@ -24,7 +25,6 @@ class TestKeycardTxOneDeviceMerged(MultipleSharedDeviceTestCase):
cls.initial_balances[asset] = cls.wallet.get_asset_amount_by_name(asset) cls.initial_balances[asset] = cls.wallet.get_asset_amount_by_name(asset)
@marks.testrail_id(700767) @marks.testrail_id(700767)
@marks.critical
def test_keycard_send_tx_eth(self): def test_keycard_send_tx_eth(self):
wallet = self.home.wallet_button.click() wallet = self.home.wallet_button.click()
transaction_amount = wallet.get_unique_amount() transaction_amount = wallet.get_unique_amount()
@ -39,7 +39,6 @@ class TestKeycardTxOneDeviceMerged(MultipleSharedDeviceTestCase):
self.wallet.wait_balance_is_changed('ETH', initial_balance=self.initial_balances['ETH']) self.wallet.wait_balance_is_changed('ETH', initial_balance=self.initial_balances['ETH'])
@marks.testrail_id(700768) @marks.testrail_id(700768)
@marks.critical
def test_keycard_relogin_after_restore(self): def test_keycard_relogin_after_restore(self):
self.sign_in.just_fyi('Check that username and public key match expected') self.sign_in.just_fyi('Check that username and public key match expected')
public_key, default_username = self.sign_in.get_public_key_and_username(return_username=True) public_key, default_username = self.sign_in.get_public_key_and_username(return_username=True)
@ -58,7 +57,6 @@ class TestKeycardTxOneDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(700769) @marks.testrail_id(700769)
@marks.critical
@marks.transaction @marks.transaction
def test_keycard_send_tx_sign_message_request_stt_testdapp(self): def test_keycard_send_tx_sign_message_request_stt_testdapp(self):
self.home.home_button.double_click() self.home.home_button.double_click()
@ -107,7 +105,6 @@ class TestKeycardTxOneDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(700770) @marks.testrail_id(700770)
@marks.critical
def test_keycard_wallet_recover_pairing_check_balance_after_offline_tx_history(self): def test_keycard_wallet_recover_pairing_check_balance_after_offline_tx_history(self):
user = transaction_senders['A'] user = transaction_senders['A']
self.sign_in.toggle_airplane_mode() self.sign_in.toggle_airplane_mode()
@ -156,6 +153,73 @@ class TestKeycardTxOneDeviceMerged(MultipleSharedDeviceTestCase):
transactions_details.close_button.click() transactions_details.close_button.click()
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(5689)
def test_keycard_create_account_unlock_same_seed(self):
self.sign_in.driver.reset()
self.sign_in.just_fyi("Create keycard account and save seed phrase")
self.sign_in.accept_tos_checkbox.enable()
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.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.confirm_pin_and_proceed()
seed_phrase = keycard_flow.backup_seed_phrase()
self.sign_in.maybe_later_button.wait_for_visibility_of_element(30)
self.sign_in.maybe_later_button.click_until_presence_of_element(self.sign_in.lets_go_button)
self.sign_in.lets_go_button.click_until_absense_of_element(self.sign_in.lets_go_button)
self.sign_in.profile_button.wait_for_visibility_of_element(30)
self.sign_in.just_fyi('Check that after creating keycard account balance is 0, not ...')
wallet_1 = self.sign_in.wallet_button.click()
wallet_address = wallet_1.get_wallet_address()
wallet_1.wallet_button.double_click()
if wallet_1.status_account_total_usd_value.text != '0':
self.errors.append("Account USD value is not 0, it is %s" % wallet_1.status_account_total_usd_value.text)
public_key, default_username = self.sign_in.get_public_key_and_username(return_username=True)
profile_1 = self.sign_in.get_profile_view()
profile_1.logout()
profile_1.just_fyi('Check that can re-login with keycard account after account creation')
self.sign_in.multi_account_on_login_button.wait_for_visibility_of_element(5)
self.sign_in.multi_account_on_login_button.click()
if not keycard_flow.element_by_text_part(default_username).is_element_displayed():
self.errors.append("%s is not found on keycard login screen!" % default_username)
keycard_flow.enter_default_pin()
if not self.sign_in.home_button.is_element_displayed(10):
self.errors.append('Keycard user is not logged in')
self.sign_in.just_fyi('Unlock keycard multiaccount at attempt to restore same multiaccount from seed')
self.sign_in.profile_button.click()
profile_1.logout()
self.sign_in.access_key_button.click()
self.sign_in.enter_seed_phrase_button.click()
self.sign_in.seedphrase_input.click()
self.sign_in.seedphrase_input.set_value(seed_phrase)
self.sign_in.next_button.click()
self.sign_in.element_by_translation_id("unlock", uppercase=True).click()
keycard_flow.enter_default_pin()
device_1_home = self.sign_in.home_button.click()
device_1_home.plus_button.click()
if not device_1_home.start_new_chat_button.is_element_displayed():
self.errors.append("Can't proceed using account after it's re-recover twice.")
self.sign_in.just_fyi("Restore same multiaccount from backed up seed phrase on another device")
self.sign_in.driver.reset()
self.sign_in.recover_access(seed_phrase)
self.sign_in.just_fyi("Check username and wallet address on restored account")
wallet_2 = self.sign_in.wallet_button.click()
wallet_address_2 = wallet_2.get_wallet_address()
wallet_2.wallet_button.double_click()
if wallet_address != wallet_address_2:
self.errors.append('Wallet address on restored multiaccount is not equal to created keycard multiaccount')
public_key_2, default_username_2 = self.sign_in.get_public_key_and_username(return_username=True)
if public_key != public_key_2:
self.errors.append('Public key on restored multiaccount is not equal to created keycard multiaccount')
if default_username_2 != default_username:
self.errors.append('Username on restored multiaccount is not equal to created keycard multiaccount')
self.errors.verify_no_errors()
class TestTransactionWalletSingleDevice(SingleDeviceTestCase): class TestTransactionWalletSingleDevice(SingleDeviceTestCase):

View File

@ -3,13 +3,15 @@ import string
import pytest import pytest
from tests import marks, common_password from tests import marks, common_password
from tests.base_test_case import SingleDeviceTestCase, MultipleDeviceTestCase, MultipleSharedDeviceTestCase, create_shared_drivers from tests.base_test_case import SingleDeviceTestCase, MultipleDeviceTestCase, MultipleSharedDeviceTestCase,\
from tests.users import transaction_senders, basic_user, wallet_users, ens_user_ropsten, ens_user, transaction_recipients create_shared_drivers
from tests.users import transaction_senders, basic_user, wallet_users, ens_user_ropsten, ens_user
from views.send_transaction_view import SendTransactionView from views.send_transaction_view import SendTransactionView
from views.sign_in_view import SignInView from views.sign_in_view import SignInView
@pytest.mark.xdist_group(name="send_tx_1") @pytest.mark.xdist_group(name="send_tx_1")
@marks.critical
class TestSendTxDeviceMerged(MultipleSharedDeviceTestCase): class TestSendTxDeviceMerged(MultipleSharedDeviceTestCase):
@classmethod @classmethod
def setup_class(cls): def setup_class(cls):
@ -29,7 +31,6 @@ class TestSendTxDeviceMerged(MultipleSharedDeviceTestCase):
cls.wallet.send_transaction(amount=cls.amount_adi, recipient=cls.recipient_address, asset_name='ADI') cls.wallet.send_transaction(amount=cls.amount_adi, recipient=cls.recipient_address, asset_name='ADI')
@marks.testrail_id(700763) @marks.testrail_id(700763)
@marks.critical
@marks.transaction @marks.transaction
def test_send_tx_eth_check_logcat(self): def test_send_tx_eth_check_logcat(self):
self.wallet.just_fyi('Check that transaction is appeared in tx history') self.wallet.just_fyi('Check that transaction is appeared in tx history')
@ -44,7 +45,6 @@ class TestSendTxDeviceMerged(MultipleSharedDeviceTestCase):
self.wallet.driver.fail(values_in_logcat) self.wallet.driver.fail(values_in_logcat)
@marks.testrail_id(700764) @marks.testrail_id(700764)
@marks.critical
@marks.transaction @marks.transaction
def test_send_tx_token_7_decimals(self): def test_send_tx_token_7_decimals(self):
asset = 'ADI' asset = 'ADI'
@ -54,8 +54,56 @@ class TestSendTxDeviceMerged(MultipleSharedDeviceTestCase):
self.network_api.find_transaction_by_hash(transaction_adi) self.network_api.find_transaction_by_hash(transaction_adi)
self.wallet.wait_balance_is_changed(asset, initial_balance=self.initial_balances[asset]) self.wallet.wait_balance_is_changed(asset, initial_balance=self.initial_balances[asset])
@marks.testrail_id(5342)
@marks.transaction
def test_send_tx_sign_message_2tx_in_batch_tx_filters_request_stt_testdapp(self):
self.wallet.home_button.click()
status_test_dapp = self.home.open_status_test_dapp()
status_test_dapp.wait_for_d_aap_to_load()
self.wallet.just_fyi("Checking request STT")
status_test_dapp.assets_button.click()
status_test_dapp.request_stt_button.wait_for_element(60)
send_transaction = status_test_dapp.request_stt_button.click()
send_transaction.sign_transaction()
self.wallet.just_fyi("Checking signing message")
status_test_dapp.transactions_button.click()
send_transaction = status_test_dapp.sign_message_button.click()
send_transaction.enter_password_input.set_value(common_password)
send_transaction.sign_button.click()
if not status_test_dapp.element_by_text_part('Signed message').is_element_displayed():
self.errors.append('Message was not signed')
send_transaction.just_fyi('Check logcat for sensitive data')
values_in_logcat = send_transaction.find_values_in_logcat(password=common_password)
if values_in_logcat:
self.errors.append("When signing message from dapp: %s" % values_in_logcat)
self.wallet.just_fyi("Checking send 2 txs in batch")
status_test_dapp.send_two_tx_in_batch_button.scroll_to_element()
send_transaction = status_test_dapp.send_two_tx_in_batch_button.click()
send_transaction.sign_transaction()
if not send_transaction.sign_with_password.is_element_displayed(10):
self.errors.append('Second send transaction screen did not appear!')
send_transaction.sign_transaction()
self.wallet.just_fyi("Checking send 2 txs one after another")
status_test_dapp.send_two_tx_one_by_one_button.scroll_to_element()
send_transaction = status_test_dapp.send_two_tx_one_by_one_button.click()
send_transaction.sign_transaction()
if not send_transaction.sign_with_password.is_element_displayed(20):
self.errors.append('Second send transaction screen did not appear!')
send_transaction.sign_transaction()
self.wallet.just_fyi("Checking test filters")
status_test_dapp.test_filters_button.scroll_and_click()
for element in status_test_dapp.element_by_text('eth_uninstallFilter'), status_test_dapp.ok_button:
if element.is_element_displayed(10):
self.errors.append("'Test filters' button produced an error")
self.errors.verify_no_errors()
@marks.testrail_id(700765) @marks.testrail_id(700765)
@marks.critical
@marks.transaction @marks.transaction
def test_send_tx_custom_token_18_decimals_invalid_password(self): def test_send_tx_custom_token_18_decimals_invalid_password(self):
contract_address, name, symbol, decimals = '0x101848D5C5bBca18E6b4431eEdF6B95E9ADF82FA', 'Weenus 💪', 'WEENUS', '18' contract_address, name, symbol, decimals = '0x101848D5C5bBca18E6b4431eEdF6B95E9ADF82FA', 'Weenus 💪', 'WEENUS', '18'
@ -116,7 +164,6 @@ class TestSendTxDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(700757) @marks.testrail_id(700757)
@marks.critical
def test_send_tx_set_recipient_options(self): def test_send_tx_set_recipient_options(self):
nickname = 'my_some_nickname' nickname = 'my_some_nickname'
account_name = 'my_acc_name' account_name = 'my_acc_name'
@ -224,6 +271,46 @@ class TestSendTxDeviceMerged(MultipleSharedDeviceTestCase):
class TestTransactionWalletSingleDevice(SingleDeviceTestCase): class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
@marks.testrail_id(5784)
@marks.medium
@marks.transaction
def test_sign_typed_message_deploy_simple_contract_request_pub_key_from_dapp(self):
user = transaction_senders['ETH_5']
home = SignInView(self.driver).recover_access(passphrase=user['passphrase'])
home.just_fyi("Checking requesting public key from dapp")
status_test_dapp = home.open_status_test_dapp(allow_all=False)
status_test_dapp.status_api_button.click_until_presence_of_element(status_test_dapp.request_contact_code_button)
status_test_dapp.request_contact_code_button.click_until_presence_of_element(status_test_dapp.deny_button)
status_test_dapp.deny_button.click()
if status_test_dapp.element_by_text(user['public_key']).is_element_displayed():
self.errors.append('Public key is returned but access was not allowed')
status_test_dapp.request_contact_code_button.click_until_presence_of_element(status_test_dapp.deny_button)
status_test_dapp.allow_button.click()
if not status_test_dapp.element_by_text(user['public_key']).is_element_displayed():
self.errors.append('Public key is not returned')
status_test_dapp.get_empty_dapp_tab()
home.wallet_button.click()
home.just_fyi("Checking sign typed message")
home.open_status_test_dapp(allow_all=True)
status_test_dapp.transactions_button.click_until_presence_of_element(status_test_dapp.sign_typed_message_button)
send_transaction = status_test_dapp.sign_typed_message_button.click()
send_transaction.enter_password_input.send_keys(common_password)
send_transaction.sign_button.click_until_absense_of_element(send_transaction.sign_button)
if not status_test_dapp.element_by_text_part('0x1673d96e836').is_element_displayed(30):
self.errors.append("Hash of signed typed message is not shown!")
home.just_fyi("Checking deploy simple contract")
send_transaction = status_test_dapp.deploy_contract_button.click()
send_transaction.sign_transaction()
if not status_test_dapp.element_by_text('Contract deployed at: ').is_element_displayed(240):
self.errors.append('Contract was not created')
for text in ['Call contract get function',
'Call contract set function', 'Call function 2 times in a row']:
status_test_dapp.element_by_text(text).scroll_to_element()
self.errors.verify_no_errors()
@marks.testrail_id(5429) @marks.testrail_id(5429)
@marks.medium @marks.medium
def test_set_currency(self): def test_set_currency(self):

View File

@ -8,6 +8,7 @@ from views.chat_view import ChatView
# TODO: moved here until resolve of 13048 # TODO: moved here until resolve of 13048
@pytest.mark.xdist_group(name="group_chat_3") @pytest.mark.xdist_group(name="group_chat_3")
@marks.critical
class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase): class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase):
@classmethod @classmethod
@ -41,8 +42,7 @@ class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase):
cls.chats[0].send_message(cls.message_before_adding) cls.chats[0].send_message(cls.message_before_adding)
@marks.testrail_id(3994) @marks.testrail_id(3994)
@marks.critical def test_group_chat_push_system_messages_when_invited(self):
def test_group_pn_system_messages_when_invited(self):
self.homes[1].just_fyi("Check system messages in PNs") self.homes[1].just_fyi("Check system messages in PNs")
self.homes[1].put_app_to_background() self.homes[1].put_app_to_background()
self.homes[1].open_notification_bar() self.homes[1].open_notification_bar()
@ -73,8 +73,7 @@ class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(700731) @marks.testrail_id(700731)
@marks.critical def test_group_chat_join_send_text_messages_push(self):
def test_group_join_send_text_messages_pn(self):
message_to_admin = self.message_to_admin message_to_admin = self.message_to_admin
[self.homes[i].home_button.double_click() for i in range(3)] [self.homes[i].home_button.double_click() for i in range(3)]
self.homes[1].get_chat(self.chat_name).click() self.homes[1].get_chat(self.chat_name).click()
@ -105,8 +104,7 @@ class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(700732) @marks.testrail_id(700732)
@marks.critical def test_group_chat_add_new_member_activity_centre(self):
def test_group_add_new_member_activity_centre(self):
[self.homes[i].home_button.double_click() for i in range(3)] [self.homes[i].home_button.double_click() for i in range(3)]
self.homes[0].get_chat(self.chat_name).click() self.homes[0].get_chat(self.chat_name).click()
self.chats[0].add_members_to_group_chat([self.usernames[2]]) self.chats[0].add_members_to_group_chat([self.usernames[2]])
@ -126,8 +124,7 @@ class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(3998) @marks.testrail_id(3998)
@marks.critical def test_group_chat_offline_pn(self):
def test_group_offline_pn(self):
[self.homes[i].home_button.double_click() for i in range(3)] [self.homes[i].home_button.double_click() for i in range(3)]
chat_name = 'for_offline_pn' chat_name = 'for_offline_pn'
self.homes[0].create_group_chat([self.usernames[1], self.usernames[2]], chat_name) self.homes[0].create_group_chat([self.usernames[1], self.usernames[2]], chat_name)
@ -163,8 +160,7 @@ class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(5756) @marks.testrail_id(5756)
@marks.critical def test_group_chat_decline_invite_chat_highligted(self):
def test_group_decline_invite_chat_highligted(self):
chat_name = 'for_invited' chat_name = 'for_invited'
left_system_message = self.chats[0].leave_system_message(self.usernames[1]) left_system_message = self.chats[0].leave_system_message(self.usernames[1])
[self.homes[i].home_button.double_click() for i in range(3)] [self.homes[i].home_button.double_click() for i in range(3)]
@ -193,8 +189,7 @@ class TestPublicChatMultipleDeviceMerged(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(3997) @marks.testrail_id(3997)
@marks.critical def test_group_chat_leave_relogin(self):
def test_group_leave_relogin(self):
self.drivers[2].quit() self.drivers[2].quit()
[self.homes[i].home_button.double_click() for i in range(2)] [self.homes[i].home_button.double_click() for i in range(2)]
self.homes[0].home_button.double_click() self.homes[0].home_button.double_click()

View File

@ -58,8 +58,8 @@ class DappsView(BaseView):
from views.web_views.base_web_view import BaseWebView from views.web_views.base_web_view import BaseWebView
web_view = BaseWebView(self.driver) web_view = BaseWebView(self.driver)
if not self.enter_url_editbox.is_element_displayed(): if not self.enter_url_editbox.is_element_displayed():
web_view.open_tabs_button.wait_and_click() web_view.open_tabs_button.click_if_shown()
web_view.open_new_tab_plus_button.click() web_view.open_new_tab_plus_button.click_if_shown()
self.enter_url_editbox.wait_for_visibility_of_element(20) self.enter_url_editbox.wait_for_visibility_of_element(20)
self.enter_url_editbox.click() self.enter_url_editbox.click()
self.enter_url_editbox.send_keys(url) self.enter_url_editbox.send_keys(url)

View File

@ -63,7 +63,7 @@ class BaseWebView(BaseView):
self.driver.info("Closing all tabs") self.driver.info("Closing all tabs")
self.close_all_button.click() self.close_all_button.click()
else: else:
self.driver.info("Removing '%s' from recent websites") self.driver.info("Removing '%s' from recent websites" % name)
close_button = Button(self.driver, close_button = Button(self.driver,
xpath="//*[contains(@text, '%s')]/../../../../*[@content-desc='empty-tab']" % name) xpath="//*[contains(@text, '%s')]/../../../../*[@content-desc='empty-tab']" % name)
close_button.scroll_to_element() close_button.scroll_to_element()