e2e: nightly fixes

This commit is contained in:
Churikova Tetiana 2022-03-09 17:38:29 +01:00
parent 55915a9176
commit a3f4673177
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
8 changed files with 76 additions and 35 deletions

View File

@ -585,11 +585,9 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
@marks.testrail_id(6636)
@marks.medium
@marks.flaky
def test_show_profile_picture_of_setting_online_indicator(self):
self.create_drivers(2)
home_1, home_2 = SignInView(self.drivers[0]).create_user(), SignInView(self.drivers[1]).create_user(
enable_notifications=True)
home_1, home_2 = SignInView(self.drivers[0]).create_user(), SignInView(self.drivers[1]).create_user(enable_notifications=True)
profile_1, profile_2 = home_1.profile_button.click(), home_2.profile_button.click()
public_key_1, default_username_1 = profile_1.get_public_key_and_username(return_username=True)
public_key_2, default_username_2 = profile_2.get_public_key_and_username(return_username=True)
@ -621,6 +619,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
profile_1.just_fyi('Check profile image is in mentions because now user was added in contacts')
one_to_one_chat_2.add_to_contacts.click()
one_to_one_chat_2.send_message("hey")
one_to_one_chat_2.chat_message_input.set_value('@' + default_username_1)
one_to_one_chat_2.chat_message_input.click()
if not one_to_one_chat_2.user_profile_image_in_mentions_list(
@ -628,12 +627,17 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
self.errors.append('Profile picture was not updated in 1-1 chat mentions list')
one_to_one_chat_2.get_back_to_home_view()
profile_1.just_fyi('Send message to user to move it to online state')
profile_1.home_button.double_click()
one_to_one_chat_1 = home_1.get_chat(default_username_2).click()
one_to_one_chat_1.send_message('hey')
profile_1.just_fyi('Check profile image is updated in Group chat view')
profile_2 = one_to_one_chat_2.profile_button.click()
profile_2.contacts_button.click()
profile_2.element_by_text(default_username_1).click()
profile_2.online_indicator.wait_for_visibility_of_element(180)
if not profile_2.profile_picture.is_element_image_similar_to_template(logo_online):
if not profile_2.profile_picture.is_element_image_similar_to_template('new_profile_online.png'):
self.errors.append('Profile picture was not updated on user Profile view')
profile_2.close_button.click()
[home.home_button.click() for home in (profile_2, home_1)]
@ -648,8 +652,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
group_chat_1 = home_1.get_chat(group_chat_name).click()
group_chat_1.join_chat_button.click()
group_chat_1.send_message(group_chat_message)
if not group_chat_2.chat_element_by_text(group_chat_message).member_photo.is_element_image_similar_to_template(
logo_default):
if not group_chat_2.chat_element_by_text(group_chat_message).member_photo.is_element_image_similar_to_template(logo_default):
self.errors.append('User profile picture was not updated in message Group chat view')
home_2.put_app_to_background()

View File

@ -303,6 +303,7 @@ class TestWalletManagementDeviceMerged(MultipleSharedDeviceTestCase):
self.wallet.accounts_status_account.swipe_left_on_element()
account_button.click()
self.wallet.collectibles_button.click()
self.wallet.element_by_translation_id("display-collectibles").scroll_and_click()
collectible_amount = self.wallet.get_collectibles_amount()
collectible_amount.wait_for_visibility_of_element(30)
if collectible_amount.text != '1':

View File

@ -1,11 +1,9 @@
from tests import marks
from tests.base_test_case import MultipleDeviceTestCase, SingleDeviceTestCase, MultipleSharedDeviceTestCase, create_shared_drivers
from tests.users import transaction_senders, ens_user
from tests.users import transaction_senders, ens_user, chat_users
from views.sign_in_view import SignInView
from views.chat_view import ChatView
import random
import emoji
import pytest
class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
@ -253,21 +251,41 @@ class TestCommandsSingleDevices(SingleDeviceTestCase):
def test_cant_add_more_twenty_participants_to_group_chat(self):
sign_in = SignInView(self.driver)
home = sign_in.create_user()
users = [transaction_senders['A'], transaction_senders['ETH_8'], transaction_senders['C'], transaction_senders['ETH_1'],
transaction_senders['ETH_2'], transaction_senders['F'], transaction_senders['G'], transaction_senders['H'],
transaction_senders['I'], transaction_senders['ETH_STT_4'], transaction_senders['ETH_STT_3'], transaction_senders['M'],
transaction_senders['N'], transaction_senders['ETH_2'], transaction_senders['ETH_STT_ADI_1'], transaction_senders['Q'],
transaction_senders['R'], transaction_senders['S'], transaction_senders['T'], transaction_senders['U'],
]
users = [chat_users['A'],
chat_users['B'],
transaction_senders['ETH_8'],
transaction_senders['ETH_1'],
transaction_senders['ETH_2'],
transaction_senders['ETH_7'],
transaction_senders['ETH_STT_3'],
transaction_senders['ETH_STT_ADI_1'],
transaction_senders['C'],
transaction_senders['F'],
transaction_senders['G'],
transaction_senders['H'],
transaction_senders['I'],
transaction_senders['M'],
transaction_senders['N'],
transaction_senders['Q'],
transaction_senders['R'],
transaction_senders['S'],
transaction_senders['T'],
transaction_senders['U']]
usernames = []
home.just_fyi('Add 20 users to contacts')
profile = home.profile_button.click()
profile.contacts_button.click()
chat = home.get_chat_view()
for user in users:
home.add_contact(user['public_key'])
profile.add_new_contact_button.click()
chat.public_key_edit_box.click()
chat.public_key_edit_box.set_value(user['public_key'])
chat.confirm_until_presence_of_element(profile.add_new_contact_button)
usernames.append(user['username'])
home.get_back_to_home_view()
home.just_fyi('Create group chat with max amount of users')
profile.home_button.click()
chat = home.create_group_chat(usernames, 'some_group_chat')
home.just_fyi('Verify that can not add more users via group info')

View File

@ -39,7 +39,7 @@ class TestBrowsing(SingleDeviceTestCase):
element_on_start_page = dapp.element_by_text('Select a token')
web_page = dapp.open_url(url)
dapp.allow_button.click()
element_on_start_page.click()
element_on_start_page.scroll_and_click()
# when bottom sheet is opened, elements by text couldn't be found
element_on_start_page.wait_for_invisibility_of_element(20)

View File

@ -13,7 +13,7 @@ from views.sign_in_view import SignInView
class TestSendTxDeviceMerged(MultipleSharedDeviceTestCase):
@classmethod
def setup_class(cls):
cls.user = transaction_senders['S']
cls.user = transaction_senders['ETH_ADI_STT_3']
cls.recipient_address = '0x%s' % transaction_senders['ETH_7']['address']
cls.drivers, cls.loop = create_shared_drivers(1)
[cls.amount_adi, cls.amount_eth, cls.amount_stt] = ['0.000%s' % str(random.randint(100, 999)) + '1' for _ in range(3)]
@ -57,7 +57,7 @@ class TestSendTxDeviceMerged(MultipleSharedDeviceTestCase):
@marks.testrail_id(700765)
@marks.critical
@marks.transaction
def test_send_tx_custom_token_18_decimals(self):
def test_send_tx_custom_token_18_decimals_invalid_password(self):
contract_address, name, symbol, decimals = '0x101848D5C5bBca18E6b4431eEdF6B95E9ADF82FA', 'Weenus 💪', 'WEENUS', '18'
self.home.wallet_button.double_click()
@ -77,9 +77,39 @@ class TestSendTxDeviceMerged(MultipleSharedDeviceTestCase):
self.wallet.asset_by_name(symbol).scroll_to_element()
if not self.wallet.asset_by_name(symbol).is_element_displayed():
self.errors.append('Custom token is not shown on Wallet view')
send_tx = self.wallet.send_transaction_from_main_screen.click()
send_tx.select_asset_button.click()
asset_button = send_tx.asset_by_name(symbol)
send_tx.select_asset_button.click_until_presence_of_element(
send_tx.eth_asset_in_select_asset_bottom_sheet_button)
asset_button.click()
send_tx.amount_edit_box.click()
send_tx.amount_edit_box.set_value(self.amount_eth)
send_tx.set_recipient_address(self.recipient_address)
send_tx.sign_transaction_button.click()
if self.wallet.sign_in_phrase.is_element_displayed():
self.wallet.set_up_wallet_when_sending_tx()
send_tx.just_fyi('Check that can not sign tx with invalid password')
self.wallet.next_button.click_if_shown()
self.wallet.ok_got_it_button.click_if_shown()
send_tx.sign_with_password.click_until_presence_of_element(send_tx.enter_password_input)
send_tx.enter_password_input.click()
send_tx.enter_password_input.send_keys('wrong_password')
send_tx.sign_button.click()
if send_tx.element_by_text_part('Transaction sent').is_element_displayed():
self.errors.append('Transaction was sent with a wrong password')
self.wallet.just_fyi("Check that can send tx with custom token")
self.wallet.send_transaction(asset_name=symbol, amount=self.amount_eth, recipient=self.recipient_address)
send_tx.enter_password_input.click()
send_tx.enter_password_input.clear()
send_tx.enter_password_input.send_keys(common_password)
send_tx.sign_button.click_until_absense_of_element(send_tx.sign_button)
send_tx.ok_button.wait_for_element(120)
if not self.wallet.element_by_translation_id("transaction-sent").is_element_displayed():
self.errors.append("Tx is not sent!")
send_tx.ok_button.click()
# TODO: disabled due to 10838 (rechecked 23.11.21, valid)
# transactions_view = wallet.transaction_history_button.click()
# transactions_view.transactions_table.find_transaction(amount=amount, asset=symbol)
@ -87,7 +117,7 @@ class TestSendTxDeviceMerged(MultipleSharedDeviceTestCase):
@marks.testrail_id(700757)
@marks.critical
def test_send_tx_set_recipient_options_invalid_password(self):
def test_send_tx_set_recipient_options(self):
nickname = 'my_some_nickname'
account_name = 'my_acc_name'
account_address = '0x8c2E3Cd844848E79cFd4671cE45C12F210b630d7'
@ -189,17 +219,6 @@ class TestSendTxDeviceMerged(MultipleSharedDeviceTestCase):
if send_tr.enter_recipient_address_text.text != send_tr.get_formatted_recipient_address(
'0x' + basic_user['address']):
self.errors.append('QR scanned address that was added to favourites was not resolved correctly')
send_tr.just_fyi('Check that can not sign tx with invalid password')
self.wallet.next_button.click_if_shown()
self.wallet.ok_got_it_button.click_if_shown()
send_tr.sign_with_password.click_until_presence_of_element(send_tr.enter_password_input)
send_tr.enter_password_input.click()
send_tr.enter_password_input.send_keys('wrong_password')
send_tr.sign_button.click()
if send_tr.element_by_text_part('Transaction sent').is_element_displayed():
wallet.driver.fail('Transaction was sent with a wrong password')
self.errors.verify_no_errors()

View File

@ -81,7 +81,7 @@ def get_capabilities_sauce_lab():
desired_caps['deviceName'] = 'Android GoogleAPI Emulator'
desired_caps['deviceOrientation'] = "portrait"
desired_caps['commandTimeout'] = 600
desired_caps['idleTimeout'] = 600
desired_caps['idleTimeout'] = 800
desired_caps['unicodeKeyboard'] = True
desired_caps['automationName'] = 'UiAutomator2'
desired_caps['setWebContentDebuggingEnabled'] = True

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -280,7 +280,7 @@ class HomeView(BaseView):
if user_names_to_add:
for user_name in user_names_to_add:
if len(user_names_to_add) > 5:
chat_view.search_by_keyword(user_name[:4])
chat_view.search_by_keyword(user_name[:5])
chat_view.get_username_checkbox(user_name).click()
chat_view.search_input.clear()
else: