From 0fed8113d1307de9f1d59acce031d11609ae8a07 Mon Sep 17 00:00:00 2001 From: Yevheniia Berdnyk Date: Thu, 25 Jul 2024 19:05:30 +0300 Subject: [PATCH] e2e: updated testnet switching and added one test into smoke --- test/appium/support/testrail_report.py | 15 ++++--------- .../chats/test_public_chat_browsing.py | 5 ++--- test/appium/views/profile_view.py | 21 +++++++------------ 3 files changed, 14 insertions(+), 27 deletions(-) diff --git a/test/appium/support/testrail_report.py b/test/appium/support/testrail_report.py index f6c553739b..535ad19159 100644 --- a/test/appium/support/testrail_report.py +++ b/test/appium/support/testrail_report.py @@ -8,6 +8,7 @@ from os import environ from sys import argv import emoji +import pytest import requests from support.base_test_report import BaseTestReport @@ -139,20 +140,12 @@ class TestrailReport(BaseTestReport): for category in test_cases['pr']: for case in self.get_cases([test_cases['pr'][category]]): case_ids.append(case['id']) - case_ids.extend([703133, 702742, 702745]) - elif 'nightly' in argv: + case_ids.extend([703133, 702742, 702745, 702843]) + # elif 'nightly' in argv: + else: for category in test_cases['nightly']: for case in self.get_cases([test_cases['nightly'][category]]): case_ids.append(case['id']) - elif 'upgrade' in argv and 'not upgrade' not in argv: - for case in self.get_cases([test_cases['upgrade']['general']]): - case_ids.append(case['id']) - else: - for phase in test_cases: - if phase != 'upgrade': - for category in test_cases[phase]: - for case in self.get_cases([test_cases[phase][category]]): - case_ids.append(case['id']) return case_ids def add_results(self): diff --git a/test/appium/tests/critical/chats/test_public_chat_browsing.py b/test/appium/tests/critical/chats/test_public_chat_browsing.py index b852d56393..8d581e616a 100644 --- a/test/appium/tests/critical/chats/test_public_chat_browsing.py +++ b/test/appium/tests/critical/chats/test_public_chat_browsing.py @@ -253,9 +253,7 @@ class TestCommunityOneDeviceMerged(MultipleSharedDeviceTestCase): self.home.navigate_back_to_home_view() self.home.just_fyi("Turn off testnet in the profile settings") profile = self.home.profile_button.click() - profile.advanced_button.scroll_and_click() - profile.testnet_mode_toggle.click() - profile.ok_button.click() + profile.switch_network() self.sign_in.sign_in() self.home.just_fyi("Check Discover Communities content") @@ -368,6 +366,7 @@ class TestCommunityMultipleDeviceMerged(MultipleSharedDeviceTestCase): self.errors.append("Default username '%s' is not shown next to the received message" % self.username_1) self.errors.verify_no_errors() + @marks.smoke @marks.testrail_id(702843) def test_community_message_edit(self): message_before_edit, message_after_edit = 'Message BEFORE edit', "Message AFTER edit 2" diff --git a/test/appium/views/profile_view.py b/test/appium/views/profile_view.py index 2a8417ef6c..f73dd9a9e6 100644 --- a/test/appium/views/profile_view.py +++ b/test/appium/views/profile_view.py @@ -304,7 +304,6 @@ class ProfileView(BaseView): self.advanced_button = AdvancedButton(self.driver) self.mutual_contact_request_switcher = Button(self.driver, accessibility_id="mutual-contact-requests-switch") ## Network - self.network_settings_button = Button(self.driver, accessibility_id="network-button") self.active_network_name = Text(self.driver, xpath="//android.widget.TextView[contains(@text,'with upstream RPC')]") self.plus_button = Button(self.driver, xpath="(//android.widget.ImageView[@content-desc='icon'])[2]") @@ -361,22 +360,18 @@ class ProfileView(BaseView): self.profile_password_button = Button(self.driver, accessibility_id="icon, Password, label-component, icon") self.profile_messages_button = Button(self.driver, accessibility_id="icon, Messages, label-component, icon") self.profile_blocked_users_button = Button(self.driver, accessibility_id="Blocked users, label-component, icon") + self.profile_wallet_button = Button(self.driver, accessibility_id="icon, Wallet, label-component, icon") + self.network_settings_button = Button(self.driver, accessibility_id="Network settings, label-component, icon") self.profile_legacy_button = Button(self.driver, accessibility_id="icon, Legacy settings, label-component, icon") - self.testnet_mode_toggle = Button(self.driver, - xpath="//*[@content-desc='test-networks-enabled']/android.widget.Switch") + self.testnet_mode_toggle = Button(self.driver, accessibility_id="icon, Testnet mode, label-component") + self.confirm_testnet_mode_change_button = Button(self.driver, accessibility_id="confirm-testnet-mode-change") - def switch_network(self, network='Mainnet with upstream RPC'): - self.driver.info("## Switch network to '%s'" % network, device=False) - self.advanced_button.click() + def switch_network(self): + self.profile_wallet_button.click() self.network_settings_button.click() - network_button = Button(self.driver, xpath="//*[@text='%s']" % network) - network_button.scroll_and_click() - self.connect_button.click_until_presence_of_element(self.confirm_button) - self.confirm_button.click_until_absense_of_element(self.confirm_button) - from views.sign_in_view import SignInView - SignInView(self.driver).sign_in() - self.driver.info("## Network is switched successfully!", device=False) + self.testnet_mode_toggle.click() + self.confirm_testnet_mode_change_button.click() def open_contact_from_profile(self, username): self.driver.info("Opening profile of '%s' via Contacts" % username)