Skip to content

Commit

Permalink
Fix e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Serhy committed Jun 12, 2020
1 parent e80989d commit a871a3a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion test/appium/views/base_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ class AssetButton(BaseButton):
def __init__(self, driver, asset_name):
super(AssetButton, self).__init__(driver)
self.asset_name = asset_name
self.locator = self.Locator.xpath_selector('(//*[@content-desc=":' + self.asset_name + '-asset-value"])[last()]')
self.locator = self.Locator.xpath_selector('(//*[@content-desc=":' + self.asset_name + '-asset-value"])[1]')

@property
def name(self):
Expand Down
2 changes: 1 addition & 1 deletion test/appium/views/send_transaction_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __init__(self, driver):
class EnterRecipientAddressInputText(BaseText):
def __init__(self, driver):
super(EnterRecipientAddressInputText, self).__init__(driver)
self.locator = self.Locator.xpath_selector("//*[@content-desc='choose-recipient-button']/android.widget.TextView")
self.locator = self.Locator.xpath_selector("//*[@content-desc='choose-recipient-button']//android.widget.TextView")


class RecentRecipientsButton(BaseButton):
Expand Down
9 changes: 5 additions & 4 deletions test/appium/views/wallet_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ def __init__(self, driver):
class AssetText(BaseText):
def __init__(self, driver, asset):
super(AssetText, self).__init__(driver)
self.locator = self.Locator.xpath_selector("//*[@text='%s']/preceding-sibling::*[1]" % asset)
self.locator = self.Locator.xpath_selector("//android.view.ViewGroup[@content-desc=':%s-asset-value']"
"//android.widget.TextView[1]" % asset)


class AssetFullNameInAssets(BaseText):
Expand Down Expand Up @@ -157,7 +158,7 @@ def __init__(self, driver):
class AssetTextElement(BaseText):
def __init__(self, driver, asset_name):
super(AssetTextElement, self).__init__(driver)
self.locator = self.Locator.xpath_selector("//*[@text='%s']" % asset_name)
self.locator = self.Locator.text_part_selector(asset_name)


class CollectibleTextElement(BaseText):
Expand Down Expand Up @@ -365,7 +366,7 @@ def __init__(self, driver):
def select_color_by_position(self, position: int):
self.click()
self.driver.find_element_by_xpath(
"//*[@text='Cancel']/../preceding-sibling::android.widget.ScrollView/*/*[%s]" % position).click()
"((//android.widget.ScrollView)[last()]/*/*)[%s]" % str(position+1)).click()

# Add account on Generate An Account screen
class AddAccountGenerateAnAccountButton(BaseButton):
Expand Down Expand Up @@ -457,7 +458,7 @@ def get_account_options_by_name(self, account_name='Status account'):
def get_asset_amount_by_name(self, asset: str):
asset_value = AssetText(self.driver, asset)
asset_value.scroll_to_element()
return float(asset_value.text)
return float(asset_value.text.split()[0])

def verify_currency_balance(self, expected_rate: int, errors: list):
usd = self.get_usd_total_value()
Expand Down

0 comments on commit a871a3a

Please sign in to comment.