e2e: False failures fixes

This commit is contained in:
Yevheniia Berdnyk 2024-12-10 19:26:53 +02:00
parent 949e78a17e
commit c8b063493b
No known key found for this signature in database
8 changed files with 17 additions and 18 deletions

View File

@ -148,14 +148,6 @@ class TestActivityCenterContactRequestMultipleDevicePR(MultipleSharedDeviceTestC
@marks.testrail_id(702777) @marks.testrail_id(702777)
def test_add_contact_field_validation(self): def test_add_contact_field_validation(self):
# Profile link encoded data validation
encoded_data = re.findall("u/(.*)#", self.profile_link_2)[0]
decoded_string = base64.b64decode(encoded_data).decode("utf-8", "ignore")
decoded_username = re.sub('[^A-Za-z0-9]+', '', decoded_string)
if decoded_username != self.username_2:
self.errors.append(
"Can't find username '%s' in data which profile link '%s' contains. String '%s' is found instead" % (
self.username_2, self.profile_link_2, decoded_username))
public_key_2 = self.profile_link_2.split("#")[-1] public_key_2 = self.profile_link_2.split("#")[-1]
def _device_1_creates_user(): def _device_1_creates_user():

View File

@ -453,7 +453,7 @@ class TestGroupChatMultipleDeviceMergedNewUI(MultipleSharedDeviceTestCase):
current_time = datetime.datetime.strptime(device_time, "%Y-%m-%dT%H:%M:%S%z") current_time = datetime.datetime.strptime(device_time, "%Y-%m-%dT%H:%M:%S%z")
expected_times = [current_time + datetime.timedelta(minutes=i) for i in range(479, 482)] expected_times = [current_time + datetime.timedelta(minutes=i) for i in range(479, 482)]
expected_texts = [ expected_texts = [
"Muted until %s %s" % (exp_time.strftime('%H:%M'), "today" if current_time.hour < 23 else "tomorrow") for "Muted until %s %s" % (exp_time.strftime('%H:%M'), "today" if current_time.hour < 16 else "tomorrow") for
exp_time in expected_times] exp_time in expected_times]
chat = self.homes[1].get_chat(self.chat_name) chat = self.homes[1].get_chat(self.chat_name)
chat.long_press_element() chat.long_press_element()
@ -483,7 +483,7 @@ class TestGroupChatMultipleDeviceMergedNewUI(MultipleSharedDeviceTestCase):
if after_mute_counter > initial_counter: if after_mute_counter > initial_counter:
self.errors.append("New messages counter near chats tab button is %s after mute, but should be %s" % ( self.errors.append("New messages counter near chats tab button is %s after mute, but should be %s" % (
after_mute_counter, initial_counter)) after_mute_counter, initial_counter))
if not chat.chat_preview.text.startswith("%s: %s" % (self.usernames[0], muted_message)): if not chat.chat_preview.text.startswith("%s: %s" % (self.usernames[0], muted_message[:25])):
self.errors.append("Message text '%s' is not shown in chat preview after mute" % muted_message) self.errors.append("Message text '%s' is not shown in chat preview after mute" % muted_message)
chat.click() chat.click()
if not self.chats[1].chat_element_by_text(muted_message).is_element_displayed(30): if not self.chats[1].chat_element_by_text(muted_message).is_element_displayed(30):

View File

@ -1021,6 +1021,8 @@ class TestCommunityMultipleDeviceMergedTwo(MultipleSharedDeviceTestCase):
self.errors.append('Community is still shown in the list after leave') self.errors.append('Community is still shown in the list after leave')
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.xfail(reason="Can't navigate to a community channel before joining the community, "
"https://github.com/status-im/status-mobile/issues/21776")
@marks.testrail_id(702948) @marks.testrail_id(702948)
def test_community_hashtag_links_to_community_channels(self): def test_community_hashtag_links_to_community_channels(self):
for home in self.homes: for home in self.homes:
@ -1121,6 +1123,8 @@ class TestCommunityMultipleDeviceMergedTwo(MultipleSharedDeviceTestCase):
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.xfail(reason="Can't navigate to a community channel before joining the community, "
"https://github.com/status-im/status-mobile/issues/21776")
@marks.testrail_id(703629) @marks.testrail_id(703629)
def test_community_join_when_node_owner_offline(self): def test_community_join_when_node_owner_offline(self):
for home in self.homes: for home in self.homes:

View File

@ -89,7 +89,7 @@ class TestDeepLinksOneDevice(MultipleSharedDeviceTestCase):
self.home.get_chat(snt_community_name, community=True).click() self.home.get_chat(snt_community_name, community=True).click()
snt_community_url = self.community_view.copy_community_link() snt_community_url = self.community_view.copy_community_link()
self.home.reopen_app(sign_in=False) self.home.reopen_app(sign_in=False)
self.sign_in.create_user(username="second user", first_user=False) self.sign_in.create_user(first_user=False)
self.home.browser_tab.click() self.home.browser_tab.click()
old, new = "https://status.app/", "status-app://" old, new = "https://status.app/", "status-app://"

View File

@ -269,7 +269,7 @@ class TestFallbackMultipleDevice(MultipleSharedDeviceTestCase):
self.sign_in_2.passphrase_edit_box.clear() self.sign_in_2.passphrase_edit_box.clear()
self.sign_in_2.passphrase_edit_box.send_keys(transaction_senders['A']['passphrase']) self.sign_in_2.passphrase_edit_box.send_keys(transaction_senders['A']['passphrase'])
self.sign_in_2.continue_button.click() self.sign_in_2.continue_button.click()
if not self.sign_in_2.profile_title_input.is_element_displayed(): if not self.sign_in_2.password_input.is_element_displayed():
self.errors.append("Can't recover an access with a valid passphrase") self.errors.append("Can't recover an access with a valid passphrase")
self.sign_in_2.click_system_back_button() self.sign_in_2.click_system_back_button()

View File

@ -59,19 +59,19 @@ class TestWalletMultipleDevice(MultipleSharedDeviceTestCase):
def wait_for_wallet_balance_to_update(wallet_view, user_name, initial_eth_amount): def wait_for_wallet_balance_to_update(wallet_view, user_name, initial_eth_amount):
wallet_view.just_fyi("Getting ETH amount in the wallet of the %s after transaction" % user_name) wallet_view.just_fyi("Getting ETH amount in the wallet of the %s after transaction" % user_name)
if user_name == 'sender': if user_name == self.sender_username:
exp_amount = round(initial_eth_amount - amount_to_send, 4) exp_amount = round(initial_eth_amount - amount_to_send, 4)
else: else:
exp_amount = round(initial_eth_amount + amount_to_send, 4) exp_amount = round(initial_eth_amount + amount_to_send, 4)
# for _ in range(12): # ToDo: 120 sec wait time, enable when autoupdate feature is ready # for _ in range(12): # ToDo: 120 sec wait time, enable when autoupdate feature is ready
new_eth_amount = round(wallet_view.get_asset(asset_name='Ether').get_amount(), 4) new_eth_amount = round(wallet_view.get_asset(asset_name='Ether').get_amount(), 4)
if user_name == 'sender' and new_eth_amount <= exp_amount: if user_name == self.sender_username and new_eth_amount <= exp_amount:
return return
if user_name == 'receiver' and new_eth_amount >= exp_amount: if user_name == self.receiver_username and new_eth_amount >= exp_amount:
return return
self.errors.append( self.errors.append(
"Eth amount in the %ss wallet is %s but should be %s" % (user_name, new_eth_amount, exp_amount)) "Eth amount in the %s's wallet is %s but should be %s" % (user_name, new_eth_amount, exp_amount))
# ToDo: disable relogin when autoupdate feature is ready # ToDo: disable relogin when autoupdate feature is ready
self.home_1.just_fyi("Relogin for getting an updated balance") self.home_1.just_fyi("Relogin for getting an updated balance")

View File

@ -626,6 +626,7 @@ class HomeView(BaseView):
return element.text return element.text
def get_username(self): def get_username(self):
self.toast_content_element.wait_for_invisibility_of_element()
profile_view = self.get_profile_view() profile_view = self.get_profile_view()
profile_view = self.profile_button.click_until_presence_of_element(profile_view.default_username_text) profile_view = self.profile_button.click_until_presence_of_element(profile_view.default_username_text)
profile_view.default_username_text.wait_for_element(3) profile_view.default_username_text.wait_for_element(3)

View File

@ -361,8 +361,10 @@ class SignInView(BaseView):
def get_user_profile_by_name(self, username: str): def get_user_profile_by_name(self, username: str):
self.driver.info("Getting username card by '%s'" % username) self.driver.info("Getting username card by '%s'" % username)
expected_element = UserProfileElement(self.driver, username=username) expected_element = UserProfileElement(self.driver, username=username)
return expected_element if expected_element.is_element_displayed(10) else self.driver.fail( if expected_element.is_element_displayed(10):
"User %s is not found!" % username) return expected_element
else:
raise NoSuchElementException(msg="User %s is not found!" % username)
def get_user_profile_by_index(self, index: int): def get_user_profile_by_index(self, index: int):
self.driver.info("Getting username card by index %s" % index) self.driver.info("Getting username card by index %s" % index)