False failed tests fix

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
yevh-berdnyk 2019-08-23 13:24:52 +03:00 committed by Churikova Tetiana
parent 41cf68b6a7
commit 59000d5698
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
7 changed files with 23 additions and 38 deletions

View File

@ -77,12 +77,9 @@ class TestCreateAccount(SingleDeviceTestCase):
if not home_view.element_by_text(text).is_element_displayed(): if not home_view.element_by_text(text).is_element_displayed():
self.errors.append("'%s' text is not shown" % text) self.errors.append("'%s' text is not shown" % text)
profile_view = home_view.profile_button.click() profile_view = home_view.profile_button.click()
shown_username_1 = profile_view.username_set_by_user_text.text shown_username = profile_view.default_username_text.text
shown_username_2 = profile_view.default_username_text.text if shown_username != username:
if shown_username_1 != username: self.errors.append("Default username '%s' doesn't match '%s'" % (shown_username, username))
self.errors.append("Profile username '%s' doesn't match '%s'" % (shown_username_1, username))
if shown_username_2 != username:
self.errors.append("Default username '%s' doesn't match '%s'" % (shown_username_2, username))
self.verify_no_errors() self.verify_no_errors()
@marks.testrail_id(5460) @marks.testrail_id(5460)

View File

@ -23,7 +23,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
profile_view.home_button.click() profile_view.home_button.click()
sign_in_view.profile_button.click() sign_in_view.profile_button.click()
profile_view.swipe_down() profile_view.swipe_down()
if not profile_view.profile_picture.is_element_image_equals_template(): if not profile_view.profile_picture.is_element_image_equals_template('sauce_logo_profile.png'):
self.driver.fail('Profile picture was not updated') self.driver.fail('Profile picture was not updated')
@marks.testrail_id(5454) @marks.testrail_id(5454)

View File

@ -159,16 +159,17 @@ class TestRecoverAccessFromSignInScreen(SingleDeviceTestCase):
@marks.testrail_id(5394) @marks.testrail_id(5394)
@marks.high @marks.high
def test_uppercase_is_replaced_by_lowercase_automatically(self): def test_account_recovery_with_uppercase_recovery_phrase(self):
passphrase = transaction_senders['A']['passphrase'] user = transaction_senders['A']
passphrase = user['passphrase']
capitalized_passphrase = passphrase.upper() capitalized_passphrase = passphrase.upper()
signin_view = SignInView(self.driver) signin_view = SignInView(self.driver)
recover_access_view = signin_view.access_key_button.click() signin_view.recover_access(capitalized_passphrase)
recover_access_view.enter_seed_phrase_button.click() profile_view = signin_view.profile_button.click()
recover_access_view.passphrase_input.click() username = profile_view.default_username_text.text
recover_access_view.send_as_keyevent(capitalized_passphrase) public_key = signin_view.get_public_key()
if recover_access_view.passphrase_input.text != passphrase: if username != user['username'] or public_key != user['public_key']:
self.driver.fail('Upper case was not replaced by lower case!') self.driver.fail('Incorrect user was recovered')
@marks.testrail_id(5719) @marks.testrail_id(5719)
@marks.medium @marks.medium

View File

