2023-12-05 13:23:02 +00:00
|
|
|
import allure
|
|
|
|
import pytest
|
|
|
|
from allure_commons._allure import step
|
|
|
|
|
|
|
|
import configs
|
|
|
|
import driver
|
2024-08-19 17:41:54 +00:00
|
|
|
from constants import ReturningUser, ReturningUsersData
|
2023-12-05 13:23:02 +00:00
|
|
|
from constants.wallet import WalletTransactions
|
|
|
|
from gui.components.onboarding.before_started_popup import BeforeStartedPopUp
|
|
|
|
from gui.components.onboarding.beta_consent_popup import BetaConsentPopup
|
|
|
|
from gui.components.signing_phrase_popup import SigningPhrasePopup
|
|
|
|
from gui.components.splash_screen import SplashScreen
|
2024-05-30 12:07:43 +00:00
|
|
|
from gui.components.authenticate_popup import AuthenticatePopup
|
2024-05-29 12:45:06 +00:00
|
|
|
from gui.screens.onboarding import KeysView, WelcomeToStatusView, BiometricsView, YourEmojihashAndIdenticonRingView
|
2023-12-05 13:23:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def keys_screen(main_window) -> KeysView:
|
|
|
|
with step('Open Generate new keys view'):
|
|
|
|
BeforeStartedPopUp().get_started()
|
2024-04-24 13:29:14 +00:00
|
|
|
welcome_screen = WelcomeToStatusView().wait_until_appears()
|
|
|
|
return welcome_screen.get_keys()
|
2023-12-05 13:23:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/704527',
|
|
|
|
'Send: can send 0 ETH to address pasted into receiver field with Simple flow')
|
|
|
|
@pytest.mark.case(704527)
|
2024-04-08 12:30:05 +00:00
|
|
|
@pytest.mark.transaction
|
2024-08-19 17:41:54 +00:00
|
|
|
@pytest.mark.parametrize('user_account', [ReturningUser(
|
|
|
|
seed_phrase=ReturningUsersData.WALLET_USER.value[0],
|
|
|
|
status_address=ReturningUsersData.WALLET_USER.value[1]
|
|
|
|
)])
|
2024-04-10 11:37:41 +00:00
|
|
|
@pytest.mark.parametrize('receiver_account_address, amount, asset, tab', [
|
2024-08-19 17:41:54 +00:00
|
|
|
pytest.param(ReturningUsersData.RETURNING_USER_ONE.value[1], 0, 'Ether', 'Assets')
|
2023-12-05 13:23:02 +00:00
|
|
|
])
|
2024-05-15 09:20:36 +00:00
|
|
|
@pytest.mark.timeout(timeout=120)
|
2024-05-30 06:56:28 +00:00
|
|
|
@pytest.mark.skip(reason="https://github.com/status-im/status-desktop/issues/14862")
|
|
|
|
@pytest.mark.skip(reason="https://github.com/status-im/status-desktop/issues/14509")
|
2024-04-10 11:37:41 +00:00
|
|
|
def test_wallet_send_0_eth(keys_screen, main_window, user_account, receiver_account_address, amount, asset, tab):
|
2023-12-05 13:23:02 +00:00
|
|
|
with step('Open import seed phrase view and enter seed phrase'):
|
|
|
|
input_view = keys_screen.open_import_seed_phrase_view().open_seed_phrase_input_view()
|
|
|
|
input_view.input_seed_phrase(user_account.seed_phrase, True)
|
|
|
|
profile_view = input_view.import_seed_phrase()
|
|
|
|
profile_view.set_display_name(user_account.name)
|
|
|
|
|
|
|
|
with step('Finalize onboarding and open main screen'):
|
2024-04-24 13:29:14 +00:00
|
|
|
create_password_view = profile_view.next()
|
2023-12-05 13:23:02 +00:00
|
|
|
confirm_password_view = create_password_view.create_password(user_account.password)
|
|
|
|
confirm_password_view.confirm_password(user_account.password)
|
2024-06-18 06:53:37 +00:00
|
|
|
if configs.system.get_platform() == "Darwin":
|
2023-12-05 13:23:02 +00:00
|
|
|
BiometricsView().wait_until_appears().prefer_password()
|
|
|
|
SplashScreen().wait_until_appears().wait_until_hidden()
|
2024-04-24 13:29:14 +00:00
|
|
|
next_view = YourEmojihashAndIdenticonRingView().verify_emojihash_view_present().next()
|
2024-06-18 06:53:37 +00:00
|
|
|
if configs.system.get_platform() == "Darwin":
|
2024-04-24 13:29:14 +00:00
|
|
|
next_view.start_using_status()
|
|
|
|
SplashScreen().wait_until_appears().wait_until_hidden()
|
2024-08-07 16:19:18 +00:00
|
|
|
if not configs.system.TEST_MODE and not configs._local.DEV_BUILD:
|
2023-12-05 13:23:02 +00:00
|
|
|
BetaConsentPopup().confirm()
|
|
|
|
|
|
|
|
with step('Verify that restored account reveals correct status wallet address'):
|
|
|
|
wallet_settings = main_window.left_panel.open_settings().left_panel.open_wallet_settings()
|
2024-04-05 13:04:04 +00:00
|
|
|
status_acc_view = wallet_settings.open_account_in_settings('Account 1', '0')
|
2023-12-05 13:23:02 +00:00
|
|
|
address = status_acc_view.get_account_address_value()
|
|
|
|
assert address == user_account.status_address, \
|
|
|
|
f"Recovered account should have address {user_account.status_address}, but has {address}"
|
|
|
|
status_acc_view.click_back_button()
|
|
|
|
|
|
|
|
with step('Set testnet mode'):
|
|
|
|
wallet_settings.open_networks().switch_testnet_mode_toggle().turn_on_testnet_mode_in_testnet_modal()
|
|
|
|
|
|
|
|
with step('Open send popup'):
|
|
|
|
wallet = main_window.left_panel.open_wallet()
|
|
|
|
SigningPhrasePopup().wait_until_appears().confirm_phrase()
|
|
|
|
assert driver.waitFor(lambda: wallet.left_panel.is_total_balance_visible, configs.timeouts.UI_LOAD_TIMEOUT_SEC)
|
|
|
|
f"Total balance is not visible"
|
2024-04-05 13:04:04 +00:00
|
|
|
wallet_account = wallet.left_panel.select_account('Account 1')
|
2023-12-05 13:23:02 +00:00
|
|
|
send_popup = wallet_account.open_send_popup()
|
|
|
|
|
|
|
|
with step('Enter asset, amount and address and click send and verify Mainnet network is shown'):
|
2024-04-10 11:37:41 +00:00
|
|
|
send_popup.send(receiver_account_address, amount, asset, tab)
|
|
|
|
assert driver.waitFor(lambda: send_popup.is_mainnet_network_identified, configs.timeouts.UI_LOAD_TIMEOUT_SEC)
|
|
|
|
|
|
|
|
with step('Enter password in authenticate popup'):
|
|
|
|
AuthenticatePopup().wait_until_appears().authenticate(user_account.password)
|
|
|
|
|
|
|
|
with step('Verify toast message with Transaction pending appears'):
|
|
|
|
assert WalletTransactions.TRANSACTION_PENDING_TOAST_MESSAGE.value in ' '.join(
|
|
|
|
main_window.wait_for_notification())
|