From 9b198e4352683d015ed445b5abaf02f04e1ad22f Mon Sep 17 00:00:00 2001 From: Oleksii Lymarenko Date: Fri, 9 Nov 2018 14:36:21 +0200 Subject: [PATCH] new test added: user can see own assets after account recovering Signed-off-by: Oleksii Lymarenko --- .../atomic/account_management/test_profile.py | 3 +-- .../account_management/test_wallet_management.py | 15 +++++++++++++++ test/appium/tests/users.py | 6 ++++++ test/appium/views/profile_view.py | 3 ++- test/appium/views/wallet_view.py | 10 ++++++++++ 5 files changed, 34 insertions(+), 3 deletions(-) diff --git a/test/appium/tests/atomic/account_management/test_profile.py b/test/appium/tests/atomic/account_management/test_profile.py index db72166d6c..5c7dcfff79 100644 --- a/test/appium/tests/atomic/account_management/test_profile.py +++ b/test/appium/tests/atomic/account_management/test_profile.py @@ -253,8 +253,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase): home_view = signin_view.create_user() network_name = 'Mainnet with upstream RPC' profile = home_view.profile_button.click() - signin_view = profile.switch_network(network_name) - home_view = signin_view.sign_in() + profile.switch_network(network_name) profile = home_view.profile_button.click() if not profile.current_active_network == network_name.upper(): self.driver.fail('Oops! Wrong network selected!') diff --git a/test/appium/tests/atomic/account_management/test_wallet_management.py b/test/appium/tests/atomic/account_management/test_wallet_management.py index c47167f901..efb0a1da0c 100644 --- a/test/appium/tests/atomic/account_management/test_wallet_management.py +++ b/test/appium/tests/atomic/account_management/test_wallet_management.py @@ -197,3 +197,18 @@ class TestWalletManagement(SingleDeviceTestCase): pytest.fail('Failed transactions are not filtered') details.back_button.click() self.verify_no_errors() + + @marks.testrail_id(5381) + @marks.high + @marks.skip + def test_user_can_see_all_own_assets_after_account_recovering(self): + passphrase = wallet_users['D']['passphrase'] + signin_view = SignInView(self.driver) + home_view = signin_view.recover_access(passphrase=passphrase) + profile = home_view.profile_button.click() + profile.switch_network('Rinkeby with upstream RPC') + profile = home_view.profile_button.click() + wallet_view = profile.wallet_button.click() + wallet_view.set_up_wallet() + if wallet_view.collectible_amount_by_name('kdo') != '1': + self.driver.fail('User collectibles amount does not match!') diff --git a/test/appium/tests/users.py b/test/appium/tests/users.py index 179adadb9d..b5674a70c3 100644 --- a/test/appium/tests/users.py +++ b/test/appium/tests/users.py @@ -34,6 +34,12 @@ wallet_users['D']['username'] = "Quickwitted United Orca" wallet_users['D']['address'] = "80b663e82657caf5657ce79b11aeaeda02c6cd92" wallet_users['D']['public_key'] = "0x048d9ee2acb99b0c9fef98665f8287d99fc365c5e827fc2541ffdce4cb87a9480bbea8" \ "324968b9bb1ae6c2eca37cf0ab4aba9d85755e3a532431b9edc189f23c7c" +wallet_users['E'] = dict() +wallet_users['E']['passpharse'] = "record sphere illegal section blame swing wreck estate celery same excite summer" +wallet_users['E']['username'] = "Homely Untimely Grasshopper" +wallet_users['E']['address'] = "0x3e2e4077753d3c229a9ae332b9ca46958945e2f6" +wallet_users['E']['public_key'] = "0x04a30d58c2c65c654a521455dabc139a9c26be7ca565f152a8182376150c1e12fe362c017a21b0e" \ + "58676b84a945e34030c7150ae8d03758e94bf017f930d6189b2" transaction_senders = dict() diff --git a/test/appium/views/profile_view.py b/test/appium/views/profile_view.py index 8296c8b736..9c4402fca2 100644 --- a/test/appium/views/profile_view.py +++ b/test/appium/views/profile_view.py @@ -477,7 +477,8 @@ class ProfileView(BaseView): network_button.click() self.connect_button.click() from views.sign_in_view import SignInView - return SignInView(self.driver) + signin_view = SignInView(self.driver) + signin_view.sign_in() def add_custom_network(self): self.advanced_button.click() diff --git a/test/appium/views/wallet_view.py b/test/appium/views/wallet_view.py index 758dba629d..45fa10a403 100644 --- a/test/appium/views/wallet_view.py +++ b/test/appium/views/wallet_view.py @@ -147,6 +147,12 @@ class AssetTextElement(BaseText): self.locator = self.Locator.accessibility_id('%s-asset-value-text' % asset_name.lower()) +class CollectibleTextElement(BaseText): + def __init__(self, driver, collectible_name): + super().__init__(driver) + self.locator = self.Locator.accessibility_id('%s-collectible-value-text' % collectible_name.lower()) + + class AssetCheckBox(BaseButton): def __init__(self, driver, asset_name): super(AssetCheckBox, self).__init__(driver) @@ -322,3 +328,7 @@ class WalletView(BaseView): send_transaction_view.recent_recipients_button.click_until_presence_of_element(recent_recipient) recent_recipient.click() self.send_request_button.click() + + def collectible_amount_by_name(self, name): + elm = CollectibleTextElement(self.driver, name) + return elm.text