fixes for e2e + new ids for elements

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
Churikova Tetiana 2020-08-18 11:47:00 +02:00
parent c2277cbbe5
commit d5fc93aa55
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
3 changed files with 15 additions and 13 deletions

View File

@ -20,10 +20,11 @@
portfolio-value [:account-portfolio-value address]
prices-loading? [:prices-loading?]]
[react/touchable-highlight
{:on-press #(re-frame/dispatch [:navigate-to :wallet-account account])
:on-long-press #(re-frame/dispatch [:bottom-sheet/show-sheet
{:content (fn [] [sheets/send-receive account type])
:content-height 130}])}
{:on-press #(re-frame/dispatch [:navigate-to :wallet-account account])
:accessibility-label (str "accountcard" name)
:on-long-press #(re-frame/dispatch [:bottom-sheet/show-sheet
{:content (fn [] [sheets/send-receive account type])
:content-height 130}])}
[react/view {:style (styles/card color)}
[react/view {:flex-direction :row :align-items :center :justify-content :space-between}
[react/view {:style {:flex-direction :row}}
@ -45,9 +46,10 @@
address]]]]))
(defn add-card []
[react/touchable-highlight {:on-press #(re-frame/dispatch [:bottom-sheet/show-sheet
{:content sheets/add-account
:content-height 260}])}
[react/touchable-highlight {:on-press #(re-frame/dispatch [:bottom-sheet/show-sheet
{:content sheets/add-account
:content-height 260}])
:accessibility-label "add-new-account"}
[react/view {:style (styles/add-card)}
[react/view {:width 40 :height 40 :justify-content :center :border-radius 20
:align-items :center :background-color colors/blue-transparent-10 :margin-bottom 8}

View File

@ -254,7 +254,7 @@ class TestWalletManagement(SingleDeviceTestCase):
account_name = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(10))
wallet_view.account_name_input.send_keys(account_name)
wallet_view.account_color_button.select_color_by_position(1)
if wallet_view.get_account_options_by_name(account_name).is_element_displayed():
if wallet_view.get_account_by_name(account_name).is_element_displayed():
self.driver.fail('Account is added without password')
wallet_view.enter_your_password_input.send_keys('000000')
wallet_view.add_account_generate_account_button.click()
@ -299,7 +299,7 @@ class TestWalletManagement(SingleDeviceTestCase):
self.errors.append('Send button is shown on watch-only wallet')
if not wallet_view.element_by_text('Watch-only').is_element_displayed():
self.errors.append('No "Watch-only" label is shown on watch-only wallet')
wallet_view.receive_transaction_button.click_until_presence_of_element(wallet_view.address_text.text)
wallet_view.receive_transaction_button.click_until_presence_of_element(wallet_view.address_text)
if wallet_view.address_text.text[2:] != basic_user['address']:
self.errors.append('Wrong address %s is shown in "Receive" popup for watch-only account ' % wallet_view.address_text.text)
wallet_view.close_share_popup()
@ -335,7 +335,7 @@ class TestWalletManagement(SingleDeviceTestCase):
account_name = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(10))
wallet_view.account_name_input.send_keys(account_name)
wallet_view.add_account_generate_account_button.click()
if wallet_view.get_account_options_by_name(account_name).is_element_displayed():
if wallet_view.get_account_by_name(account_name).is_element_displayed():
self.driver.fail('Account is added without seed phrase')
wallet_view.enter_seed_phrase_input.set_value(str(wallet_users['C']['passphrase']).upper())
wallet_view.add_account_generate_account_button.click()
@ -375,7 +375,7 @@ class TestWalletManagement(SingleDeviceTestCase):
account_name = ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(10))
wallet_view.account_name_input.send_keys(account_name)
wallet_view.add_account_generate_account_button.click()
if wallet_view.get_account_options_by_name(account_name).is_element_displayed():
if wallet_view.get_account_by_name(account_name).is_element_displayed():
self.driver.fail('Account is added with wrong private key')
wallet_view.enter_a_private_key_input.set_value(wallet_users['C']['private_key'])
wallet_view.add_account_generate_account_button.click()

View File

@ -239,7 +239,7 @@ class AccountElementButton(BaseButton):
def __init__(self, driver, account_name):
super(AccountElementButton, self).__init__(driver)
self.locator = self.Locator.xpath_selector(
"//android.widget.HorizontalScrollView//*[@text='%s']/.." % account_name)
"//*[@content-desc='accountcard%s']" % account_name)
def color_matches(self, expected_color_image_name: str):
amount_text = BaseText(self.driver)
@ -291,7 +291,7 @@ class AddCustomTokenButton(BaseButton):
class AddAccountButton(BaseButton):
def __init__(self, driver):
super(AddAccountButton, self).__init__(driver)
self.locator = self.Locator.text_selector('Add account')
self.locator = self.Locator.accessibility_id('add-new-account')
class GenerateAnAccountButton(BaseButton):