chore(@onboarding_test): add verification for wallet address (#201)

This commit is contained in:
Anastasiya 2023-10-23 18:43:17 +03:00 committed by GitHub
parent 8c278b6052
commit 2258ecfd45
8 changed files with 42 additions and 12 deletions

View File

@ -1,27 +1,31 @@
import random
import string
from collections import namedtuple from collections import namedtuple
import configs import configs
UserAccount = namedtuple('User', ['name', 'password', 'seed_phrase']) UserAccount = namedtuple('User', ['name', 'password', 'seed_phrase', 'status_address'])
user_account_one = UserAccount('squisher', '0000000000', [ user_account_one = UserAccount('squisher', '0000000000', [
'rail', 'witness', 'era', 'asthma', 'empty', 'cheap', 'shed', 'pond', 'skate', 'amount', 'invite', 'year' 'rail', 'witness', 'era', 'asthma', 'empty', 'cheap', 'shed', 'pond', 'skate', 'amount', 'invite', 'year'
]) ], '0x3286c371ef648fe6232324b27ee0515f4ded24d9')
user_account_two = UserAccount('athletic', '0000000000', [ user_account_two = UserAccount('athletic', '0000000000', [
'measure', 'cube', 'cousin', 'debris', 'slam', 'ignore', 'seven', 'hat', 'satisfy', 'frown', 'casino', 'inflict' 'measure', 'cube', 'cousin', 'debris', 'slam', 'ignore', 'seven', 'hat', 'satisfy', 'frown', 'casino', 'inflict'
]) ], '0x99C096bB5F12bDe37DE9dbee8257Ebe2a5667C46')
user_account_three = UserAccount('nervous', '0000000000', []) user_account_three = UserAccount('nervous', '0000000000', [], '')
user_account_one_changed_password = UserAccount('squisher', 'NewPassword@12345', []) user_account_one_changed_password = UserAccount('squisher', 'NewPassword@12345', [], '')
user_account_one_changed_name = UserAccount('NewUserName', '0000000000', []) user_account_one_changed_name = UserAccount('NewUserName', '0000000000', [], '')
community_params = { community_params = {
'name': 'Name', 'name': 'Name',
'description': 'Description', 'description': 'Description',
'logo': {'fp': configs.testpath.TEST_FILES / 'tv_signal.png', 'zoom': None, 'shift': None}, 'logo': {'fp': configs.testpath.TEST_FILES / 'tv_signal.png', 'zoom': None, 'shift': None},
'banner': {'fp': configs.testpath.TEST_FILES / 'banner.png', 'zoom': None, 'shift': None}, 'banner': {'fp': configs.testpath.TEST_FILES / 'banner.png', 'zoom': None, 'shift': None},
'intro': 'Intro', 'intro': ''.join(random.choices(string.ascii_letters +
'outro': 'Outro' string.digits, k=200)),
'outro': ''.join(random.choices(string.ascii_letters +
string.digits, k=80))
} }
UserCommunityInfo = namedtuple('CommunityInfo', ['name', 'description', 'members', 'image']) UserCommunityInfo = namedtuple('CommunityInfo', ['name', 'description', 'members', 'image'])

View File

@ -72,6 +72,14 @@ walletAccountViewEditAccountButton = {"container": statusDesktop_mainWindow, "ob
walletAccountViewAccountName = {"container": statusDesktop_mainWindow, "objectName": "walletAccountViewAccountName", "type": "StatusBaseText"} walletAccountViewAccountName = {"container": statusDesktop_mainWindow, "objectName": "walletAccountViewAccountName", "type": "StatusBaseText"}
walletAccountViewAccountEmoji = {"container": statusDesktop_mainWindow, "objectName": "walletAccountViewAccountImage", "type": "StatusEmoji", "visible": True} walletAccountViewAccountEmoji = {"container": statusDesktop_mainWindow, "objectName": "walletAccountViewAccountImage", "type": "StatusEmoji", "visible": True}
walletAccountViewDeleteAccountButton = {"container": statusDesktop_mainWindow, "objectName": "deleteAccountButton", "type": "StatusButton"} walletAccountViewDeleteAccountButton = {"container": statusDesktop_mainWindow, "objectName": "deleteAccountButton", "type": "StatusButton"}
walletAccountViewDetailsLabel = {"container": settingsContentBase_ScrollView, "objectName": "AccountDetails_TextLabel", "type": "StatusBaseText"}
walletAccountViewBalance = {"container": settingsContentBase_ScrollView, "objectName": "Balance_ListItem", "type": "WalletAccountDetailsListItem"}
walletAccountViewAddress = {"container": settingsContentBase_ScrollView, "objectName": "Address_ListItem", "type": "WalletAccountDetailsListItem"}
walletAccountViewKeypairItem = {"container": settingsContentBase_ScrollView, "objectName": "KeyPair_Item", "type": "WalletAccountDetailsKeypairItem"}
walletAccountViewOrigin = {"container": settingsContentBase_ScrollView, "objectName": "Origin_ListItem", "type": "WalletAccountDetailsListItem"}
walletAccountViewDerivationPath = {"container": settingsContentBase_ScrollView, "objectName": "DerivationPath_ListItem", "type": "WalletAccountDetailsListItem"}
walletAccountViewStored = {"container": settingsContentBase_ScrollView, "objectName": "Stored_ListItem", "type": "WalletAccountDetailsListItem"}
walletAccountViewPreferredNetworks = {"container": settingsContentBase_ScrollView, "objectName": "PreferredNetworks_ListItem", "type": "StatusListItem"}
# Wallet edit network view # Wallet edit network view
settingsContentBaseScrollView_editPreviwTabBar_StatusTabBar = {"container": statusDesktop_mainWindow, "objectName": "editPreviwTabBar", "type": "StatusTabBar"} settingsContentBaseScrollView_editPreviwTabBar_StatusTabBar = {"container": statusDesktop_mainWindow, "objectName": "editPreviwTabBar", "type": "StatusTabBar"}

View File

@ -60,6 +60,14 @@ class AccountDetailsView(WalletSettingsView):
self._delete_account_button = Button('walletAccountViewDeleteAccountButton') self._delete_account_button = Button('walletAccountViewDeleteAccountButton')
self._wallet_account_title = TextLabel('walletAccountViewAccountName') self._wallet_account_title = TextLabel('walletAccountViewAccountName')
self._wallet_account_emoji = QObject('walletAccountViewAccountEmoji') self._wallet_account_emoji = QObject('walletAccountViewAccountEmoji')
self._wallet_account_details_label = TextLabel('walletAccountViewDetailsLabel')
self._wallet_account_balance = QObject('walletAccountViewBalance')
self._wallet_account_keypair_item = QObject('walletAccountViewKeypairItem')
self._wallet_account_address = QObject('walletAccountViewAddress')
self._wallet_account_origin = TextLabel('walletAccountViewOrigin')
self._wallet_account_derivation_path = QObject('walletAccountViewDerivationPath')
self._wallet_account_stored = TextLabel('walletAccountViewStored')
self._wallet_preferred_networks = QObject('walletAccountViewPreferredNetworks')
@allure.step('Click Edit button') @allure.step('Click Edit button')
def click_edit_account_button(self): def click_edit_account_button(self):
@ -74,6 +82,12 @@ class AccountDetailsView(WalletSettingsView):
def get_account_name_value(self): def get_account_name_value(self):
return self._wallet_account_title.text return self._wallet_account_title.text
@allure.step("Get account address value")
def get_account_address_value(self):
raw_value = str(self._wallet_account_address.get_object_attribute('subTitle'))
address = raw_value.split(">")[-1]
return address
@allure.step('Get account color value') @allure.step('Get account color value')
def get_account_color_value(self): def get_account_color_value(self):
color_name = str(self._wallet_account_title.get_object_attribute('color')['name']) color_name = str(self._wallet_account_title.get_object_attribute('color')['name'])

View File

@ -13,7 +13,6 @@ from gui.main_window import MainWindow
from gui.screens.community import CommunityScreen from gui.screens.community import CommunityScreen
from scripts.tools import image from scripts.tools import image
pytestmark = allure.suite("Communities")
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703084', 'Create community') @allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703084', 'Create community')

View File

@ -8,7 +8,6 @@ from constants.permissions import PermissionsElements
from gui.main_window import MainWindow from gui.main_window import MainWindow
from scripts.tools import image from scripts.tools import image
pytestmark = allure.suite("Communities")
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703198', @allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703198',

View File

@ -9,7 +9,6 @@ from constants.group_chat import GroupChatMessages
from gui.main_window import MainWindow from gui.main_window import MainWindow
from gui.screens.messages import MessagesScreen from gui.screens.messages import MessagesScreen
pytestmark = allure.suite("Messaging")
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703014', 'Create a group and send messages') @allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703014', 'Create a group and send messages')

