From b9c7dbd5d2023c8adb0619b8d16563a6f006b1d3 Mon Sep 17 00:00:00 2001 From: yevh-berdnyk Date: Mon, 26 Aug 2019 18:09:30 +0100 Subject: [PATCH] Fixed e2e tests (high/medium) Signed-off-by: Churikova Tetiana --- .../atomic/account_management/test_profile.py | 10 ++++------ .../atomic/transactions/test_daaps_transactions.py | 14 +++++++------- .../tests/atomic/transactions/test_wallet.py | 3 ++- test/appium/views/wallet_view.py | 2 +- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/test/appium/tests/atomic/account_management/test_profile.py b/test/appium/tests/atomic/account_management/test_profile.py index 962ae6fbff..b4cf4d284e 100644 --- a/test/appium/tests/atomic/account_management/test_profile.py +++ b/test/appium/tests/atomic/account_management/test_profile.py @@ -247,14 +247,13 @@ class TestProfileSingleDevice(SingleDeviceTestCase): sign_in = SignInView(self.driver) sign_in.create_user() profile = sign_in.profile_button.click() - profile.edit_button.click() - profile.edit_picture_button.click() + profile.profile_picture.click() profile.capture_button.click() for _ in range(2): profile.deny_button.click() profile.element_by_text(camera_access_error_text).wait_for_visibility_of_element(3) profile.ok_button.click() - profile.edit_picture_button.click() + profile.profile_picture.click() profile.capture_button.click() profile.deny_button.wait_for_visibility_of_element(2) @@ -264,13 +263,12 @@ class TestProfileSingleDevice(SingleDeviceTestCase): sign_in = SignInView(self.driver) sign_in.create_user() profile = sign_in.profile_button.click() - profile.edit_button.click() - profile.edit_picture_button.click() + profile.profile_picture.click() profile.select_from_gallery_button.click() profile.deny_button.click() profile.element_by_text(photos_access_error_text, element_type='text').wait_for_visibility_of_element(3) profile.ok_button.click() - profile.edit_picture_button.click() + profile.profile_picture.click() profile.select_from_gallery_button.click() profile.deny_button.wait_for_visibility_of_element(2) diff --git a/test/appium/tests/atomic/transactions/test_daaps_transactions.py b/test/appium/tests/atomic/transactions/test_daaps_transactions.py index 7bc50e2d75..58fef558de 100644 --- a/test/appium/tests/atomic/transactions/test_daaps_transactions.py +++ b/test/appium/tests/atomic/transactions/test_daaps_transactions.py @@ -303,7 +303,7 @@ class TestTransactionDApp(SingleDeviceTestCase): send_transaction_view = SendTransactionView(self.driver) warning = 'No "Not enough ETH for gas" warning appeared while {}' - sign_button_warning = 'Signin transaction button is enabled {}' + sign_button_warning = 'Sign transaction button is enabled {}' # Check whether sending 0 ETH with an empty ETH balance triggers the warning send_transaction_view.sign_transaction_button.click() @@ -320,13 +320,13 @@ class TestTransactionDApp(SingleDeviceTestCase): asset_button.click() send_transaction_view.amount_edit_box.set_value('0') send_transaction_view.confirm() + send_transaction_view.sign_transaction_button.click() # Check whether sending 0 STT with an empty ETH balance triggers the warning if not send_transaction_view.validation_warnings.not_enough_eth_for_gas.is_element_displayed(): self.errors.append(warning.format('sending 0 STT with an empty ETH balance')) # Check whether sign transaction button is disabled - send_transaction_view.sign_transaction_button.click() send_transaction_view.sign_with_password.click() if send_transaction_view.enter_password_input.is_element_displayed(): self.errors.append(sign_button_warning.format('sending 0 STT with an empty ETH balance')) @@ -340,16 +340,16 @@ class TestTransactionDApp(SingleDeviceTestCase): wallet = home_view.wallet_button.click() wallet.accounts_status_account.click() wallet.send_transaction(asset_name='ETHro', amount=0.1, recipient=recipient, sign_transaction=False) + send_transaction_view.sign_transaction_button.click() # Check whether sending all available ETH triggers the warning if not send_transaction_view.validation_warnings.not_enough_eth_for_gas.is_element_displayed(): self.errors.append(warning.format('sending all available ETH (no funds to pay gas)')) # Check whether sign transaction button is disabled - send_transaction_view.sign_transaction_button.click() send_transaction_view.sign_with_password.click() if send_transaction_view.enter_password_input.is_element_displayed(): - self.errors.append('sending all available ETH (no funds to pay gas)') + self.errors.append(warning.format('sending all available ETH (no funds to pay gas)')) # Because tx gas price may change we calculate eth value according to current gas fee value transaction_fee_total = send_transaction_view.get_transaction_fee_total() @@ -362,23 +362,23 @@ class TestTransactionDApp(SingleDeviceTestCase): # Check whether sending big amount of ETH triggers the warning (no funds to pay gas) if not send_transaction_view.validation_warnings.not_enough_eth_for_gas.is_element_displayed(): - self.errors.append('sending big amount of ETH (no funds to pay gas)') + self.errors.append(warning.format('sending big amount of ETH (no funds to pay gas)')) # Check whether sign transaction button is disabled send_transaction_view.sign_transaction_button.click() if send_transaction_view.enter_password_input.is_element_displayed(): - self.errors.append('sending big amount of ETH (no funds to pay gas)') + self.errors.append(warning.format('sending big amount of ETH (no funds to pay gas)')) send_transaction_view.cancel_button.click() send_transaction_view.amount_edit_box.clear() send_transaction_view.amount_edit_box.set_value(eth_available_for_tx) send_transaction_view.confirm() + send_transaction_view.sign_transaction_button.click() # Check whether sending normal amount of ETH does not trigger the warning if send_transaction_view.validation_warnings.not_enough_eth_for_gas.is_element_displayed(): self.errors.append('"Not enough ETH for gas" warning appeared while sending normal amount of ETH') - send_transaction_view.sign_transaction_button.click() send_transaction_view.sign_transaction() if not wallet.send_transaction_button.is_element_displayed(): self.errors.append('Could not sign the transaction!') diff --git a/test/appium/tests/atomic/transactions/test_wallet.py b/test/appium/tests/atomic/transactions/test_wallet.py index 9e0ae54023..e2d787a96c 100644 --- a/test/appium/tests/atomic/transactions/test_wallet.py +++ b/test/appium/tests/atomic/transactions/test_wallet.py @@ -118,7 +118,8 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase): send_transaction.enter_password_input.click() send_transaction.enter_password_input.send_keys('wrong_password') send_transaction.sign_button.click() - send_transaction.find_text_part('Wrong password', 20) + if send_transaction.element_by_text_part('Transaction sent').is_element_displayed(): + self.driver.fail('Transaction was sent with a wrong password') @marks.testrail_id(1452) def test_transaction_appears_in_history(self): diff --git a/test/appium/views/wallet_view.py b/test/appium/views/wallet_view.py index 546d0e24b1..59b450c84c 100644 --- a/test/appium/views/wallet_view.py +++ b/test/appium/views/wallet_view.py @@ -468,7 +468,7 @@ class WalletView(BaseView): """ :param desired_currency: defines a currency designator which is expressed by ISO 4217 code """ - self.multiaccount_more_options.click() + self.multiaccount_more_options.click_until_presence_of_element(self.set_currency_button) self.set_currency_button.click() desired_currency = self.element_by_text_part(desired_currency) desired_currency.scroll_to_element()