2022-07-18 08:37:37 +00:00
|
|
|
from screens.StatusWalletScreen import StatusWalletScreen
|
|
|
|
|
2022-07-21 12:15:02 +00:00
|
|
|
_statusMain = StatusMainScreen()
|
2022-07-18 08:37:37 +00:00
|
|
|
_walletScreen = StatusWalletScreen()
|
|
|
|
|
2022-07-21 12:15:02 +00:00
|
|
|
@When("the user opens wallet screen")
|
|
|
|
def step(context):
|
|
|
|
_statusMain.open_wallet()
|
|
|
|
|
|
|
|
@When("the user accepts the signing phrase")
|
2022-07-18 08:37:37 +00:00
|
|
|
def step(context):
|
2022-07-20 08:18:27 +00:00
|
|
|
_walletScreen.accept_signing_phrase()
|
2022-07-18 08:37:37 +00:00
|
|
|
|
2022-07-20 08:18:27 +00:00
|
|
|
@When("the user adds watch only account with |any| and |any|")
|
2022-07-18 08:37:37 +00:00
|
|
|
def step(context, account_name, address):
|
2022-07-20 08:18:27 +00:00
|
|
|
_walletScreen.add_watch_only_account(account_name, address)
|
2022-07-18 08:37:37 +00:00
|
|
|
|
2022-07-20 08:18:27 +00:00
|
|
|
@When("the user generates a new account with |any| and |any|")
|
2022-07-18 08:37:37 +00:00
|
|
|
def step(context, account_name, password):
|
2022-07-20 08:18:27 +00:00
|
|
|
_walletScreen.generate_new_account(account_name, password)
|
2022-07-18 08:37:37 +00:00
|
|
|
|
2022-07-20 08:18:27 +00:00
|
|
|
@When("the user imports a private key with |any| and |any| and |any|")
|
2022-07-18 08:37:37 +00:00
|
|
|
def step(context, account_name, password, private_key):
|
2022-07-20 08:18:27 +00:00
|
|
|
_walletScreen.import_private_key(account_name, password, private_key)
|
2022-07-18 08:37:37 +00:00
|
|
|
|
2022-07-20 08:18:27 +00:00
|
|
|
@When("the user imports a seed phrase with |any| and |any| and |any|")
|
2022-07-18 08:37:37 +00:00
|
|
|
def step(context, account_name, password, mnemonic):
|
2022-07-20 08:18:27 +00:00
|
|
|
_walletScreen.import_seed_phrase(account_name, password, mnemonic)
|
2022-07-18 08:37:37 +00:00
|
|
|
|
2022-07-21 12:15:02 +00:00
|
|
|
@When("the user sends a transaction to himself from account |any| of |any| |any| on |any| with password |any|")
|
|
|
|
def step(context, account_name, amount, token, chain_name, password):
|
|
|
|
_walletScreen.send_transaction(account_name, amount, token, chain_name, password)
|
|
|
|
|
2022-08-04 09:06:15 +00:00
|
|
|
@When("the user adds a saved address named |any| and address |any|")
|
2022-08-03 10:08:46 +00:00
|
|
|
def step(context, name, address):
|
|
|
|
_walletScreen.add_saved_address(name, address)
|
|
|
|
|
2022-08-04 09:06:15 +00:00
|
|
|
@When("the user edits a saved address with name |any| to |any|")
|
|
|
|
def step(context, name, new_name):
|
|
|
|
_walletScreen.edit_saved_address(name, new_name)
|
|
|
|
|
|
|
|
@When("the user deletes the saved address with name |any|")
|
|
|
|
def step(context, name):
|
|
|
|
_walletScreen.delete_saved_address(name)
|
|
|
|
|
2022-08-08 10:07:29 +00:00
|
|
|
@When("the user toggles the network |any|")
|
|
|
|
def step(context, network_name):
|
|
|
|
_walletScreen.toggle_network(network_name)
|
|
|
|
|
|
|
|
@Then("the user has a positive balance of |any|")
|
|
|
|
def step(context, symbol):
|
|
|
|
_walletScreen.verify_positive_balance(symbol)
|
|
|
|
|
2022-07-18 08:37:37 +00:00
|
|
|
@Then("the new account |any| is added")
|
|
|
|
def step(context, account_name):
|
2022-07-21 12:15:02 +00:00
|
|
|
_walletScreen.verify_account_name_is_present(account_name)
|
|
|
|
|
|
|
|
@Then("the transaction is in progress")
|
|
|
|
def step(context):
|
2022-08-03 10:08:46 +00:00
|
|
|
_walletScreen.verify_transaction()
|
|
|
|
|
|
|
|
@Then("the name |any| is in the list of saved addresses")
|
|
|
|
def step(context, name: str):
|
|
|
|
_walletScreen.verify_saved_address_exists(name)
|
2022-08-04 09:06:15 +00:00
|
|
|
|
|
|
|
@Then("the name |any| is not in the list of saved addresses")
|
|
|
|
def step(context, name: str):
|
2022-08-10 14:26:29 +00:00
|
|
|
_walletScreen.verify_saved_address_doesnt_exist(name)
|
|
|
|
|
|
|
|
@Then("the collectibles are listed for the |any|")
|
|
|
|
def step(context, account_name: str):
|
|
|
|
_walletScreen.verify_collectibles_exist(account_name)
|