test(@tst_wallet_account_management): add test to verify hide watch-only button
This commit is contained in:
parent
a263b16862
commit
d9f15ace2b
|
@ -68,6 +68,7 @@ class LeftPanel(BaseElement):
|
||||||
self._saved_addresses_button = BaseElement('mainWallet_Saved_Addresses_Button')
|
self._saved_addresses_button = BaseElement('mainWallet_Saved_Addresses_Button')
|
||||||
self._wallet_account_item = BaseElement('walletAccount_StatusListItem')
|
self._wallet_account_item = BaseElement('walletAccount_StatusListItem')
|
||||||
self._add_account_button = Button('mainWallet_Add_Account_Button')
|
self._add_account_button = Button('mainWallet_Add_Account_Button')
|
||||||
|
self._all_accounts_button = Button('mainWallet_All_Accounts_Button')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def accounts(self) -> typing.List[constants.wallet.account_list_item]:
|
def accounts(self) -> typing.List[constants.wallet.account_list_item]:
|
||||||
|
@ -162,6 +163,9 @@ class LeftPanel(BaseElement):
|
||||||
return self.delete_account(account_name, attempt - 1)
|
return self.delete_account(account_name, attempt - 1)
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
def open_all_accounts_view(self):
|
||||||
|
self._all_accounts_button.click()
|
||||||
|
|
||||||
|
|
||||||
class SavedAddressListItem(BaseElement):
|
class SavedAddressListItem(BaseElement):
|
||||||
|
@ -270,6 +274,7 @@ class MainWalletScreen(Enum):
|
||||||
ACCOUNT_ADDRESS_PANEL: str = "mainWallet_Address_Panel"
|
ACCOUNT_ADDRESS_PANEL: str = "mainWallet_Address_Panel"
|
||||||
SEND_BUTTON_FOOTER: str = "mainWallet_Footer_Send_Button"
|
SEND_BUTTON_FOOTER: str = "mainWallet_Footer_Send_Button"
|
||||||
NETWORK_SELECTOR_BUTTON: str = "mainWallet_Network_Selector_Button"
|
NETWORK_SELECTOR_BUTTON: str = "mainWallet_Network_Selector_Button"
|
||||||
|
HIDE_SHOW_WATCH_ONLY_BUTTON: str = "mainWallet_Hide_Show_Watch_Only_Button"
|
||||||
RIGHT_SIDE_TABBAR: str = "mainWallet_Right_Side_Tab_Bar"
|
RIGHT_SIDE_TABBAR: str = "mainWallet_Right_Side_Tab_Bar"
|
||||||
WALLET_ACCOUNTS_LIST: str = "walletAccounts_StatusListView"
|
WALLET_ACCOUNTS_LIST: str = "walletAccounts_StatusListView"
|
||||||
WALLET_ACCOUNT_ITEM_PLACEHOLDER = "walletAccounts_WalletAccountItem_Placeholder"
|
WALLET_ACCOUNT_ITEM_PLACEHOLDER = "walletAccounts_WalletAccountItem_Placeholder"
|
||||||
|
@ -417,6 +422,12 @@ class StatusWalletScreen:
|
||||||
return
|
return
|
||||||
|
|
||||||
assert False, "network name not found"
|
assert False, "network name not found"
|
||||||
|
|
||||||
|
def click_hide_show_watch_only(self):
|
||||||
|
button_value_before_click = get_obj(MainWalletScreen.HIDE_SHOW_WATCH_ONLY_BUTTON.value).text
|
||||||
|
Button(MainWalletScreen.HIDE_SHOW_WATCH_ONLY_BUTTON.value).click()
|
||||||
|
button_value_after_click = get_obj(MainWalletScreen.HIDE_SHOW_WATCH_ONLY_BUTTON.value).text
|
||||||
|
assert button_value_before_click != button_value_after_click, f"Hide/Show watch only button label is not changed, button label is {button_value_after_click}, was {button_value_before_click}"
|
||||||
|
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
|
|
|
@ -10,6 +10,8 @@ mainWallet_Saved_Addresses_Button = {"container": mainWindow_RighPanel, "objectN
|
||||||
walletAccounts_StatusListView = {"container": statusDesktop_mainWindow, "objectName": "walletAccountsListView", "type": "StatusListView", "visible": True}
|
walletAccounts_StatusListView = {"container": statusDesktop_mainWindow, "objectName": "walletAccountsListView", "type": "StatusListView", "visible": True}
|
||||||
walletAccounts_WalletAccountItem_Placeholder = {"container": walletAccounts_StatusListView, "objectName": "walletAccount-%NAME%", "type": "StatusListItem", "visible": True}
|
walletAccounts_WalletAccountItem_Placeholder = {"container": walletAccounts_StatusListView, "objectName": "walletAccount-%NAME%", "type": "StatusListItem", "visible": True}
|
||||||
walletAccount_StatusListItem = {"container": walletAccounts_StatusListView, "objectName": RegularExpression("walletAccount*"), "type": "StatusListItem", "visible": True}
|
walletAccount_StatusListItem = {"container": walletAccounts_StatusListView, "objectName": RegularExpression("walletAccount*"), "type": "StatusListItem", "visible": True}
|
||||||
|
mainWallet_Hide_Show_Watch_Only_Button = {"container": statusDesktop_mainWindow, "objectName": "hideShowWatchOnlyButton", "type": "StatusButton", "visible": True}
|
||||||
|
mainWallet_All_Accounts_Button = {"container": walletAccounts_StatusListView, "objectName": "allAccountsBtn", "type": "Button", "visible": True}
|
||||||
|
|
||||||
# Context Menu
|
# Context Menu
|
||||||
mainWallet_CopyAddress_MenuItem = {"container": contextMenu_PopupItem, "enabled": True, "objectName": RegularExpression("AccountMenu-CopyAddressAction*"), "type": "StatusMenuItem"}
|
mainWallet_CopyAddress_MenuItem = {"container": contextMenu_PopupItem, "enabled": True, "objectName": RegularExpression("AccountMenu-CopyAddressAction*"), "type": "StatusMenuItem"}
|
||||||
|
|
|
@ -135,6 +135,10 @@ def step(context, name, new_name, new_color, new_emoji):
|
||||||
def step(context, name):
|
def step(context, name):
|
||||||
_walletScreen.left_panel.delete_account(name).confirm()
|
_walletScreen.left_panel.delete_account(name).confirm()
|
||||||
|
|
||||||
|
@When("the user opens All accounts view")
|
||||||
|
def step(context):
|
||||||
|
_walletScreen.left_panel.open_all_accounts_view()
|
||||||
|
|
||||||
|
|
||||||
@When("the user start removing account \"|any|\" and cancel it")
|
@When("the user start removing account \"|any|\" and cancel it")
|
||||||
def step(context, name):
|
def step(context, name):
|
||||||
|
@ -178,6 +182,10 @@ def step(context, name):
|
||||||
def step(context, network_name):
|
def step(context, network_name):
|
||||||
_walletScreen.toggle_network(network_name)
|
_walletScreen.toggle_network(network_name)
|
||||||
|
|
||||||
|
@When("the user clicks Hide / Show watch-only button")
|
||||||
|
def step(context):
|
||||||
|
_walletScreen.click_hide_show_watch_only()
|
||||||
|
|
||||||
|
|
||||||
#########################
|
#########################
|
||||||
### VERIFICATIONS region:
|
### VERIFICATIONS region:
|
||||||
|
|
|
@ -29,6 +29,20 @@ Feature: Status Desktop Wallet Section Wallet Account Management
|
||||||
| 0xea123F7beFF45E3C9fdF54B324c29DBdA14a639A | AccWatch1 | 2a4af5 | sunglasses | 1f60e | yes | AccWatch1edited | 216266 | thumbsup | 1f44d |
|
| 0xea123F7beFF45E3C9fdF54B324c29DBdA14a639A | AccWatch1 | 2a4af5 | sunglasses | 1f60e | yes | AccWatch1edited | 216266 | thumbsup | 1f44d |
|
||||||
| 0xea123F7beFF45E3C9fdF54B324c29DBdA14a639B | AccWatch2 | 7140fd | sunglasses | 1f60e | no | AccWatch2edited | 2a799b | thumbsup | 1f44d |
|
| 0xea123F7beFF45E3C9fdF54B324c29DBdA14a639B | AccWatch2 | 7140fd | sunglasses | 1f60e | no | AccWatch2edited | 2a799b | thumbsup | 1f44d |
|
||||||
|
|
||||||
|
Scenario Outline: The user can hide and show watch only account by clicking Hide / Show button
|
||||||
|
When the user adds a watch only account "<address>" with "<name>" color "#<color>" and emoji "<emoji>" via "<add_via_context_menu>"
|
||||||
|
Then the account is correctly displayed with "<name>" and "#<color>" and emoji unicode "<emoji_unicode>" in accounts list
|
||||||
|
When the user opens All accounts view
|
||||||
|
And the user clicks Hide / Show watch-only button
|
||||||
|
Then the account with "<name>" is not displayed
|
||||||
|
When the user opens All accounts view
|
||||||
|
And the user clicks Hide / Show watch-only button
|
||||||
|
Then the account is correctly displayed with "<name>" and "#<color>" and emoji unicode "<emoji_unicode>" in accounts list
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
| address | name | color | emoji | emoji_unicode | add_via_context_menu |
|
||||||
|
| 0xea123F7beFF45E3C9fdF54B324c29DBdA14a639A | AccWatch1 | 2a4af5 | sunglasses | 1f60e | yes |
|
||||||
|
|
||||||
Scenario Outline: The user cancel deliting watch only account
|
Scenario Outline: The user cancel deliting watch only account
|
||||||
When the user adds a watch only account "<address>" with "<name>" color "#<color>" and emoji "<emoji>" via "<add_via_context_menu>"
|
When the user adds a watch only account "<address>" with "<name>" color "#<color>" and emoji "<emoji>" via "<add_via_context_menu>"
|
||||||
Then the account is correctly displayed with "<name>" and "#<color>" and emoji unicode "<emoji_unicode>" in accounts list
|
Then the account is correctly displayed with "<name>" and "#<color>" and emoji unicode "<emoji_unicode>" in accounts list
|
||||||
|
|
|
@ -85,6 +85,7 @@ Item {
|
||||||
|
|
||||||
|
|
||||||
StatusButton {
|
StatusButton {
|
||||||
|
objectName: "hideShowWatchOnlyButton"
|
||||||
Layout.preferredHeight: 38
|
Layout.preferredHeight: 38
|
||||||
Layout.alignment: Qt.AlignTop
|
Layout.alignment: Qt.AlignTop
|
||||||
|
|
||||||
|
|
|
@ -285,6 +285,7 @@ Rectangle {
|
||||||
verticalPadding: Style.current.padding
|
verticalPadding: Style.current.padding
|
||||||
horizontalPadding: Style.current.padding
|
horizontalPadding: Style.current.padding
|
||||||
highlighted: true
|
highlighted: true
|
||||||
|
objectName: "allAccountsBtn"
|
||||||
|
|
||||||
leftInset: Style.current.padding
|
leftInset: Style.current.padding
|
||||||
bottomInset: Style.current.padding
|
bottomInset: Style.current.padding
|
||||||
|
|
Loading…
Reference in New Issue