e2e: split 1-1 chat test group

This commit is contained in:
Yevheniia Berdnyk 2023-09-06 03:36:33 +03:00
parent 56b13cbdca
commit 726b76a290
No known key found for this signature in database
GPG Key ID: 0642C73C66214825
7 changed files with 53 additions and 12 deletions

View File

@ -83,7 +83,7 @@ pipeline {
sh 'cp -f $TEST_ETH_ACCOUNTS_FILE users.py'
sh """
python3 -m pytest \
--numprocesses 6 \
--numprocesses 8 \
--rerun_count=2 \
--testrail_report=True \
-m testrail_id \

View File

@ -123,7 +123,7 @@ pipeline {
sh 'cp -f $TEST_ETH_ACCOUNTS_FILE users.py'
sh """
python3 -m pytest \
--numprocesses 6 \
--numprocesses 8 \
--rerun_count=2 \
--testrail_report=True \
-k \"${params.KEYWORD_EXPRESSION}\" \

View File

@ -1327,10 +1327,46 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase):
[device.navigate_back_to_home_view() for device in (self.device_1, self.device_2)]
self.errors.verify_no_errors()
@pytest.mark.xdist_group(name="new_seven_2")
@marks.new_ui_critical
class TestOneToOneChatMultipleSharedDevicesNewUiTwo(MultipleSharedDeviceTestCase):
def prepare_devices(self):
self.drivers, self.loop = create_shared_drivers(2)
self.device_1, self.device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])
self.username_1, self.username_2 = 'sender', 'receiver'
self.loop.run_until_complete(run_in_parallel(((self.device_1.create_user, {'enable_notifications': True,
'username': self.username_1}),
(self.device_2.create_user, {'enable_notifications': True,
'username': self.username_2}))))
self.home_1, self.home_2 = self.device_1.get_home_view(), self.device_2.get_home_view()
self.homes = (self.home_1, self.home_2)
self.profile_1, self.profile_2 = (home.get_profile_view() for home in self.homes)
self.public_key_2 = self.home_2.get_public_key()
self.profile_1.just_fyi("Sending contact request via Profile > Contacts")
for home in (self.home_1, self.home_2):
home.navigate_back_to_home_view()
home.chats_tab.click()
self.home_1.send_contact_request_via_bottom_sheet(self.public_key_2)
self.home_2.just_fyi("Accepting contact request from activity centre")
self.home_2.handle_contact_request(self.username_1)
self.profile_1.just_fyi("Sending message to contact via Messages > Recent")
self.chat_1 = self.home_1.get_chat(self.username_2).click()
self.chat_1.send_message('hey')
self.home_2.navigate_back_to_home_view()
self.chat_2 = self.home_2.get_chat(self.username_1).click()
self.message_1, self.message_2, self.message_3, self.message_4 = \
"Message 1", "Message 2", "Message 3", "Message 4"
@marks.testrail_id(702783)
def test_1_1_chat_is_shown_message_sent_delivered_from_offline(self):
self.chat_2.jump_to_card_by_text(self.username_1)
self.chat_1.jump_to_card_by_text(self.username_2)
# self.chat_2.jump_to_card_by_text(self.username_1)
# self.chat_1.jump_to_card_by_text(self.username_2)
self.home_1.just_fyi('Turn on airplane mode and check that offline status is shown on home view')
for home in self.homes:
home.toggle_airplane_mode()

View File

@ -1025,6 +1025,7 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase):
"New messages badge is shown in community channel element while there are no unread messages")
self.errors.verify_no_errors()
@pytest.mark.xdist_group(name="new_five_2")
@marks.new_ui_critical
class TestCommunityMultipleDeviceMergedTwo(MultipleSharedDeviceTestCase):

View File

@ -186,7 +186,9 @@ class TestActivityMultipleDevicePR(MultipleSharedDeviceTestCase):
self.community_1.element_by_translation_id("community-channel").click()
if not self.channel_1.chat_element_by_text(self.text_message).is_element_displayed(20):
self.errors.append("User was not redirected to community channel after tapping on community channel card!")
element = self.channel_1.jump_to_button.find_element()
self.channel_1.click_system_back_button()
self.channel_1.wait_for_staleness_of_element(element)
self.community_1.jump_to_button.click()
self.community_1.element_by_text_part(self.username_2).click()
if not self.chat_1.chat_element_by_text(self.one_to_one_message).is_element_displayed(20):

View File

@ -149,14 +149,6 @@ class BaseElement(object):
"Device %s: %s by %s: `%s` is still visible on the screen after %s seconds after wait_for_invisibility_of_element" % (
self.driver.number, self.name, self.by, self.locator, seconds)) from None
def wait_for_staleness_of_element(self, seconds=10):
try:
return WebDriverWait(self.driver, seconds).until(expected_conditions.staleness_of(self.find_element()))
except TimeoutException:
raise TimeoutException(
"Device %s: %s by %s: `%s` is not stale after %s seconds" % (
self.driver.number, self.name, self.by, self.locator, seconds)) from None
def wait_for_rendering_ended_and_click(self, attempts=3):
for i in range(attempts):
try:

View File

@ -5,8 +5,11 @@ import string
import time
from datetime import datetime
from appium.webdriver import WebElement
from appium.webdriver.common.touch_action import TouchAction
from selenium.common.exceptions import NoSuchElementException, TimeoutException
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait
from support.device_apps import start_web_browser
from tests import common_password, pytest_config_global, transl
@ -813,3 +816,10 @@ class BaseView(object):
return
time.sleep(1)
raise TimeoutException("Driver current package is '%s' after %s seconds" % (package, timeout))
def wait_for_staleness_of_element(self, element_instance: WebElement, seconds=10):
try:
return WebDriverWait(self.driver, seconds).until(expected_conditions.staleness_of(element_instance))
except TimeoutException:
raise TimeoutException(
"Device %s: expected element is not stale after %s seconds" % (self.driver.number, seconds)) from None