Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: use seed phrase for account with funds under env var #16276

Merged
merged 2 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/e2e/configs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
if get_platform() == "Windows" and 'bin' not in AUT_PATH:
exit('Please use launcher from "bin" folder in "AUT_PATH"')
AUT_PATH = SystemPath(AUT_PATH)
WALLET_SEED = os.getenv('WALLET_TEST_USER_SEED')

# Save application logs
AUT_DIR = path.dirname(AUT_PATH)
Expand Down
18 changes: 0 additions & 18 deletions test/e2e/constants/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,13 @@ def __init__(self, seed_phrase, status_address):
self.status_address = status_address


class ReturningUsersData(Enum):
RETURNING_USER_ONE = (
[
'rail', 'witness', 'era', 'asthma', 'empty', 'cheap', 'shed', 'pond', 'skate', 'amount', 'invite', 'year'
], '0x3286c371ef648fe6232324b27ee0515f4ded24d9')
RETURNING_USER_TWO = (
[
'measure', 'cube', 'cousin', 'debris', 'slam', 'ignore', 'seven', 'hat', 'satisfy', 'frown', 'casino',
'inflict'
], '0x99C096bB5F12bDe37DE9dbee8257Ebe2a5667C46')
WALLET_USER = (
[
'vocal', 'fruit', 'ordinary', 'meadow', 'south', 'athlete', 'inherit', 'since', 'version', 'pitch',
'oppose', 'lonely'
], '0x26d6e10a6af4eb4d12ff4cf133a843eb4fa88d0b')


user_account_one = UserAccount('squisher', '0000000000', [
'rail', 'witness', 'era', 'asthma', 'empty', 'cheap', 'shed', 'pond', 'skate', 'amount', 'invite', 'year'
], '0x3286c371ef648fe6232324b27ee0515f4ded24d9')
user_account_two = UserAccount('athletic', '0000000000', [
'measure', 'cube', 'cousin', 'debris', 'slam', 'ignore', 'seven', 'hat', 'satisfy', 'frown', 'casino', 'inflict'
], '0x99C096bB5F12bDe37DE9dbee8257Ebe2a5667C46')


