Fixed e2e tests (high/medium)
Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
parent
17407b3680
commit
b9c7dbd5d2
|
@ -247,14 +247,13 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
|
||||||
sign_in = SignInView(self.driver)
|
sign_in = SignInView(self.driver)
|
||||||
sign_in.create_user()
|
sign_in.create_user()
|
||||||
profile = sign_in.profile_button.click()
|
profile = sign_in.profile_button.click()
|
||||||
profile.edit_button.click()
|
profile.profile_picture.click()
|
||||||
profile.edit_picture_button.click()
|
|
||||||
profile.capture_button.click()
|
profile.capture_button.click()
|
||||||
for _ in range(2):
|
for _ in range(2):
|
||||||
profile.deny_button.click()
|
profile.deny_button.click()
|
||||||
profile.element_by_text(camera_access_error_text).wait_for_visibility_of_element(3)
|
profile.element_by_text(camera_access_error_text).wait_for_visibility_of_element(3)
|
||||||
profile.ok_button.click()
|
profile.ok_button.click()
|
||||||
profile.edit_picture_button.click()
|
profile.profile_picture.click()
|
||||||
profile.capture_button.click()
|
profile.capture_button.click()
|
||||||
profile.deny_button.wait_for_visibility_of_element(2)
|
profile.deny_button.wait_for_visibility_of_element(2)
|
||||||
|
|
||||||
|
@ -264,13 +263,12 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
|
||||||
sign_in = SignInView(self.driver)
|
sign_in = SignInView(self.driver)
|
||||||
sign_in.create_user()
|
sign_in.create_user()
|
||||||
profile = sign_in.profile_button.click()
|
profile = sign_in.profile_button.click()
|
||||||
profile.edit_button.click()
|
profile.profile_picture.click()
|
||||||
profile.edit_picture_button.click()
|
|
||||||
profile.select_from_gallery_button.click()
|
profile.select_from_gallery_button.click()
|
||||||
profile.deny_button.click()
|
profile.deny_button.click()
|
||||||
profile.element_by_text(photos_access_error_text, element_type='text').wait_for_visibility_of_element(3)
|
profile.element_by_text(photos_access_error_text, element_type='text').wait_for_visibility_of_element(3)
|
||||||
profile.ok_button.click()
|
profile.ok_button.click()
|
||||||
profile.edit_picture_button.click()
|
profile.profile_picture.click()
|
||||||
profile.select_from_gallery_button.click()
|
profile.select_from_gallery_button.click()
|
||||||
profile.deny_button.wait_for_visibility_of_element(2)
|
profile.deny_button.wait_for_visibility_of_element(2)
|
||||||
|
|
||||||
|
|
|
@ -303,7 +303,7 @@ class TestTransactionDApp(SingleDeviceTestCase):
|
||||||
send_transaction_view = SendTransactionView(self.driver)
|
send_transaction_view = SendTransactionView(self.driver)
|
||||||
|
|
||||||
warning = 'No "Not enough ETH for gas" warning appeared while {}'
|
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
|
# Check whether sending 0 ETH with an empty ETH balance triggers the warning
|
||||||
send_transaction_view.sign_transaction_button.click()
|
send_transaction_view.sign_transaction_button.click()
|
||||||
|
@ -320,13 +320,13 @@ class TestTransactionDApp(SingleDeviceTestCase):
|
||||||
asset_button.click()
|
asset_button.click()
|
||||||
send_transaction_view.amount_edit_box.set_value('0')
|
send_transaction_view.amount_edit_box.set_value('0')
|
||||||
send_transaction_view.confirm()
|
send_transaction_view.confirm()
|
||||||
|
send_transaction_view.sign_transaction_button.click()
|
||||||
|
|
||||||
# Check whether sending 0 STT with an empty ETH balance triggers the warning
|
# 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():
|
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'))
|
self.errors.append(warning.format('sending 0 STT with an empty ETH balance'))
|
||||||
|
|
||||||
# Check whether sign transaction button is disabled
|
# Check whether sign transaction button is disabled
|
||||||
send_transaction_view.sign_transaction_button.click()
|
|
||||||
send_transaction_view.sign_with_password.click()
|
send_transaction_view.sign_with_password.click()
|
||||||
if send_transaction_view.enter_password_input.is_element_displayed():
|
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'))
|
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 = home_view.wallet_button.click()
|
||||||
wallet.accounts_status_account.click()
|
wallet.accounts_status_account.click()
|
||||||
wallet.send_transaction(asset_name='ETHro', amount=0.1, recipient=recipient, sign_transaction=False)
|
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
|
# Check whether sending all available ETH triggers the warning
|
||||||
if not send_transaction_view.validation_warnings.not_enough_eth_for_gas.is_element_displayed():
|
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)'))
|
self.errors.append(warning.format('sending all available ETH (no funds to pay gas)'))
|
||||||
|
|
||||||
# Check whether sign transaction button is disabled
|
# Check whether sign transaction button is disabled
|
||||||
send_transaction_view.sign_transaction_button.click()
|
|
||||||
send_transaction_view.sign_with_password.click()
|
send_transaction_view.sign_with_password.click()
|
||||||
if send_transaction_view.enter_password_input.is_element_displayed():
|
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
|
# 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()
|
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)
|
# 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():
|
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
|
# Check whether sign transaction button is disabled
|
||||||
send_transaction_view.sign_transaction_button.click()
|
send_transaction_view.sign_transaction_button.click()
|
||||||
if send_transaction_view.enter_password_input.is_element_displayed():
|
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.cancel_button.click()
|
||||||
send_transaction_view.amount_edit_box.clear()
|
send_transaction_view.amount_edit_box.clear()
|
||||||
send_transaction_view.amount_edit_box.set_value(eth_available_for_tx)
|
send_transaction_view.amount_edit_box.set_value(eth_available_for_tx)
|
||||||
send_transaction_view.confirm()
|
send_transaction_view.confirm()
|
||||||
|
send_transaction_view.sign_transaction_button.click()
|
||||||
|
|
||||||
# Check whether sending normal amount of ETH does not trigger the warning
|
# 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():
|
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')
|
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()
|
send_transaction_view.sign_transaction()
|
||||||
if not wallet.send_transaction_button.is_element_displayed():
|
if not wallet.send_transaction_button.is_element_displayed():
|
||||||
self.errors.append('Could not sign the transaction!')
|
self.errors.append('Could not sign the transaction!')
|
||||||
|
|
|
@ -118,7 +118,8 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
|
||||||
send_transaction.enter_password_input.click()
|
send_transaction.enter_password_input.click()
|
||||||
send_transaction.enter_password_input.send_keys('wrong_password')
|
send_transaction.enter_password_input.send_keys('wrong_password')
|
||||||
send_transaction.sign_button.click()
|
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)
|
@marks.testrail_id(1452)
|
||||||
def test_transaction_appears_in_history(self):
|
def test_transaction_appears_in_history(self):
|
||||||
|
|
|
@ -468,7 +468,7 @@ class WalletView(BaseView):
|
||||||
"""
|
"""
|
||||||
:param desired_currency: defines a currency designator which is expressed by ISO 4217 code
|
: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()
|
self.set_currency_button.click()
|
||||||
desired_currency = self.element_by_text_part(desired_currency)
|
desired_currency = self.element_by_text_part(desired_currency)
|
||||||
desired_currency.scroll_to_element()
|
desired_currency.scroll_to_element()
|
||||||
|
|
Loading…
Reference in New Issue