Skip to content

Commit

Permalink
e2e: more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
churik committed Sep 1, 2021
1 parent c73b6a0 commit 2eb17f2
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 70 deletions.
2 changes: 1 addition & 1 deletion test/appium/support/api/network_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def find_transaction_by_unique_amount(self, address, amount, token=False, decima
self.log("Failed iterate transactions: " + str(e))
pytest.fail("No valid JSON response from Etherscan: %s " % str(e))

def wait_for_confirmation_of_transaction(self, address, amount, confirmations=3, token=False):
def wait_for_confirmation_of_transaction(self, address, amount, confirmations=6, token=False):
start_time = time.time()
if token:
token_info = "token transaction"
Expand Down
5 changes: 3 additions & 2 deletions test/appium/tests/atomic/account_management/test_keycard.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,9 +555,10 @@ def test_keycard_frozen_card_flows(self):
profile.profile_button.double_click()
profile.keycard_button.scroll_and_click()
profile.change_pin_button.click()
if not home.element_by_translation_id("keycard-reset-passcode").is_element_displayed():
keycard.enter_default_pin()
if not home.element_by_translation_id("keycard-is-frozen-title").is_element_displayed():
self.driver.fail("No reset card flow is shown for frozen card")
home.element_by_text('reset with mnemonic').click()
home.element_by_translation_id("keycard-is-frozen-factory-reset").click()
sign_in.seedphrase_input.set_value(transaction_senders['A']['passphrase'])
sign_in.next_button.click()
if not home.element_by_translation_id("seed-key-uid-mismatch").is_element_displayed():
Expand Down
35 changes: 0 additions & 35 deletions test/appium/tests/atomic/account_management/test_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,41 +578,6 @@ def test_set_primary_ens_custom_domain(self):
self.errors.verify_no_errors()


@marks.testrail_id(5468)
@marks.medium
@marks.skip
# TODO: skip until profile picture change feature is enabled
def test_deny_camera_access_changing_profile_photo(self):
sign_in = SignInView(self.driver)
sign_in.create_user()
profile = sign_in.profile_button.click()
profile.profile_picture.click()
profile.capture_button.click()
for _ in range(2):
profile.deny_button.click()
profile.element_by_translation_id("camera-access-error").wait_for_visibility_of_element(3)
profile.ok_button.click()
profile.profile_picture.click()
profile.capture_button.click()
profile.deny_button.wait_for_visibility_of_element(2)

@marks.testrail_id(5469)
@marks.medium
@marks.skip
# TODO: skip until profile picture change feature is enabled
def test_deny_device_storage_access_changing_profile_photo(self):
sign_in = SignInView(self.driver)
sign_in.create_user()
profile = sign_in.profile_button.click()
profile.profile_picture.click()
profile.select_from_gallery_button.click()
profile.deny_button.click()
profile.element_by_translation_id(id="external-storage-denied", element_type='text').wait_for_visibility_of_element(3)
profile.ok_button.click()
profile.profile_picture.click()
profile.select_from_gallery_button.click()
profile.deny_button.wait_for_visibility_of_element(2)


class TestProfileMultipleDevice(MultipleDeviceTestCase):

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,8 @@ def test_collectible_from_wallet(self):
web_view = wallet.get_webview_view()
web_view.wait_for_d_aap_to_load(10)
wallet.swipe_by_custom_coordinates(0.5,0.8,0.5,0.7)
wallet.element_by_text('Sign In').wait_and_click(60)
if not wallet.allow_button.is_element_displayed(40):
self.errors.append('Can not sign in in OpenSea dapp')
wallet.element_by_text('Sign In').wait_for_element(60)
wallet.element_by_text('Sign In').click_until_presence_of_element(wallet.allow_button)
self.errors.verify_no_errors()

@marks.testrail_id(5341)
Expand Down
9 changes: 4 additions & 5 deletions test/appium/tests/atomic/chats/test_chats_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,10 @@ def test_delete_chats_via_delete_button_rejoin(self):
if home.get_chat_from_home_view(chat_name).is_element_displayed():
self.errors.append('Deleted %s is shown after re-login, but the chat has been deleted' % chat_name)

# TODO: blocked due to #11683 - enable after fix
# sign_in.just_fyi('Rejoin public chat and check that messages are fetched again')
# public_chat = home.join_public_chat(public[1:])
# if not public_chat.chat_element_by_text(messages[1]).is_element_displayed(20):
# self.errors.append('Messages are not fetched when rejoining public chat after deleting')
sign_in.just_fyi('Rejoin public chat and check that messages are fetched again')
public_chat = home.join_public_chat(public[1:])
if not public_chat.chat_element_by_text(messages[1]).is_element_displayed(20):
self.errors.append('Messages are not fetched when rejoining public chat after deleting')

self.errors.verify_no_errors()

Expand Down
19 changes: 10 additions & 9 deletions test/appium/tests/atomic/chats/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,16 @@ def test_request_and_receive_stt_in_1_1_chat_offline(self):
send_message = chat_2_sender_message.sign_and_send.click()
send_message.next_button.click()
send_message.sign_transaction()
chat_2_sender_message.transaction_status.wait_for_element_text(chat_2_sender_message.pending, wait_time=60)

# TODO: blocked because of #12256
# home_2.just_fyi('Check that transaction message is updated with new status after offline')
# chat_2.toggle_airplane_mode()
# self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount, token=True)
# chat_2.toggle_airplane_mode()
#[message.transaction_status.wait_for_element_text(message.confirmed, wait_time=60) for message in
#(chat_2_sender_message, chat_1_request_message)]

home_2.just_fyi('Check that transaction message is updated with new status after offline')
chat_2.toggle_airplane_mode()
self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount, token=True)
chat_2.toggle_airplane_mode()
chat_2.home_button.double_click()
home_2.connection_offline_icon.wait_for_invisibility_of_element(100)
home_2.get_chat(recipient_username).click()
[message.transaction_status.wait_for_element_text(message.confirmed, wait_time=120) for message in
(chat_2_sender_message, chat_1_request_message)]
self.errors.verify_no_errors()