@ -25,12 +25,9 @@ def create_users(driver_1, driver_2):
return device_1_sign_in.create_user(), device_2_sign_in.create_user() return device_1_sign_in.create_user(), device_2_sign_in.create_user()
def get_username(device_home, default=True): def get_username(device_home):
device_profile_view = device_home.profile_button.click() device_profile_view = device_home.profile_button.click()
if default: username = device_profile_view.default_username_text.text
username = device_profile_view.default_username_text.text
else:
username = device_profile_view.username_set_by_user_text.text
device_home.home_button.click() device_home.home_button.click()
return username return username
@ -228,14 +225,12 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
chat_name = device_1_home.get_public_chat_name() chat_name = device_1_home.get_public_chat_name()
device_1_chat, device_2_chat = create_and_join_group_chat(device_1_home, device_2_home, chat_name) device_1_chat, device_2_chat = create_and_join_group_chat(device_1_home, device_2_home, chat_name)
device_2_default_username = get_username(device_2_home) device_2_default_username = get_username(device_2_home)
device_2_custom_username = get_username(device_2_home, False)
# device 1: get options for device 2 in group chat and remove him # device 1: get options for device 2 in group chat and remove him
options = device_1_chat.get_user_options(device_2_default_username) options = device_1_chat.get_user_options(device_2_default_username)
options.remove_user_button.click() options.remove_user_button.click()
# device 2: check that removed user can see that he is removed # device 2: check that removed user can see that he is removed
user2_left_chat_system_message_for_user_2 = return_left_chat_system_message(device_2_custom_username)
# TODO: should be reworked after https://github.com/status-im/status-react/pull/8487: replaced with default username # TODO: should be reworked after https://github.com/status-im/status-react/pull/8487: replaced with default username
# if not device_1_chat.chat_element_by_text(user2_left_chat_system_message_for_user_2).is_element_displayed(): # if not device_1_chat.chat_element_by_text(user2_left_chat_system_message_for_user_2).is_element_displayed():
@ -266,7 +261,6 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
device_1_home, device_2_home = create_users(self.drivers[0], self.drivers[1]) device_1_home, device_2_home = create_users(self.drivers[0], self.drivers[1])
chat_name = device_1_home.get_public_chat_name() chat_name = device_1_home.get_public_chat_name()
device_2_default_username = get_username(device_2_home) device_2_default_username = get_username(device_2_home)
device_2_custom_username = get_username(device_2_home, False)
# device 2: add contacts # device 2: add contacts
device_2_home.add_contact(chat_member['public_key']) device_2_home.add_contact(chat_member['public_key'])

View File

@ -144,7 +144,7 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase):
self.errors.append("Default username '%s' is not shown in one-to-one chat" % default_username_1) self.errors.append("Default username '%s' is not shown in one-to-one chat" % default_username_1)
device_2_chat.chat_options.click() device_2_chat.chat_options.click()
device_2_chat.view_profile_button.click() device_2_chat.view_profile_button.click()
if not device_2_chat.contact_profile_picture.is_element_image_equals_template(): if not device_2_chat.contact_profile_picture.is_element_image_equals_template('sauce_logo.png'):
self.errors.append("Updated profile picture is not shown in one-to-one chat") self.errors.append("Updated profile picture is not shown in one-to-one chat")
self.verify_no_errors() self.verify_no_errors()

View File

@ -114,11 +114,11 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
send_transaction.enter_recipient_address_input.set_value(recipient['address']) send_transaction.enter_recipient_address_input.set_value(recipient['address'])
send_transaction.done_button.click() send_transaction.done_button.click()
send_transaction.sign_transaction_button.click() send_transaction.sign_transaction_button.click()
send_transaction.sign_with_password.click() send_transaction.sign_with_password.click_until_presence_of_element(send_transaction.enter_password_input)
send_transaction.enter_password_input.click() send_transaction.enter_password_input.click()
send_transaction.enter_password_input.send_keys('wrong_password') send_transaction.enter_password_input.send_keys('wrong_password')
send_transaction.sign_button.click() send_transaction.sign_button.click()
send_transaction.find_full_text('Wrong password', 20) send_transaction.find_text_part('Wrong password', 20)
@marks.testrail_id(1452) @marks.testrail_id(1452)
def test_transaction_appears_in_history(self): def test_transaction_appears_in_history(self):

View File

