e2e: fixes

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
Churikova Tetiana 2021-12-16 17:25:42 +01:00
parent 15d671275f
commit 032a8786ff
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
11 changed files with 58 additions and 39 deletions

View File

@ -1036,7 +1036,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
profile_1.mail_server_button.click() profile_1.mail_server_button.click()
profile_1.use_history_node_button.click() profile_1.use_history_node_button.click()
profile_1.home_button.click(desired_view='chat') profile_1.home_button.click(desired_view='chat')
if not public_chat_1.chat_element_by_text(message).is_element_displayed(30): if not public_chat_1.chat_element_by_text(message).is_element_displayed(60):
self.errors.append('History was not fetched after enabling use_history_node') self.errors.append('History was not fetched after enabling use_history_node')
self.errors.verify_no_errors() self.errors.verify_no_errors()
@ -1287,6 +1287,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
if not channel_2.chat_element_by_text(message_after_sync).is_element_displayed(30): if not channel_2.chat_element_by_text(message_after_sync).is_element_displayed(30):
self.errors.append("Message sent to community channel after sync is not shown!") self.errors.append("Message sent to community channel after sync is not shown!")
[channel.back_button.click() for channel in (channel_1, channel_2)] [channel.back_button.click() for channel in (channel_1, channel_2)]
[home.get_chat(comm_before_sync_name, community=True).click() for home in (home_1, home_2)]
comm_before_1.add_channel(channel_after_sync) comm_before_1.add_channel(channel_after_sync)
if not comm_before_2.get_chat(channel_after_sync).is_element_displayed(30): if not comm_before_2.get_chat(channel_after_sync).is_element_displayed(30):
self.errors.append("New added channel after sync is not shown!") self.errors.append("New added channel after sync is not shown!")

View File

