From 031626aefcf27027c5a3339eebb2839735d08245 Mon Sep 17 00:00:00 2001 From: Churikova Tetiana Date: Wed, 30 Jun 2021 15:45:15 +0200 Subject: [PATCH] e2e: more fixes Signed-off-by: Churikova Tetiana --- .../atomic/account_management/test_create_account.py | 1 + .../tests/atomic/account_management/test_keycard.py | 2 ++ .../tests/atomic/account_management/test_profile.py | 4 ++-- test/appium/tests/atomic/chats/test_commands.py | 3 +-- .../tests/atomic/chats/test_keycard_commands.py | 3 +-- .../atomic/transactions/test_dapps_transactions.py | 2 +- .../transactions/test_keycard_dapps_transactions.py | 2 +- test/appium/views/sign_in_view.py | 2 +- test/appium/views/wallet_view.py | 12 ++++++------ test/appium/views/web_views/base_web_view.py | 4 ++-- 10 files changed, 18 insertions(+), 17 deletions(-) diff --git a/test/appium/tests/atomic/account_management/test_create_account.py b/test/appium/tests/atomic/account_management/test_create_account.py index 86034bb78f..67e047f3a7 100644 --- a/test/appium/tests/atomic/account_management/test_create_account.py +++ b/test/appium/tests/atomic/account_management/test_create_account.py @@ -213,6 +213,7 @@ class TestCreateAccount(SingleDeviceTestCase): @marks.medium def test_create_account_short_and_mismatch_password(self): sign_in = SignInView(self.driver) + sign_in.accept_tos_checkbox.click() sign_in.get_started_button.click() sign_in.generate_key_button.click() sign_in.next_button.click() diff --git a/test/appium/tests/atomic/account_management/test_keycard.py b/test/appium/tests/atomic/account_management/test_keycard.py index e468a4a0e5..8a8752ab41 100644 --- a/test/appium/tests/atomic/account_management/test_keycard.py +++ b/test/appium/tests/atomic/account_management/test_keycard.py @@ -139,6 +139,7 @@ class TestCreateAccount(SingleDeviceTestCase): sign_in = SignInView(self.driver) sign_in.just_fyi('Cancel on PIN code setup stage') + sign_in.accept_tos_checkbox.click() sign_in.get_started_button.click() sign_in.generate_key_button.click() username = sign_in.first_username_on_choose_chat_name.text @@ -191,6 +192,7 @@ class TestCreateAccount(SingleDeviceTestCase): @marks.flaky def test_keycard_interruption_access_key_onboarding_flow(self): sign_in = SignInView(self.driver) + sign_in.accept_tos_checkbox.click() sign_in.get_started_button.click() sign_in.access_key_button.click() diff --git a/test/appium/tests/atomic/account_management/test_profile.py b/test/appium/tests/atomic/account_management/test_profile.py index 7f8d13dbbd..a7006d1e55 100644 --- a/test/appium/tests/atomic/account_management/test_profile.py +++ b/test/appium/tests/atomic/account_management/test_profile.py @@ -338,14 +338,14 @@ class TestProfileSingleDevice(SingleDeviceTestCase): no_link_found_error_msg = 'Could not find privacy policy link at' no_link_open_error_msg = 'Could not open our privacy policy from' - signin.just_fyi("Checking provacy policy from sign in and from profile") + signin.just_fyi("Checking privacy policy from sign in and from profile") if not signin.privacy_policy_link.is_element_displayed(): self.driver.fail('%s Sign in view!' % no_link_found_error_msg) web_page = signin.privacy_policy_link.click() web_page.open_in_webview() if not web_page.policy_summary.is_element_displayed(): self.errors.append('%s Sign in view!' % no_link_open_error_msg) - web_page.click_system_back_button() + web_page.close_privacy_policy_button.click() home = signin.create_user() profile = home.profile_button.click() profile.about_button.click() diff --git a/test/appium/tests/atomic/chats/test_commands.py b/test/appium/tests/atomic/chats/test_commands.py index a8578f4ab9..d9bd2efe97 100644 --- a/test/appium/tests/atomic/chats/test_commands.py +++ b/test/appium/tests/atomic/chats/test_commands.py @@ -148,8 +148,7 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase): send_message = chat_2_sender_message.sign_and_send.click() send_message.next_button.click() send_message.sign_transaction() - [message.transaction_status.wait_for_element_text(message.pending, wait_time=60) for message in - (chat_2_sender_message, chat_1_request_message)] + chat_2_sender_message.transaction_status.wait_for_element_text(chat_2_sender_message.pending, wait_time=60) # TODO: blocked because of #12256 # home_2.just_fyi('Check that transaction message is updated with new status after offline') diff --git a/test/appium/tests/atomic/chats/test_keycard_commands.py b/test/appium/tests/atomic/chats/test_keycard_commands.py index 669b408dfc..44ad6164e7 100644 --- a/test/appium/tests/atomic/chats/test_keycard_commands.py +++ b/test/appium/tests/atomic/chats/test_keycard_commands.py @@ -143,8 +143,7 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase): send_message = chat_2_sender_message.sign_and_send.click() send_message.next_button.click() send_message.sign_transaction(keycard=True) - [message.transaction_status.wait_for_element_text(message.pending, wait_time=60) for message in - (chat_2_sender_message, chat_1_request_message)] + chat_2_sender_message.transaction_status.wait_for_element_text(chat_2_sender_message.pending, wait_time=60) # TODO: blocked because of #12256 # home_2.just_fyi('Check that transaction message is updated with new status after offline') diff --git a/test/appium/tests/atomic/transactions/test_dapps_transactions.py b/test/appium/tests/atomic/transactions/test_dapps_transactions.py index a35fc73a64..3483070873 100644 --- a/test/appium/tests/atomic/transactions/test_dapps_transactions.py +++ b/test/appium/tests/atomic/transactions/test_dapps_transactions.py @@ -13,6 +13,7 @@ class TestTransactionDApp(SingleDeviceTestCase): sender = transaction_senders['K'] 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() @@ -22,7 +23,6 @@ class TestTransactionDApp(SingleDeviceTestCase): self.driver.fail('It seems onboarding screen is not shown.') home.ok_got_it_button.click() home.cancel_button.click() - #wallet.dapp_tab_button.click(desired_element_text='Request STT') send_transaction = status_test_dapp.request_stt_button.click() send_transaction.sign_transaction(unique_password) status_test_dapp.wallet_button.click() diff --git a/test/appium/tests/atomic/transactions/test_keycard_dapps_transactions.py b/test/appium/tests/atomic/transactions/test_keycard_dapps_transactions.py index f41cabeadc..38152bd95b 100644 --- a/test/appium/tests/atomic/transactions/test_keycard_dapps_transactions.py +++ b/test/appium/tests/atomic/transactions/test_keycard_dapps_transactions.py @@ -15,7 +15,7 @@ class TestTransactionDApp(SingleDeviceTestCase): home_view = sign_in_view.recover_access(sender['passphrase'], keycard=True) wallet_view = home_view.wallet_button.click() wallet_view.set_up_wallet() - wallet_view.asset_by_name('STT').wait_for_element(30) + wallet_view.scan_tokens() initial_amount_STT = wallet_view.get_asset_amount_by_name('STT') status_test_dapp = home_view.open_status_test_dapp() status_test_dapp.wait_for_d_aap_to_load() diff --git a/test/appium/views/sign_in_view.py b/test/appium/views/sign_in_view.py index 4c2ce22fb8..ec91443c76 100644 --- a/test/appium/views/sign_in_view.py +++ b/test/appium/views/sign_in_view.py @@ -85,7 +85,7 @@ class KeycardKeyStorageButton(Button): class PrivacyPolicyLink(Button): def __init__(self, driver): - super(PrivacyPolicyLink, self).__init__(driver, xpath="//*[contains(@text, 'privacy policy')]") + super(PrivacyPolicyLink, self).__init__(driver, xpath="//*[contains(@text, 'Privacy policy')]") def click(self): element = self.find_element() diff --git a/test/appium/views/wallet_view.py b/test/appium/views/wallet_view.py index 863b30cf31..c6705ff185 100644 --- a/test/appium/views/wallet_view.py +++ b/test/appium/views/wallet_view.py @@ -152,11 +152,11 @@ class WalletView(BaseView): if counter >= wait_time: self.driver.fail('Balance %s %s is not changed during %s seconds!' % (asset, initial_balance,wait_time)) elif self.asset_by_name(asset).is_element_present() and self.get_asset_amount_by_name(asset) == initial_balance: - # if not self.transaction_history_button.is_element_displayed(): - # self.wallet_account_by_name(self.status_account_name).click() - # if (counter/60).is_integer(): - # self.pull_to_refresh() - # counter+=20 + if not self.transaction_history_button.is_element_displayed(): + self.wallet_account_by_name(self.status_account_name).click() + if (counter/60).is_integer(): + self.pull_to_refresh() + counter+=20 self.wallet_button.double_click() counter += 10 time.sleep(10) @@ -170,7 +170,7 @@ class WalletView(BaseView): self.driver.info('*Waiting %s seconds for %s to display asset*' % (counter, asset)) else: self.driver.info('**Balance is updated!**') - # self.wallet_button.double_click() + self.wallet_button.double_click() self.element_by_translation_id("wallet-total-value").scroll_to_element(direction='up') return self diff --git a/test/appium/views/web_views/base_web_view.py b/test/appium/views/web_views/base_web_view.py index df8b1cf973..d3686b0169 100644 --- a/test/appium/views/web_views/base_web_view.py +++ b/test/appium/views/web_views/base_web_view.py @@ -10,7 +10,7 @@ class BaseWebView(BaseView): self.progress_bar_icon = Button(self.driver, xpath="//android.widget.ProgressBar") self.url_edit_box_lock_icon = Button(self.driver, xpath="'(//android.view.ViewGroup[@content-desc='icon'])[2]") - self.policy_summary = Button(self.driver, xpath="//*[@content-desc='Policy summary'] | //*[@text='Policy summary']") + self.policy_summary = Button(self.driver, xpath="//*[@content-desc='Status Privacy Policy'] | //*[@text='Status Privacy Policyy']") self.browser_previous_page_button = Button(self.driver, accessibility_id="previous-page-button") self.browser_next_page_button = Button(self.driver, accessibility_id="next-page-button") @@ -29,7 +29,7 @@ class BaseWebView(BaseView): self.close_all_button = Button(self.driver, accessibility_id="close-all") self.empty_tab_button = Button(self.driver, accessibility_id="tab-itemEmpty tab") self.camera_image_in_dapp = BaseElement(self.driver, class_name="android.widget.Image") - + self.close_privacy_policy_button = Button(self.driver, xpath="//androidx.appcompat.widget.LinearLayoutCompat") # bookmarks management self.add_remove_favorites_button = Button(self.driver, accessibility_id="add-remove-fav")