e2e: updated testnet switching and added one test into smoke

This commit is contained in:
Yevheniia Berdnyk 2024-07-25 19:05:30 +03:00
parent 53c35cb554
commit 0fed8113d1
No known key found for this signature in database
3 changed files with 14 additions and 27 deletions

View File

@ -8,6 +8,7 @@ from os import environ
from sys import argv from sys import argv
import emoji import emoji
import pytest
import requests import requests
from support.base_test_report import BaseTestReport from support.base_test_report import BaseTestReport
@ -139,20 +140,12 @@ class TestrailReport(BaseTestReport):
for category in test_cases['pr']: for category in test_cases['pr']:
for case in self.get_cases([test_cases['pr'][category]]): for case in self.get_cases([test_cases['pr'][category]]):
case_ids.append(case['id']) case_ids.append(case['id'])
case_ids.extend([703133, 702742, 702745]) case_ids.extend([703133, 702742, 702745, 702843])
elif 'nightly' in argv: # elif 'nightly' in argv:
else:
for category in test_cases['nightly']: for category in test_cases['nightly']:
for case in self.get_cases([test_cases['nightly'][category]]): for case in self.get_cases([test_cases['nightly'][category]]):
case_ids.append(case['id']) 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 return case_ids
def add_results(self): def add_results(self):

View File

@ -253,9 +253,7 @@ class TestCommunityOneDeviceMerged(MultipleSharedDeviceTestCase):
self.home.navigate_back_to_home_view() self.home.navigate_back_to_home_view()
self.home.just_fyi("Turn off testnet in the profile settings") self.home.just_fyi("Turn off testnet in the profile settings")
profile = self.home.profile_button.click() profile = self.home.profile_button.click()
profile.advanced_button.scroll_and_click() profile.switch_network()
profile.testnet_mode_toggle.click()
profile.ok_button.click()
self.sign_in.sign_in() self.sign_in.sign_in()
self.home.just_fyi("Check Discover Communities content") 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.append("Default username '%s' is not shown next to the received message" % self.username_1)
self.errors.verify_no_errors() self.errors.verify_no_errors()
@marks.smoke
@marks.testrail_id(702843) @marks.testrail_id(702843)
def test_community_message_edit(self): def test_community_message_edit(self):
message_before_edit, message_after_edit = 'Message BEFORE edit', "Message AFTER edit 2" message_before_edit, message_after_edit = 'Message BEFORE edit', "Message AFTER edit 2"

View File

@ -304,7 +304,6 @@ class ProfileView(BaseView):
self.advanced_button = AdvancedButton(self.driver) self.advanced_button = AdvancedButton(self.driver)
self.mutual_contact_request_switcher = Button(self.driver, accessibility_id="mutual-contact-requests-switch") self.mutual_contact_request_switcher = Button(self.driver, accessibility_id="mutual-contact-requests-switch")
## Network ## Network
self.network_settings_button = Button(self.driver, accessibility_id="network-button")
self.active_network_name = Text(self.driver, self.active_network_name = Text(self.driver,
xpath="//android.widget.TextView[contains(@text,'with upstream RPC')]") xpath="//android.widget.TextView[contains(@text,'with upstream RPC')]")
self.plus_button = Button(self.driver, xpath="(//android.widget.ImageView[@content-desc='icon'])[2]") 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_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_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_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, self.profile_legacy_button = Button(self.driver,
accessibility_id="icon, Legacy settings, label-component, icon") accessibility_id="icon, Legacy settings, label-component, icon")
self.testnet_mode_toggle = Button(self.driver, self.testnet_mode_toggle = Button(self.driver, accessibility_id="icon, Testnet mode, label-component")
xpath="//*[@content-desc='test-networks-enabled']/android.widget.Switch") self.confirm_testnet_mode_change_button = Button(self.driver, accessibility_id="confirm-testnet-mode-change")
def switch_network(self, network='Mainnet with upstream RPC'): def switch_network(self):
self.driver.info("## Switch network to '%s'" % network, device=False) self.profile_wallet_button.click()
self.advanced_button.click()
self.network_settings_button.click() self.network_settings_button.click()
network_button = Button(self.driver, xpath="//*[@text='%s']" % network) self.testnet_mode_toggle.click()
network_button.scroll_and_click() self.confirm_testnet_mode_change_button.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)
def open_contact_from_profile(self, username): def open_contact_from_profile(self, username):
self.driver.info("Opening profile of '%s' via Contacts" % username) self.driver.info("Opening profile of '%s' via Contacts" % username)