From 58c64608d0e2eaef975fa80ef69d9af6df36a9b7 Mon Sep 17 00:00:00 2001 From: Serhy Date: Thu, 3 Oct 2019 21:33:36 +0300 Subject: [PATCH] Test to check cryptokitty in wallet collectibles Signed-off-by: Serhy --- .../test_wallet_management.py | 18 +++++++++++++++ .../tests/atomic/chats/test_one_to_one.py | 2 +- test/appium/tests/users.py | 8 +++++++ test/appium/views/dapps_view.py | 6 +++++ test/appium/views/wallet_view.py | 23 +++++++++++++++++++ 5 files changed, 56 insertions(+), 1 deletion(-) 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 0eb095e23b..e2ee111ec9 100644 --- a/test/appium/tests/atomic/account_management/test_wallet_management.py +++ b/test/appium/tests/atomic/account_management/test_wallet_management.py @@ -226,6 +226,24 @@ class TestWalletManagement(SingleDeviceTestCase): if not wallet_view.element_by_text('1').is_element_displayed(): self.driver.fail('User collectibles amount does not match') + @marks.testrail_id(5346) + @marks.high + def test_collectible_from_wallet_opens_in_browser_view(self): + passphrase = wallet_users['F']['passphrase'] + signin_view = SignInView(self.driver) + home_view = signin_view.recover_access(passphrase=passphrase) + profile = home_view.profile_button.click() + profile.switch_network('Mainnet with upstream RPC') + wallet_view = profile.wallet_button.click() + wallet_view.set_up_wallet() + wallet_view.collectibles_button.click() + wallet_view.cryptokitties_in_collectibles_button.click() + web_view = wallet_view.view_in_cryptokitties_button.click() + web_view.element_by_text('cryptokitties.co').click() + cryptokitty_link = 'https://www.cryptokitties.co/kitty/1338226' + if not web_view.element_by_text(cryptokitty_link).is_element_displayed(): + self.driver.fail('Cryptokitty detail page not opened') + @marks.testrail_id(6208) @marks.high def test_add_custom_token(self): diff --git a/test/appium/tests/atomic/chats/test_one_to_one.py b/test/appium/tests/atomic/chats/test_one_to_one.py index c55fd84f01..4825a4af33 100644 --- a/test/appium/tests/atomic/chats/test_one_to_one.py +++ b/test/appium/tests/atomic/chats/test_one_to_one.py @@ -69,7 +69,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase): home_1.airplane_mode_button.click() # airplane mode on primary device chat_2.element_by_text('Connecting to peers...').wait_for_invisibility_of_element(60) - chat_2.connection_status.wait_for_invisibility_of_element(30) + chat_2.connection_status.wait_for_invisibility_of_element(60) message_2 = 'one more message' chat_2.chat_message_input.send_keys(message_2) chat_2.send_message_button.click() diff --git a/test/appium/tests/users.py b/test/appium/tests/users.py index 6b93b38f8d..da3d174a1d 100644 --- a/test/appium/tests/users.py +++ b/test/appium/tests/users.py @@ -49,6 +49,14 @@ wallet_users['E']['address'] = "0x3e2e4077753d3c229a9ae332b9ca46958945e2f6" wallet_users['E']['public_key'] = "0x044cf0620ec3ea0aba9fb0e19cb42a6fbd6b4e74f234f0da82580564817b238cc6434745d31" \ "fa1649927ba48adfa7c95991fd51940bc00a71e80b095db5b107f1b" +wallet_users['F'] = dict() +wallet_users['F']['passphrase'] = "jazz human replace save wreck merry evolve oval black expose clutch sword" +wallet_users['F']['username'] = "Dual Sour Galapagostortoise" +wallet_users['F']['address'] = "0x8A4339aE98df2B2e51E37631C8B4F853048D4556" +wallet_users['F']['public_key'] = "0x049d0b39d95b20114fac79c3173a36c60a126c060dce52bba4128ab9a3885f0f058f2af9c92099" \ + "315eb564412b718d8bfe697a4425e4bc603063abd4f5c45f8e57" + + # Users used in chats. E.g. as members of a group chat chat_users = dict() diff --git a/test/appium/views/dapps_view.py b/test/appium/views/dapps_view.py index cc41b45b26..5dae1114a9 100644 --- a/test/appium/views/dapps_view.py +++ b/test/appium/views/dapps_view.py @@ -3,6 +3,7 @@ from views.base_view import BaseView from views.home_view import ChatElement + class OpenDAppButton(BaseButton): def __init__(self, driver): super(OpenDAppButton, self).__init__(driver) @@ -30,26 +31,31 @@ class BrowserEntry(ChatElement): super(BrowserEntry, self).__init__(driver, name) self.locator = self.Locator.xpath_selector('//*[@text="%s"]/..' % name) + class EnsName(BaseEditBox): def __init__(self, driver): super(EnsName, self).__init__(driver) self.locator = self.Locator.xpath_selector('//android.widget.EditText') + class EnsCheckName(BaseButton): def __init__(self, driver): super(EnsCheckName, self).__init__(driver) self.locator = self.Locator.xpath_selector('//android.widget.EditText//following-sibling::android.view.ViewGroup[1]') + class RemoveDappButton(BaseButton): def __init__(self, driver): super(RemoveDappButton, self).__init__(driver) self.locator = self.Locator.accessibility_id('remove-dapp-from-list') + class ClearAllDappButton(BaseButton): def __init__(self, driver): super(ClearAllDappButton, self).__init__(driver) self.locator = self.Locator.accessibility_id('clear-all-dapps') + class DappsView(BaseView): def __init__(self, driver): diff --git a/test/appium/views/wallet_view.py b/test/appium/views/wallet_view.py index 49010e1edc..b510cffa5a 100644 --- a/test/appium/views/wallet_view.py +++ b/test/appium/views/wallet_view.py @@ -171,6 +171,27 @@ class CollectiblesButton(BaseButton): self.locator = self.Locator.text_selector('Collectibles') +class CryptoKittiesInCollectiblesButton(BaseButton): + def __init__(self, driver): + super(CryptoKittiesInCollectiblesButton, self).__init__(driver) + self.locator = self.Locator.text_selector('CryptoKitties') + + +class ViewInCryptoKittiesButton(BaseButton): + def __init__(self, driver): + super(ViewInCryptoKittiesButton, self).__init__(driver) + self.locator = self.Locator.accessibility_id('open-collectible-button') + + def navigate(self): + from views.web_views.base_web_view import BaseWebView + return BaseWebView(self.driver) + + def click(self): + self.wait_for_element(30).click() + self.driver.info('Tap on View in CryptoKitties') + return self.navigate() + + class BackupRecoveryPhrase(BaseButton): def __init__(self, driver): super(BackupRecoveryPhrase, self).__init__(driver) @@ -330,6 +351,8 @@ class WalletView(BaseView): self.multiaccount_more_options = MultiaccountMoreOptions(self.driver) self.accounts_status_account = AccountElementButton(self.driver, account_name="Status account") self.collectibles_button = CollectiblesButton(self.driver) + self.cryptokitties_in_collectibles_button = CryptoKittiesInCollectiblesButton(self.driver) + self.view_in_cryptokitties_button = ViewInCryptoKittiesButton(self.driver) self.set_currency_button = SetCurrencyButton(self.driver) self.add_account_button = AddAccountButton(self.driver) self.add_an_account_button = AddAnAccountButton(self.driver)