e2e: nightly fixes

This commit is contained in:
Churikova Tetiana 2021-10-05 16:30:40 +02:00
parent eb5711e9bc
commit fe1cc2dc23
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
9 changed files with 58 additions and 32 deletions

View File

@ -13,9 +13,15 @@ class TestCreateAccount(SingleDeviceTestCase):
seed = basic_user['passphrase'] seed = basic_user['passphrase']
home = sign_in.recover_access(passphrase=seed) home = sign_in.recover_access(passphrase=seed)
profile = home.profile_button.click() profile = home.profile_button.click()
profile.logout() profile.privacy_and_security_button.click()
profile.element_by_translation_id("manage-keys-and-storage").scroll_and_click()
profile.logout_dialog.logout_button.wait_and_click()
profile.logout_button.wait_for_invisibility_of_element(30)
if not sign_in.element_by_translation_id("move-keystore-file").is_element_displayed():
self.errors.append("Was not redirected to Key management screen when Manage keys from logged in state!")
home.just_fyi("Checking keycard banner and starting migrate multiaccount to keycard: no db saved") home.just_fyi("Checking keycard banner and starting migrate multiaccount to keycard: no db saved")
sign_in.close_button.click()
sign_in.back_button.click() sign_in.back_button.click()
sign_in.multi_account_on_login_button.wait_for_visibility_of_element(30) sign_in.multi_account_on_login_button.wait_for_visibility_of_element(30)
sign_in.get_multiaccount_by_position(1).click() sign_in.get_multiaccount_by_position(1).click()

View File

