e2e: updated test_restore_multiaccount_with_waku_backup_remove_switch

This commit is contained in:
Yevheniia Berdnyk 2023-06-22 17:59:56 +03:00
parent be245d5612
commit 0cb525aade
No known key found for this signature in database
GPG Key ID: 0642C73C66214825
4 changed files with 34 additions and 17 deletions

View File

@ -6,7 +6,7 @@ import pytest
from dateutil import parser
from selenium.common.exceptions import NoSuchElementException, TimeoutException
from tests import marks, test_dapp_name, test_dapp_url, run_in_parallel
from tests import marks, test_dapp_name, test_dapp_url, run_in_parallel, pytest_config_global
from tests.base_test_case import create_shared_drivers, MultipleSharedDeviceTestCase
from views.chat_view import CommunityView
from views.dbs.waku_backup import user as waku_user
@ -371,6 +371,13 @@ class TestCommunityOneDeviceMerged(MultipleSharedDeviceTestCase):
if not self.home.element_by_text(contact).is_element_displayed(30):
self.errors.append("Contact %s was not restored from backup!" % contact)
if not pytest_config_global['pr_number']:
self.home.just_fyi("Perform back up")
self.home.profile_button.click()
profile.sync_settings_button.click()
profile.backup_settings_button.click()
profile.perform_backup_button.click()
self.home.just_fyi("Check that can login with different user")
self.home.reopen_app(sign_in=False)
self.sign_in.show_profiles_button.click()
@ -755,19 +762,25 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
self.home_2.jump_to_messages_home()
self.home_2.handle_contact_request(self.username_1)
self.channel_1.profile_send_message_button.click_until_absense_of_element(
desired_element=self.channel_1.profile_send_message_button)
self.chat_1.send_message("piy")
self.home_2.just_fyi("Check message in 1-1 chat after unblock")
self.home_2.get_chat(self.username_1).click()
self.chat_2.send_message(message_unblocked)
desired_element=self.channel_1.profile_send_message_button, attempts=20, timeout=3)
try:
self.chat_2.chat_element_by_text(message_unblocked).wait_for_status_to_be(expected_status='Delivered',
timeout=120)
if not self.chat_1.chat_element_by_text(message_unblocked).is_element_displayed(30):
self.errors.append("Message was not received in 1-1 chat after user unblock!")
self.chat_1.send_message("piy")
unblocked = True
except TimeoutException:
self.errors.append('Message was not delivered after back up online.')
unblocked = False
self.errors.append("Chat with unblocked user was not enabled after 1 minute")
if unblocked:
self.home_2.just_fyi("Check message in 1-1 chat after unblock")
self.home_2.get_chat(self.username_1).click()
self.chat_2.send_message(message_unblocked)
try:
self.chat_2.chat_element_by_text(message_unblocked).wait_for_status_to_be(expected_status='Delivered',
timeout=120)
if not self.chat_1.chat_element_by_text(message_unblocked).is_element_displayed(30):
self.errors.append("Message was not received in 1-1 chat after user unblock!")
except TimeoutException:
self.errors.append('Message was not delivered after back up online.')
self.errors.verify_no_errors()

View File

@ -1,4 +1,5 @@
import pytest
from selenium.common.exceptions import TimeoutException
from tests import marks, run_in_parallel
from tests.base_test_case import MultipleSharedDeviceTestCase, create_shared_drivers
@ -321,7 +322,10 @@ class TestActivityMultipleDevicePR(MultipleSharedDeviceTestCase):
[home.jump_to_communities_home() for home in (self.home_1, self.home_2)]
self.home_1.just_fyi("Checking unread indicators")
self.home_1.notifications_unread_badge.wait_for_visibility_of_element(120)
try:
self.home_1.notifications_unread_badge.wait_for_visibility_of_element(120)
except TimeoutException:
self.errors.append("Unread indicator is not shown in notifications")
self.home_1.open_activity_center_button.click()
reply_element = self.home_1.get_element_from_activity_center_view(self.username_2)
if reply_element.title.text != 'Join request':
@ -332,7 +336,7 @@ class TestActivityMultipleDevicePR(MultipleSharedDeviceTestCase):
self.home_1.activity_notification_swipe_button.click()
self.home_1.close_activity_centre.click()
self.home_2.just_fyi("Checking that community appeared on thr list")
self.home_2.just_fyi("Checking that community appeared on the list")
if not self.home_2.element_by_text_part(community_name).is_element_displayed(30):
self.errors.append(
"Community is not appeared in the list after accepting admin request from activity centre")

View File

@ -403,11 +403,11 @@ class Button(BaseElement):
self.wait_for_visibility_of_element(sec)
self.click()
def click_until_absense_of_element(self, desired_element, attempts=3):
def click_until_absense_of_element(self, desired_element, attempts=3, timeout=1):
counter = 0
self.driver.info("Click until `%s` by `%s`: `%s` is NOT presented" % (
desired_element.name, desired_element.by, desired_element.locator))
while desired_element.is_element_displayed(1) and counter <= attempts:
while desired_element.is_element_displayed(timeout) and counter <= attempts:
try:
self.find_element().click()
counter += 1

View File

@ -7,5 +7,5 @@ communities = {
'member_closed': 'test_comm_enc',
'member_pending': 'RC1 testing community'
}
contacts = ['Chu_QA', 'my-custom-nickname']
contacts = ['Test_contact', 'my-custom-nickname']
blocked_user = 'Clear Flat Milkweedbug'