community_params = {
'name': ''.join(random.choices(string.ascii_letters +
string.digits, k=30)),
Expand Down
14 changes: 4 additions & 10 deletions test/e2e/constants/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ def select_random_path_name(cls):
return random.choice(list(DerivationPathName))


class WalletAddress(Enum):
RECEIVER_ADDRESS = '0x3286c371ef648fe6232324b27ee0515f4ded24d9'


class DerivationPathValue(Enum):
STATUS_ACCOUNT_DERIVATION_PATH = "m / 44' / 60' / 0' / 0 / 0"
GENERATED_ACCOUNT_DERIVATION_PATH_1 = "m / 44' / 60' / 0' / 0 / 1"
Expand Down Expand Up @@ -89,13 +93,3 @@ class WalletAccountPopup(Enum):
WALLET_ACCOUNT_NAME_MIN = 'Account name must be at least 5 characters'
WALLET_KEYPAIR_NAME_MIN = 'Key pair name must be at least 5 character(s)'
WALLET_KEYPAIR_MIN = 'Key pair must be at least 5 character(s)'


class SeedPhrases(Enum):
TWELVE_WORDS_SEED = 'pelican chief sudden oval media rare swamp elephant lawsuit wheat knife initial'
EIGHTEEN_WORDS_SEED = 'kitten tiny cup admit cactus shrug shuffle accident century faith roof plastic beach police barely vacant sign blossom'
TWENTY_FOUR_WORDS_SEED = 'elite dinosaur flavor canoe garbage palace antique dolphin virtual mixed sand impact solution inmate hair pipe affair cage vote estate gloom lamp robust like'

@classmethod
def select_random_seed(cls):
return random.choice(list(SeedPhrases))
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from allure_commons._allure import step

import configs
import constants
import driver
from configs import WALLET_SEED
from configs.timeouts import UI_LOAD_TIMEOUT_SEC
from constants import ReturningUser, ReturningUsersData
from constants import ReturningUser
from scripts.utils.generators import random_ens_string
from constants.wallet import WalletTransactions
from tests.settings import marks
Expand Down Expand Up @@ -34,12 +34,13 @@ def keys_screen(main_window) -> KeysView:
@pytest.mark.case(704597)
@pytest.mark.transaction
@pytest.mark.parametrize('user_account', [ReturningUser(
seed_phrase=ReturningUsersData.WALLET_USER.value[0],
status_address=ReturningUsersData.WALLET_USER.value[1]
seed_phrase=WALLET_SEED.split(),
status_address='0x44ddd47a0c7681a5b0fa080a56cbb7701db4bb43'
)])
@pytest.mark.parametrize('ens_name', [pytest.param(random_ens_string())])
def test_ens_name_purchase(keys_screen, main_window, user_account, ens_name):
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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import configs
import constants
import driver
from constants import ReturningUser, ReturningUsersData
from configs import WALLET_SEED
from constants import ReturningUser
from tests.communities import marks
from constants.community_settings import MintOwnerTokensElements
from gui.components.onboarding.before_started_popup import BeforeStartedPopUp
Expand All @@ -30,10 +31,11 @@ def keys_screen(main_window) -> KeysView:
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/727245', 'Mint owner token')
@pytest.mark.case(727245)
@pytest.mark.parametrize('user_account', [ReturningUser(
seed_phrase=ReturningUsersData.WALLET_USER.value[0],
status_address=ReturningUsersData.WALLET_USER.value[1]
seed_phrase=WALLET_SEED.split(),
status_address='0x44ddd47a0c7681a5b0fa080a56cbb7701db4bb43'
)])
@pytest.mark.transaction
@pytest.mark.skip('temp skip test to fix it using L2 networks')
def test_mint_owner_and_tokenmaster_tokens(keys_screen, main_window, user_account):
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()
Expand Down
11 changes: 6 additions & 5 deletions test/e2e/tests/transactions_tests/test_wallet_send_eth.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@

import configs
import driver
from constants import ReturningUser, ReturningUsersData
from constants.wallet import WalletTransactions
from configs import WALLET_SEED
from constants import ReturningUser
from constants.wallet import WalletTransactions, WalletAddress
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
Expand All @@ -27,11 +28,11 @@ def keys_screen(main_window) -> KeysView:
@pytest.mark.case(704527)
@pytest.mark.transaction
@pytest.mark.parametrize('user_account', [ReturningUser(
seed_phrase=ReturningUsersData.WALLET_USER.value[0],
status_address=ReturningUsersData.WALLET_USER.value[1]
seed_phrase=WALLET_SEED.split(),
status_address='0x44ddd47a0c7681a5b0fa080a56cbb7701db4bb43'
)])
@pytest.mark.parametrize('receiver_account_address, amount, asset', [
pytest.param(ReturningUsersData.RETURNING_USER_ONE.value[1], 0, 'ETH')
pytest.param(WalletAddress.RECEIVER_ADDRESS.value, 0, 'ETH')
])
@pytest.mark.timeout(timeout=120)
def test_wallet_send_0_eth(keys_screen, main_window, user_account, receiver_account_address, amount, asset):
Expand Down
9 changes: 5 additions & 4 deletions test/e2e/tests/transactions_tests/test_wallet_send_nft.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import configs
import constants
import driver
from constants import ReturningUser, ReturningUsersData
from configs import WALLET_SEED
from constants import ReturningUser
from constants.wallet import WalletTransactions
from gui.components.onboarding.before_started_popup import BeforeStartedPopUp
from gui.components.onboarding.beta_consent_popup import BetaConsentPopup
Expand All @@ -28,11 +29,11 @@ def keys_screen(main_window) -> KeysView:
@pytest.mark.case(704602)
@pytest.mark.transaction
@pytest.mark.parametrize('user_account', [[ReturningUser(
seed_phrase=ReturningUsersData.WALLET_USER.value[0],
status_address=ReturningUsersData.WALLET_USER.value[1]
seed_phrase=WALLET_SEED.split(),
status_address='0x44ddd47a0c7681a5b0fa080a56cbb7701db4bb43'
)]])
@pytest.mark.parametrize('tab, receiver_account_address, amount, collectible', [
pytest.param('Collectibles', ReturningUsersData.WALLET_USER.value[1], 1, 'Panda')
pytest.param('Collectibles', '0x44ddd47a0c7681a5b0fa080a56cbb7701db4bb43', 1, 'Panda')
])
@pytest.mark.timeout(timeout=120)
@pytest.mark.skip(reason="https://github.com/status-im/status-desktop/issues/14862")
Expand Down