chore(@wallet_settings): added verifications for back button and subtitle (#114)

Added back button field to NetworkWalletSettings class
Added subtitle field to NetworkWalletSettings class
Added step to verify the testnet subtitle
This commit is contained in:
Anastasiya Semenkevich 2023-09-20 17:18:00 +03:00 committed by GitHub
parent bd07b1d0dd
commit f5f94a70d4
4 changed files with 38 additions and 11 deletions

View File

@ -7,3 +7,7 @@ class DerivationPath(Enum):
ETHEREUM_ROPSTEN = 'Ethereum Testnet (Ropsten)'
ETHEREUM_LEDGER = 'Ethereum (Ledger)'
ETHEREUM_LEDGER_LIVE = 'Ethereum (Ledger Live/KeepKey)'
class WalletNetworkSettings(Enum):
TESTNET_SUBTITLE = 'Switch entire Status app to testnet only mode'

View File

@ -48,6 +48,7 @@ settingsContentBaseScrollView_accountOrderItem_StatusListItem = {"container": se
settingsContentBaseScrollView_WalletNetworkDelegate = {"container": settingsContentBase_ScrollView, "type": "WalletNetworkDelegate", "unnamed": 1, "visible": True}
settingsContentBaseScrollView_StatusListItem = {"container": settingsContentBase_ScrollView, "type": "StatusListItem", "unnamed": 1, "visible": True}
settings_Wallet_NetworksView_TestNet_Toggle = {"container": statusDesktop_mainWindow, "objectName": "testnetModeSwitch", "type": "StatusSwitch"}
settings_Wallet_NetworksView_TestNet_Toggle_Title = {"container": settingsContentBase_ScrollView, "objectName": "statusListItemSubTitle", "type": "StatusTextWithLoadingState", "visible": True}
settingsContentBaseScrollView_Goerli_testnet_active_StatusBaseText = {"container": settingsContentBase_ScrollView, "type": "StatusBaseText", "unnamed": 1, "visible": True}
settingsContentBaseScrollView_accountsList_StatusListView = {"container": settingsContentBase_ScrollView, "id": "accountsList", "type": "StatusListView", "unnamed": 1, "visible": True}
settingsContentBaseScrollView_draggableDelegate_StatusDraggableListItem = {"checkable": False, "container": settingsContentBase_ScrollView, "id": "draggableDelegate", "type": "StatusDraggableListItem", "unnamed": 1, "visible": True}

View File

@ -275,12 +275,22 @@ class NetworkWalletSettings(WalletSettingsView):
self._wallet_networks_item = QObject('settingsContentBaseScrollView_WalletNetworkDelegate')
self._testnet_text_item = QObject('settingsContentBaseScrollView_Goerli_testnet_active_StatusBaseText')
self._testnet_mode_button = Button('settings_Wallet_NetworksView_TestNet_Toggle')
self._testnet_mode_title = TextLabel('settings_Wallet_NetworksView_TestNet_Toggle_Title')
self._back_button = Button('main_toolBar_back_button')
@property
@allure.step('Get wallet networks items')
def networks_names(self) -> typing.List[str]:
return [str(network.title) for network in driver.findAllObjects(self._wallet_networks_item.real_name)]
@allure.step('Verify Testnet toggle subtitle')
def get_testnet_toggle_subtitle(self):
return self._testnet_mode_title.text
@allure.step('Verify back to Wallet settings button')
def is_back_to_wallet__settings_button_present(self):
return self._back_button.is_visible
@property
@allure.step('Get amount of testnet active items')
def testnet_items_amount(self) -> int:

View File

@ -8,6 +8,7 @@ from gui.components.signing_phrase_popup import SigningPhrasePopup
from gui.components.wallet.authenticate_popup import AuthenticatePopup
from gui.components.wallet.testnet_mode_banner import TestnetModeBanner
from gui.components.wallet.wallet_toast_message import WalletToastMessage
from constants.wallet import WalletNetworkSettings
from gui.main_window import MainWindow
from scripts.tools import image
@ -16,7 +17,7 @@ from scripts.tools import image
@pytest.mark.case(703505)
@pytest.mark.parametrize('first_network, second_network, third_network, message_turned_on, message_turned_off', [
pytest.param('Mainnet', 'Optimism', 'Arbitrum', 'Testnet mode turned on', 'Testnet mode turned off')
])
])
def test_switch_testnet_mode(main_screen: MainWindow, first_network: str, second_network: str, third_network: str,
message_turned_on: str, message_turned_off: str):
with step('Started to turn on Testnet mode but cancel it'):
@ -24,6 +25,15 @@ def test_switch_testnet_mode(main_screen: MainWindow, first_network: str, second
assert networks.get_testnet_mode_button_checked_state() is False
networks.switch_testnet_mode().cancel()
with step('Verify that Testnet toggle has subtitle'):
subtitle = networks.get_testnet_toggle_subtitle()
assert subtitle == WalletNetworkSettings.TESTNET_SUBTITLE.value, \
f"Testnet title is incorrect, current subtitle is {subtitle}"
with step('Back button is present and text on top is correct'):
assert networks.is_back_to_wallet_settings_button_present() is True, \
f"Back to Wallet settings button is not visible on Networks screen"
with step('Verify that Testnet mode not turned on'):
assert networks.get_testnet_mode_button_checked_state() is False
@ -56,14 +66,15 @@ def test_switch_testnet_mode(main_screen: MainWindow, first_network: str, second
assert networks.get_testnet_mode_button_checked_state() is False
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703415', 'Account order: account order could be changed with drag&drop')
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703415',
'Account order: account order could be changed with drag&drop')
@pytest.mark.case(703415)
@pytest.mark.parametrize('address, default_name, name, color, emoji, second_name, second_color, second_emoji', [
pytest.param('0xea123F7beFF45E3C9fdF54B324c29DBdA14a639A', 'Status account',
'WatchOnly', '#2a4af5', 'sunglasses', 'Generated', '#216266', 'thumbsup')
])
])
def test_change_account_order_by_drag_and_drop(main_screen: MainWindow, user_account, address: str, default_name,
name: str, color: str, emoji: str, second_name: str , second_color: str,
name: str, color: str, emoji: str, second_name: str, second_color: str,
second_emoji: str):
with step('Create watch-only wallet account'):
wallet = main_screen.left_panel.open_wallet()
@ -120,12 +131,13 @@ def test_change_account_order_by_drag_and_drop(main_screen: MainWindow, user_acc
assert driver.waitFor(lambda: wallet.left_panel.accounts[2].name == default_name)
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/edit/703416', 'Account order: reordering is not possible having a single account')
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/edit/703416',
'Account order: reordering is not possible having a single account')
@pytest.mark.case(703416)
@pytest.mark.parametrize('default_name, text_on_top', [
pytest.param('Status account', 'This account looks a little lonely. Add another account'
' to enable re-ordering.')
])
])
def test_change_account_order_not_possible(main_screen: MainWindow, default_name: str, text_on_top: str):
with step('Open edit account order view'):
account_order = main_screen.left_panel.open_settings().left_panel.open_wallet_settings().open_account_order()