@ -574,8 +574,9 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
def test_set_profile_picture(self): def test_set_profile_picture(self):
self.create_drivers(2) self.create_drivers(2)
home_1, home_2 = SignInView(self.drivers[0]).create_user(), SignInView(self.drivers[1]).create_user() home_1, home_2 = SignInView(self.drivers[0]).create_user(), SignInView(self.drivers[1]).create_user()
profile_1 = home_1.profile_button.click() profile_1, profile_2 = home_1.profile_button.click(), home_2.profile_button.click()
public_key_1 = profile_1.get_public_key_and_username() public_key_1, public_key_2 = profile_1.get_public_key_and_username(), profile_2.get_public_key_and_username()
profile_2.home_button.click()
profile_1.just_fyi("Set user Profile image from Gallery") profile_1.just_fyi("Set user Profile image from Gallery")
profile_1.edit_profile_picture(file_name='sauce_logo.png') profile_1.edit_profile_picture(file_name='sauce_logo.png')
@ -585,14 +586,18 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
if not profile_1.profile_picture.is_element_image_similar_to_template('sauce_logo_profile.png'): if not profile_1.profile_picture.is_element_image_similar_to_template('sauce_logo_profile.png'):
self.drivers[0].fail('Profile picture was not updated') self.drivers[0].fail('Profile picture was not updated')
profile_1.just_fyi("Add user2 to contacts")
profile_1.home_button.click()
home_1.add_contact(public_key_2)
home_1.home_button.click()
profile_1.just_fyi("Check user profile updated in chat") profile_1.just_fyi("Check user profile updated in chat")
home = profile_1.home_button.click()
message = "Text message" message = "Text message"
public_chat_name = home.get_random_chat_name() public_chat_name = home_1.get_random_chat_name()
home_2.add_contact(public_key=public_key_1) home_2.add_contact(public_key=public_key_1)
home_2.home_button.click() home_2.home_button.click()
public_chat_2 = home_2.join_public_chat(public_chat_name) public_chat_2 = home_2.join_public_chat(public_chat_name)
public_chat_1 = home.join_public_chat(public_chat_name) public_chat_1 = home_1.join_public_chat(public_chat_name)
public_chat_1.chat_message_input.send_keys(message) public_chat_1.chat_message_input.send_keys(message)
public_chat_1.send_message_button.click() public_chat_1.send_message_button.click()
if not public_chat_2.chat_element_by_text(message).member_photo.is_element_image_similar_to_template('sauce_logo.png'): if not public_chat_2.chat_element_by_text(message).member_photo.is_element_image_similar_to_template('sauce_logo.png'):
@ -613,8 +618,13 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
def test_show_profile_picture_of_setting(self): def test_show_profile_picture_of_setting(self):
self.create_drivers(2) self.create_drivers(2)
home_1, home_2 = SignInView(self.drivers[0]).create_user(), SignInView(self.drivers[1]).create_user() home_1, home_2 = SignInView(self.drivers[0]).create_user(), SignInView(self.drivers[1]).create_user()
profile_1 = home_1.profile_button.click() 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_1, default_username_1 = profile_1.get_public_key_and_username(return_username=True)
public_key_2 = profile_2.get_public_key_and_username()
[profile.home_button.click() for profile in (profile_1, profile_2)]
home_1.add_contact(public_key_2)
home_1.profile_button.click()
profile_1.just_fyi("Set user Profile image from Gallery") profile_1.just_fyi("Set user Profile image from Gallery")
profile_1.edit_profile_picture(file_name='sauce_logo.png') profile_1.edit_profile_picture(file_name='sauce_logo.png')
@ -654,11 +664,11 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
if not home_2.get_chat(default_username_1).chat_image.is_element_image_similar_to_template('sauce_logo.png'): if not home_2.get_chat(default_username_1).chat_image.is_element_image_similar_to_template('sauce_logo.png'):
self.errors.append('User profile picture was not updated on Chats view') self.errors.append('User profile picture was not updated on Chats view')
profile_1.just_fyi('Check profile image updated in user profile view in Group chat views 4') profile_1.just_fyi('Check profile image updated in user profile view in Group chat views')
group_chat_message = 'Trololo' group_chat_name, group_chat_message = 'new_group_chat', 'Trololo'
group_chat_2 = home_2.create_group_chat(user_names_to_add=[default_username_1]) group_chat_2 = home_2.create_group_chat(user_names_to_add=[default_username_1])
group_chat_2.send_message('Message') group_chat_2.send_message('Message')
group_chat_1 = home_1.get_chat('new_group_chat').click() group_chat_1 = home_1.get_chat(group_chat_name).click()
group_chat_1.join_chat_button.click() group_chat_1.join_chat_button.click()
group_chat_1.send_message(group_chat_message) 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('sauce_logo.png'): if not group_chat_2.chat_element_by_text(group_chat_message).member_photo.is_element_image_similar_to_template('sauce_logo.png'):
@ -691,9 +701,9 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
profile_2.just_fyi('Enable to see profile image from "Everyone" setting') profile_2.just_fyi('Enable to see profile image from "Everyone" setting')
home_2.profile_button.click() home_2.profile_button.click()
profile_2.appearance_button.click() profile_2.privacy_and_security_button.click()
profile_2.show_profile_pictures_of.click() profile_2.show_profile_pictures_of.scroll_and_click()
profile_2.element_by_text('Everyone').click() profile_2.element_by_translation_id("everyone").click()
group_chat_1.send_message(group_chat_message) group_chat_1.send_message(group_chat_message)
profile_2.home_button.click(desired_view='home') profile_2.home_button.click(desired_view='home')
if not home_2.get_chat(default_username_1).chat_image.is_element_image_similar_to_template('sauce_logo.png'): if not home_2.get_chat(default_username_1).chat_image.is_element_image_similar_to_template('sauce_logo.png'):
@ -715,13 +725,14 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
profile_1.bootnodes_button.click() profile_1.bootnodes_button.click()
profile_1.add_bootnode_button.click() profile_1.add_bootnode_button.click()
profile_1.specify_name_input.set_value('test') profile_1.specify_name_input.set_value('test')
profile_1.bootnode_address_input.set_value('invalid_bootnode_address') # TODO: blocked as validation is missing for bootnodes
if not profile_1.element_by_text_part('Invalid format').is_element_displayed(): # profile_1.bootnode_address_input.set_value('invalid_bootnode_address')
self.errors.append('Validation message about invalid format of bootnode is not shown') # if not profile_1.element_by_text_part('Invalid format').is_element_displayed():
profile_1.save_button.click() # self.errors.append('Validation message about invalid format of bootnode is not shown')
if profile_1.add_bootnode_button.is_element_displayed(): # profile_1.save_button.click()
self.errors.append('User was navigated to another screen when tapped on disabled "Save" button') # if profile_1.add_bootnode_button.is_element_displayed():
profile_1.bootnode_address_input.clear() # self.errors.append('User was navigated to another screen when tapped on disabled "Save" button')
# profile_1.bootnode_address_input.clear()
profile_1.bootnode_address_input.set_value(bootnode_address) profile_1.bootnode_address_input.set_value(bootnode_address)
profile_1.save_button.click() profile_1.save_button.click()
profile_1.enable_bootnodes.click() profile_1.enable_bootnodes.click()

