diff --git a/test/e2e/gui/objects_map/settings_names.py b/test/e2e/gui/objects_map/settings_names.py index 6804ab0230..c8923c5272 100644 --- a/test/e2e/gui/objects_map/settings_names.py +++ b/test/e2e/gui/objects_map/settings_names.py @@ -52,3 +52,6 @@ settingsContentBaseScrollView_Goerli_testnet_active_StatusBaseText = {"container 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} settingsContentBaseScrollView_accountOrderView_AccountOrderView = {"container": settingsContentBase_ScrollView, "id": "accountOrderView", "type": "AccountOrderView", "unnamed": 1, "visible": True} +settingsContentBaseScrollView_StatusBaseText = {"container": settingsContentBase_ScrollView, "type": "StatusBaseText", "unnamed": 1, "visible": True} +mainWindow_StatusToolBar = {"container": statusDesktop_mainWindow, "objectName": "statusToolBar", "type": "StatusToolBar", "visible": True} +main_toolBar_back_button = {"container": mainWindow_StatusToolBar, "objectName": "toolBarBackButton", "type": "StatusFlatButton", "visible": True} diff --git a/test/e2e/gui/screens/settings.py b/test/e2e/gui/screens/settings.py index 640f0cb03a..2c76618fe2 100644 --- a/test/e2e/gui/screens/settings.py +++ b/test/e2e/gui/screens/settings.py @@ -268,6 +268,16 @@ class EditAccountOrderSettings(WalletSettingsView): super(EditAccountOrderSettings, self).__init__() self._account_item = QObject('settingsContentBaseScrollView_draggableDelegate_StatusDraggableListItem') self._accounts_list = QObject('statusDesktop_mainWindow') + self._text_item = QObject('settingsContentBaseScrollView_StatusBaseText') + self._back_button = Button('main_toolBar_back_button') + + @property + @allure.step('Get edit account order recommendations') + def account_recommendations(self): + account_recommendations = [] + for obj in driver.findAllObjects(self._text_item.real_name): + account_recommendations.append(obj.text) + return account_recommendations @property @allure.step('Get accounts') @@ -306,3 +316,7 @@ class EditAccountOrderSettings(WalletSettingsView): bounds = [account for account in self.accounts if account.name == name][0].object.bounds d_bounds = self.accounts[index].object.bounds driver.mouse.press_and_move(self._accounts_list.object, bounds.x, bounds.y, d_bounds.x, d_bounds.y) + + @allure.step('Verify that back button is present') + def is_back_button_present(self) -> bool: + return self._back_button.is_visible diff --git a/test/e2e/tests/test_wallet/test_wallet_settings.py b/test/e2e/tests/test_wallet/test_wallet_settings.py index a2d813d031..9aa86809ba 100644 --- a/test/e2e/tests/test_wallet/test_wallet_settings.py +++ b/test/e2e/tests/test_wallet/test_wallet_settings.py @@ -118,3 +118,22 @@ def test_change_account_order_by_drag_and_drop(main_screen: MainWindow, user_acc assert driver.waitFor(lambda: wallet.left_panel.accounts[0].name == second_name) assert driver.waitFor(lambda: wallet.left_panel.accounts[1].name == name) 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') +@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() + + with step('Verify that only default account displayed'): + assert len(account_order.accounts) == 1 + assert account_order.accounts[0].name == default_name + + with step('Back button is present and text on top is correct'): + assert account_order.text_labels_from_edit_account_order_settings[0] == text_on_top + assert account_order.is_back_button_present() is True