Skip to content

Commit

Permalink
Test to check cryptokitty in wallet collectibles
Browse files Browse the repository at this point in the history
Signed-off-by: Serhy <sergii@status.im>
  • Loading branch information
Serhy committed Oct 4, 2019
1 parent 7286747 commit 58c6460
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,24 @@ def test_user_can_see_all_own_assets_after_account_recovering(self):
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):
Expand Down
2 changes: 1 addition & 1 deletion test/appium/tests/atomic/chats/test_one_to_one.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def test_offline_messaging_1_1_chat(self):
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()
Expand Down
8 changes: 8 additions & 0 deletions test/appium/tests/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@
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()

Expand Down
6 changes: 6 additions & 0 deletions test/appium/views/dapps_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from views.home_view import ChatElement



class OpenDAppButton(BaseButton):
def __init__(self, driver):
super(OpenDAppButton, self).__init__(driver)
Expand Down Expand Up @@ -30,26 +31,31 @@ def __init__(self, driver, name):
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):
Expand Down
23 changes: 23 additions & 0 deletions test/appium/views/wallet_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,27 @@ def __init__(self, driver):
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)
Expand Down Expand Up @@ -330,6 +351,8 @@ def __init__(self, driver):
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)
Expand Down

0 comments on commit 58c6460

Please sign in to comment.