View File

@ -206,8 +206,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
device_2.just_fyi("Create public chat on Device1, send message and edit it then") device_2.just_fyi("Create public chat on Device1, send message and edit it then")
public_key_1, username_1 = home_1.get_public_key_and_username(return_username=True) public_key_1, username_1 = home_1.get_public_key_and_username(return_username=True)
public_key_2, username_2 = home_2.get_public_key_and_username(return_username=True) public_key_2, username_2 = home_2.get_public_key_and_username(return_username=True)
home_1.home_button.click() [home.home_button.click() for home in (home_1, home_2)]
home_2.home_button.click()
chat_name = home_1.get_random_chat_name() chat_name = home_1.get_random_chat_name()
home_1.join_public_chat(chat_name) home_1.join_public_chat(chat_name)
public_chat_1 = home_1.get_chat_view() public_chat_1 = home_1.get_chat_view()

View File

@ -210,7 +210,7 @@ class TestPublicChatMultipleDevice(MultipleDeviceTestCase):
if not timeline_1.element_by_text_part(expected_value).is_element_displayed(): if not timeline_1.element_by_text_part(expected_value).is_element_displayed():
self.errors.append("Expected value %s is not shown" % expected_value) self.errors.append("Expected value %s is not shown" % expected_value)
text_status = 'some text' text_status = 'some text'
timeline_1.set_new_status(text_status) timeline_1.set_new_status(status=text_status)
for timestamp in ('Now', '1M', '2M'): for timestamp in ('Now', '1M', '2M'):
if not timeline_1.element_by_text(timestamp).is_element_displayed(): if not timeline_1.element_by_text(timestamp).is_element_displayed():
self.errors.append("Expected timestamp %s is not shown in timeline_1" % timestamp) self.errors.append("Expected timestamp %s is not shown in timeline_1" % timestamp)
@ -231,6 +231,7 @@ class TestPublicChatMultipleDevice(MultipleDeviceTestCase):
self.errors.append("Expected value %s is not shown in other user profile without adding to contacts" % expected_value) self.errors.append("Expected value %s is not shown in other user profile without adding to contacts" % expected_value)
home_2.just_fyi('Add device1 to contacts and check that status will be shown in timeline_1') home_2.just_fyi('Add device1 to contacts and check that status will be shown in timeline_1')
chat_2.close_button.scroll_and_click(direction='up')
chat_2.close_button.click() chat_2.close_button.click()
chat_2.add_to_contacts.click() chat_2.add_to_contacts.click()
timeline_2 = chat_2.status_button.click() timeline_2 = chat_2.status_button.click()

View File

@ -119,7 +119,6 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
wallet.close_button.click() wallet.close_button.click()
sub_account_address = wallet.get_wallet_address(account_name)[2:] sub_account_address = wallet.get_wallet_address(account_name)[2:]
self.network_api.wait_for_confirmation_of_transaction(sub_account_address, transaction_amount_1) self.network_api.wait_for_confirmation_of_transaction(sub_account_address, transaction_amount_1)
wallet.find_transaction_in_history(amount=transaction_amount)
wallet.find_transaction_in_history(amount=format(float(transaction_amount_1),'.11f').rstrip('0')) wallet.find_transaction_in_history(amount=format(float(transaction_amount_1),'.11f').rstrip('0'))
wallet.just_fyi("Check transactions on subaccount") wallet.just_fyi("Check transactions on subaccount")

View File

