Skip to content

Commit

Permalink
align e2e with reactions
Browse files Browse the repository at this point in the history
Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
  • Loading branch information
churik committed Jul 31, 2020
1 parent 1c308c2 commit d0ce6f1
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 40 deletions.
3 changes: 1 addition & 2 deletions test/appium/tests/atomic/account_management/test_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,6 @@ def test_pair_devices_sync_one_to_one_contacts_public_chat(self):
public_chat_before_sync = 'before-pairing'
public_chat_after_sync = 'after-pairing'


device_1.just_fyi('add contact, start 1-1 chat with basic user')
device_1_chat = device_1_home.add_contact(basic_user['public_key'])
device_1_chat.chat_message_input.send_keys(message_before_sync)
Expand Down Expand Up @@ -938,7 +937,7 @@ def test_pair_devices_sync_one_to_one_contacts_public_chat(self):
chat = device_2_home.get_chat(basic_user['username']).click()
if chat.chat_element_by_text(message_before_sync).is_element_displayed():
self.errors.append('"%s" message sent before pairing is synced' % message_before_sync)
if not chat.chat_element_by_text(message_after_sync).is_element_displayed():
if not chat.chat_element_by_text(message_after_sync).is_element_displayed(60):
self.errors.append('"%s" message in 1-1 is not synced' % message_after_sync)

device_1.just_fyi('add new public chat and check that it will be synced with device2')
Expand Down
16 changes: 8 additions & 8 deletions test/appium/tests/atomic/chats/test_chats_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,19 +669,19 @@ def test_open_user_profile_long_press_on_message(self):
device_1_chat = home_1.add_contact(device_2_public_key)
device_1_chat.send_message(message_from_sender)
device_1_chat.chat_element_by_text(message_from_sender).long_press_element()
if device_1_chat.view_profile_button.is_element_displayed():
self.errors.append('1-1 chat: "view profile" is shown on long tap on sent message')
device_1_chat.get_back_to_home_view()
if device_1_chat.view_profile_by_avatar_button.is_element_displayed():
self.errors.append('Member photo is shown on long tap on sent message from 1-1 chat')
device_1_chat.click_system_back_button(2)

device_2.just_fyi("1-1 chat: receiver verifies that can open sender profile on long tap on message")
home_2.home_button.click()
device_2_chat_item = home_2.get_chat(device_1_username)
device_2_chat_item.wait_for_visibility_of_element(20)
device_2_chat = device_2_chat_item.click()
device_2_chat.view_profile_long_press(message_from_sender)
if not device_2_chat.profile_add_to_contacts.is_element_displayed():
self.errors.append('1-1 chat: another user profile is not opened on long tap on received message')
device_2_chat.get_back_to_home_view()
device_2_chat.chat_element_by_text(message_from_sender).long_press_element()
if device_2_chat.view_profile_by_avatar_button.is_element_displayed():
self.errors.append('1-1 chat: another user profile is opened on long tap on received message')
device_2_chat.click_system_back_button(2)

device_1.just_fyi('Public chat: send message and verify that user profile can be opened on long press on message')
chat_name = device_1.get_random_chat_name()
Expand All @@ -690,7 +690,7 @@ def test_open_user_profile_long_press_on_message(self):
chat_public_1, chat_public_2 = home_1.get_chat_view(), home_2.get_chat_view()
chat_public_2.send_message(message_from_receiver)
chat_public_2.chat_element_by_text(message_from_receiver).long_press_element()
if chat_public_2.view_profile_button.is_element_displayed():
if chat_public_2.view_profile_by_avatar_button.is_element_displayed():
self.errors.append('Public chat: "view profile" is shown on long tap on sent message')
chat_public_1.view_profile_long_press(message_from_receiver)
if not chat_public_1.remove_from_contacts.is_element_displayed():
Expand Down
22 changes: 14 additions & 8 deletions test/appium/tests/atomic/chats/test_one_to_one.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,14 @@ def test_install_pack_and_send_sticker(self):
if device2_one_to_one_chat.element_by_text_part('Free').is_element_displayed():
self.errors.append('Stickerpack was not installed')

device_2_home.just_fyi('check that can navigate to another user profile via long tap on sticker message')
device2_one_to_one_chat.cross_icon.click()
device2_one_to_one_chat.chat_item.long_press_element()
device2_one_to_one_chat.element_by_text('View Details').click()
if not device2_one_to_one_chat.profile_block_contact.is_element_displayed():
self.errors.append('No navigate to user profile after tapping View Details on sticker message')


self.errors.verify_no_errors()

@marks.testrail_id(6305)
Expand Down Expand Up @@ -292,9 +300,8 @@ def test_image_in_one_to_one_send_save_reply(self):
for message in device_1_chat.image_chat_item, device_1_chat.chat_element_by_text(image_description):
if not message.is_element_displayed():
self.errors.append('Image or description is not shown in chat after sending for sender')
# TODO: to investigate after new chat input
# if not device_1_chat.image_chat_item.is_element_image_equals_template('message_image_sender.png'):
# self.errors.append("Image doesn't match expected template for sender")
if not device_1_chat.image_chat_item.is_element_image_equals_template('message_image_sender.png'):
self.errors.append("Image doesn't match expected template for sender")
device_1_chat.show_images_button.click()
device_1_chat.image_from_gallery_button.click()
device_1_chat.click_system_back_button()
Expand All @@ -310,13 +317,12 @@ def test_image_in_one_to_one_send_save_reply(self):
for message in device_2_chat.image_chat_item, device_2_chat.chat_element_by_text(image_description):
if not message.is_element_displayed():
self.errors.append('Image or description is not shown in chat after sending for receiver')
# TODO: to investigate after new chat input
# if not device_2_chat.image_chat_item.is_element_image_equals_template('message_image_receiver.png'):
# self.errors.append("Image doesn't match expected template for receiver")
if not device_2_chat.image_chat_item.is_element_image_equals_template('message_image_receiver.png'):
self.errors.append("Image doesn't match expected template for receiver")
device_2_chat.image_chat_item.long_press_element()
for element in device_2_chat.reply_message_button, device_2_chat.save_image_button, device_2_chat.view_profile_button:
for element in device_2_chat.reply_message_button, device_2_chat.save_image_button:
if not element.is_element_displayed():
self.errors.append('Save and reply are not available on long-press on own image messages')
self.errors.append('Save and reply are not available on long-press on received image messages')

