Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e2e: delete messages #12484

Merged
merged 3 commits into from
Sep 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
28 changes: 19 additions & 9 deletions test/appium/tests/atomic/chats/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def test_request_and_receive_stt_in_1_1_chat_offline(self):
wallet_1.home_button.click()
home_2 = device_2.recover_access(passphrase=sender['passphrase'])
wallet_2 = home_2.wallet_button.click()
initial_amount_STT = wallet_2.get_asset_amount_by_name('STT')
wallet_2.home_button.click()

device_2.just_fyi('Add recipient to contact and send 1 message')
Expand Down Expand Up @@ -145,15 +146,24 @@ 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.toggle_airplane_mode() for chat in (chat_1, chat_2)]
self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount, token=True)
for home in (home_1, home_2):
home.toggle_airplane_mode()
home.home_button.double_click()
home.connection_offline_icon.wait_for_invisibility_of_element(100)
home_1.get_chat(sender['username']).click()
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)]

home_1.just_fyi('Check that can find tx in history and balance is updated after offline')
home_2.wallet_button.click()
wallet_2.wait_balance_is_changed('STT', initial_amount_STT)
wallet_2.find_transaction_in_history(amount=amount, asset='STT')

self.errors.verify_no_errors()

@marks.testrail_id(6265)
Expand Down
43 changes: 23 additions & 20 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 All @@ -100,6 +95,7 @@ def test_keycard_request_and_receive_stt_in_1_1_chat_offline_opened_from_push(se

home_2 = device_2.recover_access(passphrase=sender['passphrase'], keycard=True, enable_notifications=True)
wallet_2 = home_2.wallet_button.click()
initial_amount_STT = wallet_2.get_asset_amount_by_name('STT')
wallet_2.home_button.click()

device_2.just_fyi('Add recipient to contact and send 1 message')
Expand Down Expand Up @@ -141,16 +137,23 @@ def test_keycard_request_and_receive_stt_in_1_1_chat_offline_opened_from_push(se
send_message = chat_2_sender_message.sign_and_send.click()
send_message.next_button.click()
send_message.sign_transaction(keycard=True)
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()
# chat_1_request_message.transaction_status.wait_for_element_text(chat_1_request_message.confirmed, wait_time=60)
# [message.transaction_status.wait_for_element_text(message.confirmed, wait_time=60) for message in
# (chat_2_sender_message, chat_1_request_message)]
chat_1.toggle_airplane_mode()

home_2.just_fyi('Check that transaction message is updated with new status after offline')
[chat.toggle_airplane_mode() for chat in (chat_1, chat_2)]
self.network_api.wait_for_confirmation_of_transaction(sender['address'], amount, token=True)
for home in (home_1, home_2):
home.toggle_airplane_mode()
home.home_button.double_click()
home_1.get_chat(sender['username']).click()
home_2.get_chat(recipient_username).click()
chat_2_sender_message.transaction_status.wait_for_element_text(chat_2_sender_message.confirmed, wait_time=120)

home_1.just_fyi('Check that can find tx in history and balance is updated after offline')
[home.wallet_button.click() for home in (home_1, home_2)]
wallet_2.wait_balance_is_changed('STT', initial_amount_STT)
wallet_1.wait_balance_is_changed('STT')
[wallet.find_transaction_in_history(amount=amount, asset='STT') for wallet in (wallet_1, wallet_2)]
self.errors.verify_no_errors()


Expand Down