chore(@e2e_tests): split scenario to create and edit, improved edit logic
This commit is contained in:
parent
ff8fc9a9a8
commit
373608d744
|
@ -9,6 +9,7 @@ class SavedAddressPopup(BasePopup):
|
|||
self._name_text_edit = TextEdit('mainWallet_Saved_Addreses_Popup_Name_Input')
|
||||
self._save_add_address_button = Button('mainWallet_Saved_Addreses_Popup_Address_Add_Button')
|
||||
self._add_networks_selector = BaseElement('mainWallet_Saved_Addreses_Popup_Add_Network_Selector_Tag')
|
||||
self._add_networks_button = Button('mainWallet_Saved_Addreses_Popup_Add_Network_Button')
|
||||
self._ethereum_mainnet_checkbox = CheckBox('mainWallet_Saved_Addresses_Popup_Add_Network_Selector_Mainnet_checkbox')
|
||||
self._optimism_mainnet_checkbox = CheckBox('mainWallet_Saved_Addresses_Popup_Add_Network_Selector_Optimism_checkbox')
|
||||
self._arbitrum_mainnet_checkbox = CheckBox('mainWallet_Saved_Addresses_Popup_Add_Network_Selector_Arbitrum_checkbox')
|
||||
|
@ -16,11 +17,6 @@ class SavedAddressPopup(BasePopup):
|
|||
self._optimism_mainnet_network_tag = BaseElement('mainWallet_Saved_Addresses_Popup_Network_Selector_Optimism_network_tag')
|
||||
self._arbitrum_mainnet_network_tag = BaseElement('mainWallet_Saved_Addresses_Popup_Network_Selector_Arbitrum_network_tag')
|
||||
|
||||
class AddSavedAddressPopup(SavedAddressPopup):
|
||||
def __init__(self):
|
||||
super(AddSavedAddressPopup, self).__init__()
|
||||
self._address_text_edit = TextEdit('mainWallet_Saved_Addreses_Popup_Address_Input_Edit')
|
||||
|
||||
def set_ethereum_mainnet_network(self, value: bool):
|
||||
self._ethereum_mainnet_checkbox.set(value)
|
||||
return self
|
||||
|
@ -45,6 +41,13 @@ class AddSavedAddressPopup(SavedAddressPopup):
|
|||
def verify_arbitrum_mainnet_network_tag_present(self):
|
||||
assert self._arbitrum_mainnet_network_tag.is_visible, f'Arbitrum Mainnet network tag is not present'
|
||||
|
||||
|
||||
|
||||
class AddSavedAddressPopup(SavedAddressPopup):
|
||||
def __init__(self):
|
||||
super(AddSavedAddressPopup, self).__init__()
|
||||
self._address_text_edit = TextEdit('mainWallet_Saved_Addreses_Popup_Address_Input_Edit')
|
||||
|
||||
def add_saved_address(self, name: str, address: str):
|
||||
self._name_text_edit.text = name
|
||||
self._address_text_edit.clear(verify=False)
|
||||
|
@ -70,5 +73,10 @@ class EditSavedAddressPopup(SavedAddressPopup):
|
|||
|
||||
def edit_saved_address(self, name: str):
|
||||
self._name_text_edit.text = name
|
||||
self._add_networks_button.click()
|
||||
self.set_optimism_mainnet_network(False)
|
||||
self.set_arbitrum_mainnet_network(False)
|
||||
self._save_add_address_button.click()
|
||||
self.verify_ethereum_mainnet_network_tag_present
|
||||
self._save_add_address_button.click()
|
||||
self.wait_until_hidden()
|
||||
|
|
|
@ -166,6 +166,7 @@ mainWallet_Saved_Addreses_Popup_Address_Input = {"container": statusDesktop_main
|
|||
mainWallet_Saved_Addreses_Popup_Address_Input_Edit = {"container": statusDesktop_mainWindow, "objectName": "savedAddressAddressInputEdit", "type": "TextEdit"}
|
||||
mainWallet_Saved_Addreses_Popup_Address_Add_Button = {"container": statusDesktop_mainWindow, "objectName": "addSavedAddress", "type": "StatusButton"}
|
||||
mainWallet_Saved_Addreses_Popup_Add_Network_Selector = {"container": statusDesktop_mainWindow, "objectName": "addSavedAddressNetworkSelector", "type": "StatusNetworkSelector", "visible": True}
|
||||
mainWallet_Saved_Addreses_Popup_Add_Network_Button = {"container": statusDesktop_mainWindow_overlay, "objectName": "addNetworkTagItemButton", "type": "StatusRoundButton", "visible": True}
|
||||
mainWallet_Saved_Addreses_Popup_Add_Network_Selector_Tag = {"container": statusDesktop_mainWindow_overlay, "objectName": "networkSelectorTag", "type": "StatusNetworkListItemTag"}
|
||||
mainWallet_Saved_Addresses_Popup_Add_Network_Selector_Mainnet_checkbox = {"container": statusDesktop_mainWindow_overlay, "objectName": "networkSelectionCheckbox_Ethereum Mainnet", "type": "StatusCheckBox", "visible": True}
|
||||
mainWallet_Saved_Addresses_Popup_Add_Network_Selector_Optimism_checkbox = {"container": statusDesktop_mainWindow_overlay, "objectName": "networkSelectionCheckbox_Optimism", "type": "StatusCheckBox", "visible": True}
|
||||
|
|
|
@ -155,7 +155,7 @@ def step(context, name):
|
|||
def step(context, account_name, amount, token, chain_name, password):
|
||||
_walletScreen.send_transaction(account_name, amount, token, chain_name, password)
|
||||
|
||||
@When("the user adds a saved address named \"|any|\" and address \"|any|\"")
|
||||
@When("the user adds a saved address with name \"|any|\" and address \"|any|\"")
|
||||
def step(context, name, address):
|
||||
_walletScreen.add_saved_address(name, address)
|
||||
|
||||
|
@ -220,11 +220,11 @@ def step(context, symbol):
|
|||
def step(context):
|
||||
_walletScreen.verify_transaction()
|
||||
|
||||
@Then("the name \"|any|\" is in the list of saved addresses")
|
||||
@Then("the saved address with name \"|any|\" is in the list of saved addresses")
|
||||
def step(context, name: str):
|
||||
_walletScreen.verify_saved_address_exists(name)
|
||||
|
||||
@Then("the name \"|any|\" is not in the list of saved addresses")
|
||||
@Then("the saved address with name \"|any|\" is not in the list of saved addresses")
|
||||
def step(context, name: str):
|
||||
_walletScreen.verify_saved_address_doesnt_exist(name)
|
||||
|
||||
|
|
|
@ -8,18 +8,26 @@ Background:
|
|||
And the user opens the wallet section
|
||||
And the user accepts the signing phrase
|
||||
|
||||
Scenario Outline: The user can add saved address with all network options, edit address name and delete address record
|
||||
When the user adds a saved address named "<name>" and address "<address>"
|
||||
And the user edits a saved address with name "<name>" to "<new_name>"
|
||||
Then the name "<new_name>" is in the list of saved addresses
|
||||
When the user deletes the saved address with name "<new_name>"
|
||||
Then the name "<new_name>" is not in the list of saved addresses
|
||||
Scenario Outline: The user can add saved address with all network options and delete address record
|
||||
When the user adds a saved address with name "<name>" and address "<address>"
|
||||
Then the saved address with name "<name>" is in the list of saved addresses
|
||||
When the user deletes the saved address with name "<name>"
|
||||
Then the saved address with name "<name>" is not in the list of saved addresses
|
||||
Examples:
|
||||
| name | address |new_name |
|
||||
| bar | 0x8397bc3c5a60a1883174f722403d63a8833312b7 |foo |
|
||||
| name | address |
|
||||
| Saved address | 0x8397bc3c5a60a1883174f722403d63a8833312b7 |
|
||||
|
||||
Scenario Outline: The user can add saved address with all network options, change address name and disable networks
|
||||
When the user adds a saved address with name "<name>" and address "<address>"
|
||||
And the user edits a saved address with name "<name>" to "<new_name>"
|
||||
Then the saved address with name "<new_name>" is in the list of saved addresses
|
||||
# And the user can open saved address in "<explorer>" TODO: later
|
||||
Examples:
|
||||
| name | address |new_name |
|
||||
| Saved address name before | 0x8397bc3c5a60a1883174f722403d63a8833312b7 |Saved address name after |
|
||||
|
||||
# | foo | nastya.stateofus.eth | bar | https://github.com/status-im/status-desktop/issues/11090
|
||||
# TODO: actions from burger menu
|
||||
# TODO: split the scenario above to several (exclude delete i think)
|
||||
# TODO: enhance edit actions to change networks
|
||||
# TODO: test for Share button
|
||||
# TODO: add logic to recognize mainnet / testnet and select appropriate networks
|
|
@ -156,6 +156,7 @@ Rectangle {
|
|||
|
||||
StatusRoundButton {
|
||||
id: addItemButton
|
||||
objectName: "addNetworkTagItemButton"
|
||||
|
||||
implicitHeight: 32
|
||||
implicitWidth: implicitHeight
|
||||
|
|
Loading…
Reference in New Issue