View File

@ -46,6 +46,13 @@ def test_import_seed_phrase(aut: AUT, keys_screen, main_window, user_account, au
if not configs.DEV_BUILD: if not configs.DEV_BUILD:
BetaConsentPopup().confirm() BetaConsentPopup().confirm()
with (step('Verify that restored account reveals correct status wallet address')):
status_acc_view = (
main_window.left_panel.open_settings().left_panel.open_wallet_settings().open_status_account_in_settings())
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}"
with step('Verify that the user logged in via seed phrase correctly'): with step('Verify that the user logged in via seed phrase correctly'):
user_canvas = main_window.left_panel.open_user_canvas() user_canvas = main_window.left_panel.open_user_canvas()
profile_popup = user_canvas.open_profile_popup() profile_popup = user_canvas.open_profile_popup()

View File

@ -185,7 +185,7 @@ def test_private_key_imported_account(main_screen: MainWindow, user_account,
name: str, color: str, emoji: str, emoji_unicode: str, name: str, color: str, emoji: str, emoji_unicode: str,
new_name: str, new_color: str, new_emoji: str, new_emoji_unicode: str, new_name: str, new_color: str, new_emoji: str, new_emoji_unicode: str,
private_key: str): private_key: str):
with step('Create generated wallet account'): with step('Import an account within private key'):
wallet = main_screen.left_panel.open_wallet() wallet = main_screen.left_panel.open_wallet()
SigningPhrasePopup().wait_until_appears().confirm_phrase() SigningPhrasePopup().wait_until_appears().confirm_phrase()
account_popup = wallet.left_panel.open_add_account_popup() account_popup = wallet.left_panel.open_add_account_popup()