@ -616,7 +616,6 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
device_1.just_fyi('check that new messages from blocked user are not delivered') device_1.just_fyi('check that new messages from blocked user are not delivered')
self.drivers[0].launch_app() self.drivers[0].launch_app()
device_1.sign_in() device_1.sign_in()
home_1.join_public_chat(chat_name)
for message in message_before_block_2, message_after_block_2: for message in message_before_block_2, message_after_block_2:
if chat_public_1.chat_element_by_text(message).is_element_displayed(): if chat_public_1.chat_element_by_text(message).is_element_displayed():
self.errors.append( self.errors.append(
@ -1019,7 +1018,7 @@ class TestChatManagementMultipleDevice(MultipleDeviceTestCase):
public_1.chat_message_input.send_keys('@') public_1.chat_message_input.send_keys('@')
if (chat_1.search_user_in_mention_suggestion_list(ens_nickname_value).is_element_displayed() or if (chat_1.search_user_in_mention_suggestion_list(ens_nickname_value).is_element_displayed() or
chat_1.search_user_in_mention_suggestion_list(sender['username']).is_element_displayed()): chat_1.search_user_in_mention_suggestion_list(sender['username']).is_element_displayed()):
self.errors.append('Blcoked user is available in mention suggestion list') self.errors.append('Blocked user is available in mention suggestion list')
self.errors.verify_no_errors() self.errors.verify_no_errors()

View File

@ -11,7 +11,7 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
@marks.critical @marks.critical
@marks.transaction @marks.transaction
def test_send_eth_in_1_1_chat_transaction_push(self): def test_send_eth_in_1_1_chat_transaction_push(self):
sender = transaction_senders['A'] sender = transaction_senders['B']
self.create_drivers(2) self.create_drivers(2)
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
home_1 = device_1.recover_access(passphrase=sender['passphrase'], enable_notifications=True) home_1 = device_1.recover_access(passphrase=sender['passphrase'], enable_notifications=True)

View File

@ -208,7 +208,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
message_before_edit, message_after_edit = "Message BEFORE edit 1", "Message AFTER edit 2" message_before_edit, message_after_edit = "Message BEFORE edit 1", "Message AFTER edit 2"
public_chat_1.send_message(message_before_edit) public_chat_1.send_message(message_before_edit)
public_chat_1.edit_message_in_chat(message_before_edit, message_after_edit) public_chat_1.edit_message_in_chat(message_before_edit, message_after_edit)
if not public_chat_1.element_by_text_part("⌫ Edited").is_element_displayed(): if not public_chat_1.element_by_text_part("⌫ Edited").is_element_displayed(60):
self.errors.append('No mark in message bubble about this message was edited') self.errors.append('No mark in message bubble about this message was edited')
device_2.just_fyi( device_2.just_fyi(
@ -223,9 +223,9 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
if not home_1.element_by_text_part(message_after_edit_1_1).is_element_present(): if not home_1.element_by_text_part(message_after_edit_1_1).is_element_present():
self.errors.append('UNedited message version displayed on preview') self.errors.append('UNedited message version displayed on preview')
chat_private_1 = device_1_one_to_one_chat_element.click() chat_private_1 = device_1_one_to_one_chat_element.click()
if not home_1.element_by_text_part(message_after_edit_1_1).is_element_present(): if not home_1.element_by_text_part(message_after_edit_1_1).is_element_present(30):
self.errors.append('No edited message in 1-1 chat displayed') self.errors.append('No edited message in 1-1 chat displayed')
if not home_1.element_by_text_part("⌫ Edited").is_element_present(): if not home_1.element_by_text_part("⌫ Edited").is_element_present(30):
self.errors.append('No mark in message bubble about this message was edited on receiver side') self.errors.append('No mark in message bubble about this message was edited on receiver side')
device_2.just_fyi("Verify Device1 can not edit and delete received message from Device2") device_2.just_fyi("Verify Device1 can not edit and delete received message from Device2")
@ -238,10 +238,10 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
device_2.just_fyi("Delete message and check it is not shown in chat preview on home") device_2.just_fyi("Delete message and check it is not shown in chat preview on home")
chat_private_2.delete_message_in_chat(message_after_edit_1_1) chat_private_2.delete_message_in_chat(message_after_edit_1_1)
for chat in (chat_private_2, chat_private_1): for chat in (chat_private_2, chat_private_1):
if chat.chat_element_by_text(message_after_edit_1_1).is_element_displayed(): if chat.chat_element_by_text(message_after_edit_1_1).is_element_displayed(30):
self.errors.append("Deleted message is shown in chat view for 1-1 chat") self.errors.append("Deleted message is shown in chat view for 1-1 chat")
chat_private_1.home_button.double_click() chat_private_1.home_button.double_click()
if home_1.element_by_text(message_after_edit_1_1).is_element_displayed(): if home_1.element_by_text(message_after_edit_1_1).is_element_displayed(30):
self.errors.append("Deleted message is shown on chat element on home screen") self.errors.append("Deleted message is shown on chat element on home screen")
device_2.just_fyi("Send one more message and check that PN will be deleted with message deletion") device_2.just_fyi("Send one more message and check that PN will be deleted with message deletion")
@ -258,13 +258,13 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
chat_private_2.just_fyi("Check for that edited message is shown for Device 2 and delete message in public chat") chat_private_2.just_fyi("Check for that edited message is shown for Device 2 and delete message in public chat")
[home.home_button.double_click() for home in (home_1, home_2)] [home.home_button.double_click() for home in (home_1, home_2)]
public_chat_1, public_chat_2 = home_1.get_chat('#%s' % chat_name).click(), home_2.join_public_chat(chat_name) public_chat_1, public_chat_2 = home_1.get_chat('#%s' % chat_name).click(), home_2.join_public_chat(chat_name)
if not public_chat_2.element_by_text_part("⌫ Edited").is_element_displayed(): if not public_chat_2.element_by_text_part("⌫ Edited").is_element_displayed(60):
self.errors.append('No mark in message bubble about this message was edited') self.errors.append('No mark in message bubble about this message was edited')
if not public_chat_2.element_by_text_part(message_after_edit).is_element_displayed(): if not public_chat_2.element_by_text_part(message_after_edit).is_element_displayed(60):
self.errors.append('Message is not edited.') self.errors.append('Message is not edited.')
public_chat_1.delete_message_in_chat(message_after_edit) public_chat_1.delete_message_in_chat(message_after_edit)
for chat in (public_chat_1, public_chat_2): for chat in (public_chat_1, public_chat_2):
if chat.chat_element_by_text(message_after_edit).is_element_displayed(): if chat.chat_element_by_text(message_after_edit).is_element_displayed(30):
self.errors.append("Deleted message is shown in chat view for public chat") self.errors.append("Deleted message is shown in chat view for public chat")
self.errors.verify_no_errors() self.errors.verify_no_errors()

View File

@ -13,6 +13,7 @@ import views.upgrade_dbs.group.data as group
class TestUpgradeApplication(SingleDeviceTestCase): class TestUpgradeApplication(SingleDeviceTestCase):
@marks.testrail_id(6284) @marks.testrail_id(6284)
@marks.flaky
def test_unread_previews_public_chat_version_upgrade(self): def test_unread_previews_public_chat_version_upgrade(self):
sign_in = SignInView(self.driver) sign_in = SignInView(self.driver)
unread_one_to_one_name, unread_public_name = 'All Whopping Dassierat', '#before-upgrade' unread_one_to_one_name, unread_public_name = 'All Whopping Dassierat', '#before-upgrade'
@ -117,8 +118,8 @@ class TestUpgradeApplication(SingleDeviceTestCase):
public_chat = home.get_chat(mention).click() public_chat = home.get_chat(mention).click()
public_chat.scroll_to_start_of_history() public_chat.scroll_to_start_of_history()
pub_chat_data = chats[mention] pub_chat_data = chats[mention]
public_chat.element_starts_with_text(pub_chat_data['reply']).scroll_to_element()
public_replied_message = public_chat.chat_element_by_text(pub_chat_data['reply']) public_replied_message = public_chat.chat_element_by_text(pub_chat_data['reply'])
public_replied_message.scroll_to_element()
if pub_chat_data['long'] not in public_replied_message.replied_message_text: if pub_chat_data['long'] not in public_replied_message.replied_message_text:
self.errors.append("Reply is not present in message received in public chat %s after upgrade" % mention) self.errors.append("Reply is not present in message received in public chat %s after upgrade" % mention)
public_chat.element_starts_with_text(pub_chat_data['mention']).scroll_to_element() public_chat.element_starts_with_text(pub_chat_data['mention']).scroll_to_element()
@ -477,6 +478,7 @@ class TestUpgradeMultipleApplication(MultipleDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.testrail_id(695812) @marks.testrail_id(695812)
@marks.flaky
def test_devices_activity_centre_profile_settings_upgrade(self): def test_devices_activity_centre_profile_settings_upgrade(self):
self.create_drivers(2) self.create_drivers(2)
user = ens_user user = ens_user
@ -524,7 +526,8 @@ class TestUpgradeMultipleApplication(MultipleDeviceTestCase):
if not profile_1.accept_new_chats_from_contacts_only.is_element_displayed(): if not profile_1.accept_new_chats_from_contacts_only.is_element_displayed():
self.errors.append("Accept contacts from setting is not preserved after upgrade!") self.errors.append("Accept contacts from setting is not preserved after upgrade!")
profile_1.profile_button.click() profile_1.profile_button.click()
profile_1.appearance_button.click() profile_1.privacy_and_security_button.click()
profile_1.show_profile_pictures_of.scroll_to_element()
if not profile_1.show_profile_pictures_of.is_element_image_similar_to_template('block_dark.png'): if not profile_1.show_profile_pictures_of.is_element_image_similar_to_template('block_dark.png'):
self.errors.append('Dark mode is not applied!') self.errors.append('Dark mode is not applied!')
if not profile_1.element_by_translation_id("everyone").is_element_displayed(): if not profile_1.element_by_translation_id("everyone").is_element_displayed():

View File

@ -399,3 +399,9 @@ class SilentButton(Button):
def text(self): def text(self):
text = self.find_element().text text = self.find_element().text
return text return text
class CheckBox(Button):
def click(self):
super(CheckBox, self).click_until_presence_of_element(Button(self.driver, accessibility_id="checkbox-on"))
return self.navigate()

View File

@ -13,7 +13,7 @@ from selenium.common.exceptions import NoSuchElementException, TimeoutException
from support.device_apps import start_web_browser from support.device_apps import start_web_browser
from tests import common_password, pytest_config_global, transl from tests import common_password, pytest_config_global, transl
from views.base_element import Button, BaseElement, EditBox, Text from views.base_element import Button, BaseElement, EditBox, Text, CheckBox
class BackButton(Button): class BackButton(Button):
@ -26,6 +26,7 @@ class BackButton(Button):
return self.navigate() return self.navigate()
class AllowButton(Button): class AllowButton(Button):
def __init__(self, driver): def __init__(self, driver):
super().__init__(driver, translation_id="allow", uppercase=True) super().__init__(driver, translation_id="allow", uppercase=True)
@ -191,9 +192,21 @@ class AirplaneModeButton(Button):
def __init__(self, driver): def __init__(self, driver):
super().__init__(driver, accessibility_id="Airplane mode") super().__init__(driver, accessibility_id="Airplane mode")
def click(self): def open_quick_action_menu(self):
action = TouchAction(self.driver) action = TouchAction(self.driver)
action.press(None, 200, 0).move_to(None, 200, 300).perform() action.press(None, 200, 0).move_to(None, 200, 300).perform()
def click(self):
counter = 0
desired_element = AirplaneModeButton(self.driver)
while not desired_element.is_element_present() and counter <= 3:
try:
self.open_quick_action_menu()
desired_element.wait_for_element(5)
except (NoSuchElementException, TimeoutException):
counter += 1
else:
self.driver.info("%s element not found" % desired_element.name)
super(AirplaneModeButton, self).click() super(AirplaneModeButton, self).click()
self.driver.press_keycode(4) self.driver.press_keycode(4)
@ -252,6 +265,9 @@ class BaseView(object):
self.qr_code_image = Button(self.driver, accessibility_id="qr-code-image") self.qr_code_image = Button(self.driver, accessibility_id="qr-code-image")
self.sign_in_phrase = SignInPhraseText(self.driver) self.sign_in_phrase = SignInPhraseText(self.driver)
# checkboxes and toggles
self.checkbox_button = CheckBox(self.driver, accessibility_id="checkbox-off")
# external browser # external browser
self.open_in_status_button = OpenInStatusButton(self.driver) self.open_in_status_button = OpenInStatusButton(self.driver)

View File

@ -1,6 +1,6 @@
import time import time
from selenium.common.exceptions import TimeoutException, NoSuchElementException from selenium.common.exceptions import TimeoutException, NoSuchElementException
from views.base_element import Button, Text, BaseElement, SilentButton from views.base_element import Button, Text, BaseElement, SilentButton, CheckBox
from views.base_view import BaseView from views.base_view import BaseView
from tests import test_dapp_url from tests import test_dapp_url
@ -211,8 +211,7 @@ class HomeView(BaseView):
# Sync using mobile data bottom sheet # Sync using mobile data bottom sheet
self.continue_syncing_button = Button(self.driver, accessibility_id="mobile-network-continue-syncing") self.continue_syncing_button = Button(self.driver, accessibility_id="mobile-network-continue-syncing")
self.stop_syncing_button = Button(self.driver, accessibility_id="mobile-network-stop-syncing") self.stop_syncing_button = Button(self.driver, accessibility_id="mobile-network-stop-syncing")
self.remember_my_choice_checkbox = Button(self.driver, xpath="//*[@content-desc='remember-choice']" self.remember_my_choice_checkbox = CheckBox(self.driver, accessibility_id=":checkbox-on")
"//*[@content-desc='checkbox']")
# Connection status bottom sheet # Connection status bottom sheet
self.connected_to_n_peers_text = Text(self.driver, accessibility_id="connected-to-n-peers") self.connected_to_n_peers_text = Text(self.driver, accessibility_id="connected-to-n-peers")

View File

@ -144,7 +144,7 @@ class SignInView(BaseView):
self.first_username_on_choose_chat_name = Text(self.driver, self.first_username_on_choose_chat_name = Text(self.driver,
xpath="//*[@content-desc='select-account-button-0']//android.widget.TextView[1]") xpath="//*[@content-desc='select-account-button-0']//android.widget.TextView[1]")
self.get_keycard_banner = Button(self.driver, translation_id="get-a-keycard") self.get_keycard_banner = Button(self.driver, translation_id="get-a-keycard")
self.accept_tos_checkbox = Button(self.driver, xpath="//android.widget.CheckBox[@content-desc='checkbox']") self.accept_tos_checkbox = self.checkbox_button
# keycard recovery # keycard recovery
self.recover_with_keycard_button = Button(self.driver, accessibility_id="recover-with-keycard-button") self.recover_with_keycard_button = Button(self.driver, accessibility_id="recover-with-keycard-button")
@ -178,9 +178,6 @@ class SignInView(BaseView):
if not second_user: if not second_user:
self.accept_tos_checkbox.click() self.accept_tos_checkbox.click()
self.get_started_button.click_until_presence_of_element(self.generate_key_button) self.get_started_button.click_until_presence_of_element(self.generate_key_button)
if not self.generate_key_button.is_element_displayed():
[button.click() for button in
[self.accept_tos_checkbox, self.get_started_button, self.generate_key_button]]
self.generate_key_button.click() self.generate_key_button.click()
self.next_button.click_until_absense_of_element(self.element_by_translation_id("intro-wizard-title2")) self.next_button.click_until_absense_of_element(self.element_by_translation_id("intro-wizard-title2"))
@ -209,9 +206,6 @@ class SignInView(BaseView):
if not second_user: if not second_user:
self.accept_tos_checkbox.click() self.accept_tos_checkbox.click()
self.get_started_button.click_until_presence_of_element(self.access_key_button) self.get_started_button.click_until_presence_of_element(self.access_key_button)
if not self.access_key_button.is_element_displayed():
self.accept_tos_checkbox.click()
self.get_started_button.click()
self.access_key_button.click() self.access_key_button.click()
self.enter_seed_phrase_button.click() self.enter_seed_phrase_button.click()
self.seedphrase_input.click() self.seedphrase_input.click()

View File

@ -55,21 +55,21 @@ chats = {
'preview':'Request address for transaction accepted', 'preview':'Request address for transaction accepted',
'messages': { 'messages': {
'audio': { 'audio': {
'length':'00:10', 'length': '00:10',
'timestamp' : '1:02 PM' 'timestamp': '1:02 PM'
}, },
}, },
'commands':{ 'commands':{
'incoming_ETH_shared':{ 'incoming_ETH_shared': {
'value':'0.01 ETH', 'value': '0.01 ETHro',
'status': "Shared 'Ethereum account'" 'status': "Shared 'Ethereum account'"
}, },
'incoming_ETH_confirmed': { 'incoming_ETH_confirmed': {
'value': '0.1 ETH', 'value': '0.1 ETHro',
'status': transl["status-confirmed"] 'status': transl["status-confirmed"]
}, },
'incoming_ETH_declined': { 'incoming_ETH_declined': {
'value': '20 ETH', 'value': '20 ETHro',
'status': transl["transaction-declined"] 'status': transl["transaction-declined"]
}, },
'incoming_STT_confirmed': { 'incoming_STT_confirmed': {

View File

@ -1,7 +1,7 @@
import time import time
from tests import common_password from tests import common_password
from views.base_element import Button, Text, EditBox, SilentButton from views.base_element import Button, Text, EditBox, SilentButton, CheckBox
from views.base_view import BaseView from views.base_view import BaseView
@ -14,12 +14,13 @@ class TransactionHistoryButton(Button):
return TransactionsView(self.driver) return TransactionsView(self.driver)
class AssetCheckBox(SilentButton): class AssetCheckBox(CheckBox):
def __init__(self, driver, asset_name): def __init__(self, driver, asset_name):
super().__init__(driver, xpath="//*[@text='%s']" % asset_name) super().__init__(driver, xpath="//*[@text='%s']" % asset_name)
def click(self): def click(self):
self.scroll_to_element(12).click() self.scroll_to_element(12)
self.click()
class BackupRecoveryPhrase(Button): class BackupRecoveryPhrase(Button):
@ -101,12 +102,12 @@ class WalletView(BaseView):
self.manage_assets_button = Button(self.driver, accessibility_id="wallet-manage-assets") self.manage_assets_button = Button(self.driver, accessibility_id="wallet-manage-assets")
self.manage_accounts_button = Button(self.driver, accessibility_id="wallet-manage-accounts") self.manage_accounts_button = Button(self.driver, accessibility_id="wallet-manage-accounts")
self.scan_tokens_button = Button(self.driver, accessibility_id="wallet-scan-token") self.scan_tokens_button = Button(self.driver, accessibility_id="wallet-scan-token")
self.stt_check_box = Button(self.driver, self.stt_check_box = CheckBox(self.driver,
xpath="//*[@text='STT']/../android.view.ViewGroup[@content-desc='checkbox']") xpath="//*[@text='STT']/../android.view.ViewGroup[@content-desc='checkbox-off']")
self.all_assets_full_names = Text(self.driver, self.all_assets_full_names = Text(self.driver,
xpath="//*[@content-desc='checkbox']/../android.widget.TextView[1]") xpath="//*[@content-desc='checkbox-off']/../android.widget.TextView[1]")
self.all_assets_symbols = Button(self.driver, self.all_assets_symbols = Button(self.driver,
xpath="//*[@content-desc='checkbox']/../android.widget.TextView[2]") xpath="//*[@content-desc='checkbox-off']/../android.widget.TextView[2]")
self.currency_item_text = Text(self.driver, xpath="//*[@content-desc='currency-item']//android.widget.TextView") self.currency_item_text = Text(self.driver, xpath="//*[@content-desc='currency-item']//android.widget.TextView")
self.address_text = Text(self.driver, accessibility_id="address-text") self.address_text = Text(self.driver, accessibility_id="address-text")