@ -101,13 +101,6 @@ class ConfirmLogoutButton(BaseButton):
self.locator = self.Locator.text_selector('LOG OUT') self.locator = self.Locator.text_selector('LOG OUT')
class UserNameSetByUserText(BaseText):
def __init__(self, driver):
super(UserNameSetByUserText, self).__init__(driver)
self.locator = self.Locator.xpath_selector(
'//android.widget.ImageView[@content-desc="chat-icon"]/../android.widget.TextView[1]')
class DefaultUserNameText(BaseText): class DefaultUserNameText(BaseText):
def __init__(self, driver): def __init__(self, driver):
super(DefaultUserNameText, self).__init__(driver) super(DefaultUserNameText, self).__init__(driver)
@ -122,7 +115,6 @@ class ShareMyProfileButton(BaseButton):
self.locator = self.Locator.xpath_selector('(//android.view.ViewGroup[@content-desc="icon"])[1]') self.locator = self.Locator.xpath_selector('(//android.view.ViewGroup[@content-desc="icon"])[1]')
class ProfilePictureElement(BaseElement): class ProfilePictureElement(BaseElement):
def __init__(self, driver): def __init__(self, driver):
super(ProfilePictureElement, self).__init__(driver) super(ProfilePictureElement, self).__init__(driver)
@ -133,7 +125,8 @@ class EditPictureButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
super(EditPictureButton, self).__init__(driver) super(EditPictureButton, self).__init__(driver)
self.locator = self.Locator.xpath_selector('//android.view.ViewGroup[@content-desc="edit-profile-photo-button"]') self.locator = self.Locator.xpath_selector(
'//android.view.ViewGroup[@content-desc="edit-profile-photo-button"]')
class ConfirmEditButton(BaseButton): class ConfirmEditButton(BaseButton):
@ -310,16 +303,19 @@ class FaqButton(BaseButton):
from views.web_views.base_web_view import BaseWebView from views.web_views.base_web_view import BaseWebView
return BaseWebView(self.driver) return BaseWebView(self.driver)
class AboutButton(BaseButton): class AboutButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
super(AboutButton, self).__init__(driver) super(AboutButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id("about-button") self.locator = self.Locator.accessibility_id("about-button")
class VersionText(BaseText): class VersionText(BaseText):
def __init__(self, driver): def __init__(self, driver):
super(VersionText, self).__init__(driver) super(VersionText, self).__init__(driver)
self.locator = self.Locator.xpath_selector("//*[@content-desc='version'][1]") self.locator = self.Locator.xpath_selector("//*[@content-desc='version'][1]")
class BootnodesButton(BaseButton): class BootnodesButton(BaseButton):
def __init__(self, driver): def __init__(self, driver):
@ -510,7 +506,6 @@ class ProfileView(BaseView):
self.main_currency_button = MainCurrencyButton(self.driver) self.main_currency_button = MainCurrencyButton(self.driver)
self.username_set_by_user_text = UserNameSetByUserText(self.driver)
self.default_username_text = DefaultUserNameText(self.driver) self.default_username_text = DefaultUserNameText(self.driver)
self.share_my_profile_button = ShareMyProfileButton(self.driver) self.share_my_profile_button = ShareMyProfileButton(self.driver)
self.profile_picture = ProfilePictureElement(self.driver) self.profile_picture = ProfilePictureElement(self.driver)
@ -627,14 +622,12 @@ class ProfileView(BaseView):
self.element_by_text(element_text).click() self.element_by_text(element_text).click()
picture.click() picture.click()
def remove_profile_picture(self): def remove_profile_picture(self):
if not AbstractTestCase().environment == 'sauce': if not AbstractTestCase().environment == 'sauce':
raise NotImplementedError('Test case is implemented to run on SauceLabs only') raise NotImplementedError('Test case is implemented to run on SauceLabs only')
self.profile_picture.click() self.profile_picture.click()
self.remove_picture_button.click() self.remove_picture_button.click()
def logout(self): def logout(self):
self.logout_button.click() self.logout_button.click()
return self.logout_dialog.logout_button.click() return self.logout_dialog.logout_button.click()