From c7e230d070d01107688afeb85aecbd261b70032f Mon Sep 17 00:00:00 2001 From: Yevheniia Berdnyk Date: Fri, 24 Nov 2023 02:37:28 +0200 Subject: [PATCH] e2e: changed test order --- test/appium/tests/conftest.py | 11 +++++------ .../tests/critical/chats/test_1_1_public_chats.py | 6 +++--- test/appium/views/home_view.py | 7 +++++-- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/test/appium/tests/conftest.py b/test/appium/tests/conftest.py index 74082291a7..c89eb64707 100644 --- a/test/appium/tests/conftest.py +++ b/test/appium/tests/conftest.py @@ -1,15 +1,15 @@ import os import re import signal -import requests +import time from contextlib import contextmanager from dataclasses import dataclass from datetime import datetime from http.client import RemoteDisconnected from os import environ -import time import pytest +import requests from _pytest.runner import runtestprotocol from requests.exceptions import ConnectionError as c_er @@ -182,13 +182,12 @@ class UploadApkException(Exception): def _upload_and_check_response(apk_file_path): with _upload_time_limit(1000): - with open(apk_file_path, 'rb') as f: - resp = sauce.storage._session.request('post', '/v1/storage/upload', files={'payload': f}) + resp = sauce.storage.upload(apk_file_path) try: - if resp['item']['name'] != test_suite_data.apk_name: + if resp.name != test_suite_data.apk_name: raise UploadApkException("Incorrect apk was uploaded to Sauce storage, response:\n%s" % resp) - except KeyError: + except AttributeError: raise UploadApkException("Error when uploading apk to Sauce storage, response:\n%s" % resp) diff --git a/test/appium/tests/critical/chats/test_1_1_public_chats.py b/test/appium/tests/critical/chats/test_1_1_public_chats.py index 5bc306b965..3eb98247f0 100644 --- a/test/appium/tests/critical/chats/test_1_1_public_chats.py +++ b/test/appium/tests/critical/chats/test_1_1_public_chats.py @@ -160,13 +160,13 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase): self.home_2.just_fyi("Check 'Open in Status' option") # url_to_open = 'http://status.app' - url_to_open = 'https://github.com/' + url_to_open = 'https://www.ethereum.org/en/run-a-node/' self.chat_1.send_message(url_to_open) chat_element = self.chat_2.chat_element_by_text(url_to_open) if chat_element.is_element_displayed(120): chat_element.click_on_link_inside_message_body() web_view = self.chat_2.open_in_status_button.click() - if not web_view.element_by_text("Let’s build from here").is_element_displayed(60): + if not web_view.element_by_text("Take full control. Run your own node.").is_element_displayed(60): self.errors.append('URL was not opened from 1-1 chat') else: self.errors.append("Message with URL was not received") @@ -516,7 +516,7 @@ class TestOneToOneChatMultipleSharedDevicesNewUi(MultipleSharedDeviceTestCase): self.errors.verify_no_errors() -@pytest.mark.xdist_group(name="new_seven_2") +@pytest.mark.xdist_group(name="new_six_2") @marks.new_ui_critical class TestOneToOneChatMultipleSharedDevicesNewUiTwo(MultipleSharedDeviceTestCase): diff --git a/test/appium/views/home_view.py b/test/appium/views/home_view.py index 12ded360ef..51817ecf05 100644 --- a/test/appium/views/home_view.py +++ b/test/appium/views/home_view.py @@ -423,8 +423,11 @@ class HomeView(BaseView): chat = self.get_chat_view() self.start_a_new_chat_bottom_sheet_button.click() for user_name in user_names_to_add: - chat.get_username_checkbox(user_name).click_until_presence_of_element( - chat.get_username_checkbox(user_name, state_on=True)) + check_box = chat.get_username_checkbox(user_name) + if not check_box.is_element_displayed(): + raise NoSuchElementException( + "User with the name '%s' is not in contacts list so can't create a group chat" % user_name) + check_box.click_until_presence_of_element(chat.get_username_checkbox(user_name, state_on=True)) self.setup_chat_button.click() chat.chat_name_editbox.send_keys(group_chat_name) chat.create_button.click()