device_1_home.just_fyi('save image')
device_1_chat.save_image_button.click()
Expand Down
44 changes: 23 additions & 21 deletions test/appium/tests/atomic/transactions/test_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,9 @@ def test_validation_amount_errors(self):
if not send_transaction.validation_error_element.is_element_displayed(10):
self.errors.append('Validation icon is not shown when testing %s on %s' % (errors['sending_screen']['Network fee'],screen))
send_transaction.get_validation_icon().click()
if not send_transaction.element_by_text_part(errors['sending_screen']['Network fee']).is_element_displayed(10):
self.errors.append(warning % (errors['sending_screen']['Network fee'],screen))
# TODO: disbled until redo of Network fee validation element
# if not send_transaction.element_by_text_part(errors['sending_screen']['Network fee']).is_element_displayed(10):
# self.errors.append(warning % (errors['sending_screen']['Network fee'],screen))
send_transaction.sign_with_password.click()
if send_transaction.enter_password_input.is_element_displayed():
self.errors.append('Sign button is active when not enough ETH for gas')
Expand All @@ -613,24 +614,25 @@ def test_validation_amount_errors(self):
send_transaction.cancel_button.click()

screen = 'sending screen from DApp'
sign_in_view.just_fyi('Checking %s on %s' % (errors['sending_screen']['Network fee'], screen))
home_view = wallet_view.home_button.click()
dapp_view = sign_in_view.dapp_tab_button.click()
dapp_view.select_account_button.click()
dapp_view.select_account_by_name(account_name).wait_for_element(30)
dapp_view.select_account_by_name(account_name).click()
status_test_dapp = home_view.open_status_test_dapp()
status_test_dapp.wait_for_d_aap_to_load()
status_test_dapp.transactions_button.click_until_presence_of_element(
status_test_dapp.send_two_tx_in_batch_button)
status_test_dapp.send_two_tx_in_batch_button.click()
if not send_transaction.validation_error_element.is_element_displayed(10):
self.errors.append(warning % (errors['sending_screen']['Network fee'],screen))
send_transaction.cancel_button.click()

for element in errors['sending_screen']:
send_transaction.get_validation_icon(element).click()
if not send_transaction.element_by_text_part(errors['sending_screen'][element]).is_element_displayed(10):
self.errors.append(warning % (errors['sending_screen'][element], screen))
# TODO: disbled until redo of Network fee validation element
# sign_in_view.just_fyi('Checking %s on %s' % (errors['sending_screen']['Network fee'], screen))
# home_view = wallet_view.home_button.click()
# dapp_view = sign_in_view.dapp_tab_button.click()
# dapp_view.select_account_button.click()
# dapp_view.select_account_by_name(account_name).wait_for_element(30)
# dapp_view.select_account_by_name(account_name).click()
# status_test_dapp = home_view.open_status_test_dapp()
# status_test_dapp.wait_for_d_aap_to_load()
# status_test_dapp.transactions_button.click_until_presence_of_element(
# status_test_dapp.send_two_tx_in_batch_button)
# status_test_dapp.send_two_tx_in_batch_button.click()
# if not send_transaction.validation_error_element.is_element_displayed(10):
# self.errors.append(warning % (errors['sending_screen']['Network fee'],screen))
# send_transaction.cancel_button.click()
#
# for element in errors['sending_screen']:
# send_transaction.get_validation_icon(element).click()
# if not send_transaction.element_by_text_part(errors['sending_screen'][element]).is_element_displayed(10):
# self.errors.append(warning % (errors['sending_screen'][element], screen))
self.errors.verify_no_errors()

7 changes: 6 additions & 1 deletion test/appium/views/chat_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ def __init__(self, driver):
super(ViewProfileButton, self).__init__(driver)
self.locator = self.Locator.xpath_selector('//*[@text="View profile"]')

class ViewProfileByAvatarButton(BaseButton):
def __init__(self, driver):
super(ViewProfileByAvatarButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id('member-photo')

class NoMessagesInChatText(BaseText):
def __init__(self, driver):
Expand Down Expand Up @@ -635,6 +639,7 @@ def __init__(self, driver):

self.chat_settings = ChatSettings(self.driver)
self.view_profile_button = ViewProfileButton(self.driver)
self.view_profile_by_avatar_button = ViewProfileByAvatarButton(self.driver)
self.user_options = UserOptions(self.driver)
self.remove_button = RemoveButton(self.driver)

Expand Down Expand Up @@ -738,7 +743,7 @@ def quote_message(self, message = str):

def view_profile_long_press(self, message = str):
self.chat_element_by_text(message).long_press_element()
self.view_profile_button.click()
self.view_profile_by_avatar_button.click()
self.profile_block_contact.wait_for_visibility_of_element(5)

def move_to_messages_by_time_marker(self, marker='Today'):
Expand Down
Binary file modified test/appium/views/elements_templates/message_image_receiver.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/appium/views/elements_templates/message_image_sender.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d0ce6f1

Please sign in to comment.