From ed16d9f1918e5aa0cc3b34005a8656d4417e653a Mon Sep 17 00:00:00 2001 From: Oleksii Lymarenko Date: Wed, 7 Nov 2018 15:09:23 +0200 Subject: [PATCH] new test added: can complete txn to dapp after onboarding called from dapp is completed Signed-off-by: Oleksii Lymarenko --- .../transactions/test_daaps_transactions.py | 25 ++++++++++++++++++- test/appium/tests/users.py | 6 +++++ test/appium/views/send_transaction_view.py | 7 ++++++ .../views/web_views/status_test_dapp.py | 3 +++ 4 files changed, 40 insertions(+), 1 deletion(-) diff --git a/test/appium/tests/atomic/transactions/test_daaps_transactions.py b/test/appium/tests/atomic/transactions/test_daaps_transactions.py index 9260f540d0..f41321be1d 100644 --- a/test/appium/tests/atomic/transactions/test_daaps_transactions.py +++ b/test/appium/tests/atomic/transactions/test_daaps_transactions.py @@ -2,7 +2,7 @@ import pytest from tests import marks, unique_password from tests.base_test_case import SingleDeviceTestCase -from tests.users import transaction_senders +from tests.users import transaction_senders, transaction_recipients from views.sign_in_view import SignInView @@ -142,3 +142,26 @@ class TestTransactionDApp(SingleDeviceTestCase): if not send_transaction_view.onboarding_message.is_element_displayed(): self.driver.fail(onboarding_screen_error_msg) + + @marks.testrail_id(5380) + @marks.high + def test_user_can_complete_tx_to_dapp_when_onboarding_via_dapp_completed(self): + user = transaction_recipients['G'] + signin_view = SignInView(self.driver) + home_view = signin_view.recover_access(passphrase=user['passphrase']) + status_test_dapp = home_view.open_status_test_dapp() + status_test_dapp.wait_for_d_aap_to_load() + status_test_dapp.assets_button.click() + + send_transaction_view = status_test_dapp.request_stt_button.click() + if not send_transaction_view.onboarding_message.is_element_displayed(): + self.driver.fail('It seems onborading screen is not shown.') + send_transaction_view.complete_onboarding() + + if not send_transaction_view.sign_transaction_button.is_element_displayed(): + self.driver.fail('It seems transaction sign screen is not shown.') + + send_transaction_view.sign_transaction() + + if not status_test_dapp.assets_button.is_element_displayed(): + self.driver.fail('It seems users was not redirected to Status DAPP screen.') diff --git a/test/appium/tests/users.py b/test/appium/tests/users.py index 17949023bb..fe72993f54 100644 --- a/test/appium/tests/users.py +++ b/test/appium/tests/users.py @@ -230,3 +230,9 @@ transaction_recipients['F']['username'] = "Exhausted Yellowgreen Polecat" transaction_recipients['F']['address'] = "81e0b035fe73f4f1aefeb5c75537c7d9b423149f" transaction_recipients['F']['public_key'] = "0x04bf7da995d4e35a9fec3eec00f1b628d8c47fe931014111236cae617bd1dbd4743a49" \ "684d083b4552d86a37380c8b0d49688e2026e2c801b4b503a9a8383c533d" +transaction_recipients['G'] = dict() +transaction_recipients['G']['passphrase'] = "spray tired dentist case please list occur envelope they across picture spatial" +transaction_recipients['G']['username'] = "Amused Dazzling Badger" +transaction_recipients['G']['address'] = "b1f8b0db0f12e45d7712625bc53535235d245a9f" +transaction_recipients['G']['public_key'] = "0x04f08a05551c3704284ca03ea2ff7fe613a00e52be86d6b433f7e38fa31fd0741eebf" \ + "4344ad8d1652896440dada4017665e9b16ae328cb829b9e647b65c7024df7" diff --git a/test/appium/views/send_transaction_view.py b/test/appium/views/send_transaction_view.py index 0761ff9e7e..88432a309e 100644 --- a/test/appium/views/send_transaction_view.py +++ b/test/appium/views/send_transaction_view.py @@ -177,6 +177,13 @@ class SendTransactionView(BaseView): self.onboarding_message = OnboardingMessage(self.driver) + def complete_onboarding(self): + if self.onboarding_message.is_element_displayed(): + from views.wallet_view import WalletView + wallet_view = WalletView(self.driver) + wallet_view.done_button.click() + self.yes_button.click() + def sign_transaction(self, sender_password: str = common_password): self.sign_transaction_button.click_until_presence_of_element(self.enter_password_input) self.enter_password_input.send_keys(sender_password) diff --git a/test/appium/views/web_views/status_test_dapp.py b/test/appium/views/web_views/status_test_dapp.py index 07e86cc407..fcf9063965 100644 --- a/test/appium/views/web_views/status_test_dapp.py +++ b/test/appium/views/web_views/status_test_dapp.py @@ -81,3 +81,6 @@ class StatusTestDAppView(BaseWebView): self.status_api_button = StatusAPIButton(self.driver) self.request_contact_code_button = StatusAPIButton.RequestContactCodeButton(self.driver) + + def wait_for_d_aap_to_load(self, wait_time=10): + self.assets_button.wait_for_visibility_of_element(seconds=wait_time)