Fixed e2e tests (high/medium)

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
yevh-berdnyk 2019-08-26 18:09:30 +01:00 committed by Churikova Tetiana
parent 17407b3680
commit b9c7dbd5d2
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
4 changed files with 14 additions and 15 deletions

View File

@ -247,14 +247,13 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
sign_in = SignInView(self.driver)
sign_in.create_user()
profile = sign_in.profile_button.click()
profile.edit_button.click()
profile.edit_picture_button.click()
profile.profile_picture.click()
profile.capture_button.click()
for _ in range(2):
profile.deny_button.click()
profile.element_by_text(camera_access_error_text).wait_for_visibility_of_element(3)
profile.ok_button.click()
profile.edit_picture_button.click()
profile.profile_picture.click()
profile.capture_button.click()
profile.deny_button.wait_for_visibility_of_element(2)
@ -264,13 +263,12 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
sign_in = SignInView(self.driver)
sign_in.create_user()
profile = sign_in.profile_button.click()
profile.edit_button.click()
profile.edit_picture_button.click()
profile.profile_picture.click()
profile.select_from_gallery_button.click()
profile.deny_button.click()
profile.element_by_text(photos_access_error_text, element_type='text').wait_for_visibility_of_element(3)
profile.ok_button.click()
profile.edit_picture_button.click()
profile.profile_picture.click()
profile.select_from_gallery_button.click()
profile.deny_button.wait_for_visibility_of_element(2)

View File

@ -303,7 +303,7 @@ class TestTransactionDApp(SingleDeviceTestCase):
send_transaction_view = SendTransactionView(self.driver)
warning = 'No "Not enough ETH for gas" warning appeared while {}'
sign_button_warning = 'Signin transaction button is enabled {}'
sign_button_warning = 'Sign transaction button is enabled {}'
# Check whether sending 0 ETH with an empty ETH balance triggers the warning
send_transaction_view.sign_transaction_button.click()
@ -320,13 +320,13 @@ class TestTransactionDApp(SingleDeviceTestCase):
asset_button.click()
send_transaction_view.amount_edit_box.set_value('0')
send_transaction_view.confirm()
send_transaction_view.sign_transaction_button.click()
# Check whether sending 0 STT with an empty ETH balance triggers the warning
if not send_transaction_view.validation_warnings.not_enough_eth_for_gas.is_element_displayed():
self.errors.append(warning.format('sending 0 STT with an empty ETH balance'))
# Check whether sign transaction button is disabled
send_transaction_view.sign_transaction_button.click()
send_transaction_view.sign_with_password.click()
if send_transaction_view.enter_password_input.is_element_displayed():
self.errors.append(sign_button_warning.format('sending 0 STT with an empty ETH balance'))
@ -340,16 +340,16 @@ class TestTransactionDApp(SingleDeviceTestCase):
wallet = home_view.wallet_button.click()
wallet.accounts_status_account.click()
wallet.send_transaction(asset_name='ETHro', amount=0.1, recipient=recipient, sign_transaction=False)
send_transaction_view.sign_transaction_button.click()
# Check whether sending all available ETH triggers the warning
if not send_transaction_view.validation_warnings.not_enough_eth_for_gas.is_element_displayed():
self.errors.append(warning.format('sending all available ETH (no funds to pay gas)'))
# Check whether sign transaction button is disabled
send_transaction_view.sign_transaction_button.click()
send_transaction_view.sign_with_password.click()
if send_transaction_view.enter_password_input.is_element_displayed():
self.errors.append('sending all available ETH (no funds to pay gas)')
self.errors.append(warning.format('sending all available ETH (no funds to pay gas)'))
# Because tx gas price may change we calculate eth value according to current gas fee value
transaction_fee_total = send_transaction_view.get_transaction_fee_total()
@ -362,23 +362,23 @@ class TestTransactionDApp(SingleDeviceTestCase):
# Check whether sending big amount of ETH triggers the warning (no funds to pay gas)
if not send_transaction_view.validation_warnings.not_enough_eth_for_gas.is_element_displayed():
self.errors.append('sending big amount of ETH (no funds to pay gas)')
self.errors.append(warning.format('sending big amount of ETH (no funds to pay gas)'))
# Check whether sign transaction button is disabled
send_transaction_view.sign_transaction_button.click()
if send_transaction_view.enter_password_input.is_element_displayed():
self.errors.append('sending big amount of ETH (no funds to pay gas)')
self.errors.append(warning.format('sending big amount of ETH (no funds to pay gas)'))
send_transaction_view.cancel_button.click()
send_transaction_view.amount_edit_box.clear()
send_transaction_view.amount_edit_box.set_value(eth_available_for_tx)
send_transaction_view.confirm()
send_transaction_view.sign_transaction_button.click()
# Check whether sending normal amount of ETH does not trigger the warning
if send_transaction_view.validation_warnings.not_enough_eth_for_gas.is_element_displayed():
self.errors.append('"Not enough ETH for gas" warning appeared while sending normal amount of ETH')
send_transaction_view.sign_transaction_button.click()
send_transaction_view.sign_transaction()
if not wallet.send_transaction_button.is_element_displayed():
self.errors.append('Could not sign the transaction!')

View File

@ -118,7 +118,8 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
send_transaction.enter_password_input.click()
send_transaction.enter_password_input.send_keys('wrong_password')
send_transaction.sign_button.click()
send_transaction.find_text_part('Wrong password', 20)
if send_transaction.element_by_text_part('Transaction sent').is_element_displayed():
self.driver.fail('Transaction was sent with a wrong password')
@marks.testrail_id(1452)
def test_transaction_appears_in_history(self):

View File

@ -468,7 +468,7 @@ class WalletView(BaseView):
"""
:param desired_currency: defines a currency designator which is expressed by ISO 4217 code
"""
self.multiaccount_more_options.click()
self.multiaccount_more_options.click_until_presence_of_element(self.set_currency_button)
self.set_currency_button.click()
desired_currency = self.element_by_text_part(desired_currency)
desired_currency.scroll_to_element()