chore: use env var for sensitive information

This commit is contained in:
Anastasiya Semenkevich 2024-09-05 14:40:46 +03:00 committed by Anastasiya
parent fdb72e6fde
commit daad4e6d47
7 changed files with 25 additions and 44 deletions

View File

@ -21,6 +21,7 @@ if AUT_PATH is None:
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)

View File

@ -31,23 +31,6 @@ class ReturningUser(UserAccount):
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')
@ -55,7 +38,6 @@ 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)),

View File

@ -14,6 +14,10 @@ class DerivationPathName(Enum):
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"
@ -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))

View File

@ -3,10 +3,10 @@ import pytest
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
@ -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()

View File

@ -7,7 +7,8 @@ from allure_commons._allure import step
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
@ -30,8 +31,8 @@ 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
def test_mint_owner_and_tokenmaster_tokens(keys_screen, main_window, user_account):

View File

@ -4,8 +4,9 @@ from allure_commons._allure import step
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
@ -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):

View File

@ -5,7 +5,8 @@ from allure_commons._allure import step
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
@ -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")