@marks.testrail_id(6265)
Expand Down
15 changes: 5 additions & 10 deletions test/appium/tests/atomic/chats/test_keycard_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ def test_keycard_send_eth_in_1_1_chat(self):
home_1 = device_1.recover_access(passphrase=sender['passphrase'], keycard=True)
home_2 = device_2.create_user(keycard=True)
recipient_public_key, recipient_username = home_2.get_public_key_and_username(return_username=True)
wallet_1, wallet_2 = home_1.wallet_button.click(), home_2.wallet_button.click()
for wallet in (wallet_1, wallet_2):
wallet.home_button.click()
home_2.home_button.click()

chat_1 = home_1.add_contact(recipient_public_key)
amount = chat_1.get_unique_amount()
account_name = wallet_1.status_account_name
account_name = chat_1.status_account_name

home_1.just_fyi('Send %s ETH in 1-1 chat and check it for sender and receiver: Address requested' % amount)
chat_1.commands_button.click()
Expand Down Expand Up @@ -67,18 +65,15 @@ def test_keycard_send_eth_in_1_1_chat(self):
if updated_timestamp_sender == timestamp_sender:
self.errors.append("Timestamp of message is not updated after signing transaction")

chat_1.wallet_button.click()
wallet_1 = chat_1.wallet_button.click()
wallet_1.find_transaction_in_history(amount=amount)
self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount)
wallet_1.home_button.click(desired_view='chat')

home_1.just_fyi("Check 'Confirmed' state for sender and receiver(use pull-to-refresh to update history)")
chat_2.wallet_button.click()
wallet_2 = chat_2.wallet_button.click()
wallet_2.find_transaction_in_history(amount=amount)
wallet_2.home_button.click(desired_view="chat")
[message.transaction_status.wait_for_element_text(message.confirmed, 60) for message in
(sender_message, receiver_message)]

sender_message.transaction_status.wait_for_element_text(sender_message.confirmed, 120)
self.errors.verify_no_errors()

@marks.testrail_id(6294)
Expand Down
6 changes: 1 addition & 5 deletions test/appium/views/wallet_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,25 +158,21 @@ def wait_balance_is_changed(self, asset ='ETH', initial_balance=0, wait_time=400
elif self.asset_by_name(asset).is_element_present() and self.get_asset_amount_by_name(asset) == initial_balance:
if scan_tokens:
self.scan_tokens()
if not self.transaction_history_button.is_element_displayed():
self.wallet_account_by_name(self.status_account_name).click()
if (counter/60).is_integer():
self.pull_to_refresh()
counter+=20
self.wallet_button.double_click()
#self.wallet_button.double_click()
counter += 10
time.sleep(10)
self.driver.info('*Waiting %ss for %s updated balance*' % (counter,asset))
elif not self.asset_by_name(asset).is_element_present(10):
if scan_tokens:
self.scan_tokens()
self.swipe_up()
counter += 10
time.sleep(10)
self.driver.info('*Waiting %s seconds for %s to display asset*' % (counter, asset))
else:
self.driver.info('**Balance is updated!**')
self.wallet_button.double_click()
self.element_by_translation_id("wallet-total-value").scroll_to_element(direction='up')
return self

Expand Down

0 comments on commit 2eb17f2

Please sign in to comment.