@ -608,9 +608,8 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
wallet.ok_got_it_button.wait_and_click(30) wallet.ok_got_it_button.wait_and_click(30)
if not send_transaction.validation_error_element.is_element_displayed(10): 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)) self.errors.append('Validation icon is not shown when testing %s on %s' % (errors['sending_screen']['Network fee'],screen))
send_transaction.sign_with_password.click() if not wallet.element_by_translation_id("tx-fail-description2").is_element_displayed():
if send_transaction.enter_password_input.is_element_displayed(): self.errors.append("No warning about failing tx is shown!")
self.errors.append('Sign button is active when not enough ETH for gas')
send_transaction.cancel_button.click() send_transaction.cancel_button.click()
screen = 'sending screen from DApp' screen = 'sending screen from DApp'
@ -648,8 +647,9 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
wallet.ok_got_it_button.wait_and_click(30) wallet.ok_got_it_button.wait_and_click(30)
send_transaction.network_fee_button.click() send_transaction.network_fee_button.click()
send_transaction = wallet.get_send_transaction_view() send_transaction = wallet.get_send_transaction_view()
fee_fields = (send_transaction.gas_limit_input, send_transaction.per_gas_tip_limit_input, send_transaction.per_gas_price_limit_input) fee_fields = (send_transaction.per_gas_tip_limit_input, send_transaction.per_gas_price_limit_input)
[default_limit, default_tip, default_price] = [input.text for input in fee_fields] [default_tip, default_price] = [input.text for input in fee_fields]
default_limit = '21000'
@ -721,6 +721,8 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
send_transaction.network_fee_button.click() send_transaction.network_fee_button.click()
send_transaction = wallet.get_send_transaction_view() send_transaction = wallet.get_send_transaction_view()
send_transaction.gas_limit_input.clear()
send_transaction.gas_limit_input.set_value(default_limit)
send_transaction.per_gas_price_limit_input.clear() send_transaction.per_gas_price_limit_input.clear()
send_transaction.per_gas_price_limit_input.click() send_transaction.per_gas_price_limit_input.click()
send_transaction.per_gas_price_limit_input.send_keys('1') send_transaction.per_gas_price_limit_input.send_keys('1')

View File

@ -2,6 +2,7 @@ import base64
from io import BytesIO from io import BytesIO
import os import os
import time import time
import emoji
from timeit import timeit from timeit import timeit
from PIL import Image, ImageChops, ImageStat from PIL import Image, ImageChops, ImageStat
@ -271,6 +272,10 @@ class BaseElement(object):
def get_translation_by_key(key): def get_translation_by_key(key):
return transl[key] return transl[key]
@staticmethod
def exclude_emoji(value):
return 'emoji' if value in emoji.UNICODE_EMOJI else value
class EditBox(BaseElement): class EditBox(BaseElement):
@ -278,10 +283,12 @@ class EditBox(BaseElement):
super(EditBox, self).__init__(driver, **kwargs) super(EditBox, self).__init__(driver, **kwargs)
def send_keys(self, value): def send_keys(self, value):
value = self.exclude_emoji(value)
self.find_element().send_keys(value) self.find_element().send_keys(value)
self.driver.info("*Type '%s' to %s*" % (value, self.name)) self.driver.info("*Type '%s' to %s*" % (value, self.name))
def set_value(self, value): def set_value(self, value):
value = self.exclude_emoji(value)
self.find_element().set_value(value) self.find_element().set_value(value)
self.driver.info("*Type '%s' to %s*" % (value, self.name)) self.driver.info("*Type '%s' to %s*" % (value, self.name))
@ -306,7 +313,7 @@ class EditBox(BaseElement):
action.press(x=x + 25, y=y - 50).release().perform() action.press(x=x + 25, y=y - 50).release().perform()
def cut_text(self): def cut_text(self):
self.driver.info('-Cut text in %s' % self.name) self.driver.info('*Cut text in %s*' % self.name)
location = self.find_element().location location = self.find_element().location
x, y = location['x'], location['y'] x, y = location['x'], location['y']
action = TouchAction(self.driver) action = TouchAction(self.driver)

View File

@ -315,7 +315,7 @@ class BaseView(object):
while not desired_element.is_element_present(1) and counter <= attempts: while not desired_element.is_element_present(1) and counter <= attempts:
try: try:
self.confirm() self.confirm()
self.driver.info('Wait for %s' % desired_element.name) self.driver.info('*Wait for %s*' % desired_element.name)
desired_element.wait_for_element(5) desired_element.wait_for_element(5)
return return
except TimeoutException: except TimeoutException:

View File

@ -910,7 +910,8 @@ class ChatView(BaseView):
def set_new_status(self, status='something is happening', image=False): def set_new_status(self, status='something is happening', image=False):
self.driver.info("**Setting new status:%s, image set is: %s**" % (status, str(image))) status = BaseElement(self.driver).exclude_emoji(status)
self.driver.info("**Setting new status:'%s', image set is: '%s'**" % (status, str(image)))
self.timeline_add_new_status_button.click_until_presence_of_element(self.timeline_my_status_editbox) self.timeline_add_new_status_button.click_until_presence_of_element(self.timeline_my_status_editbox)
self.timeline_my_status_editbox.set_value(status) self.timeline_my_status_editbox.set_value(status)