chore: keycard tests fixed, improved and other tests fixed accordingly (#15656)

This commit is contained in:
Valentina1133 2024-07-19 13:43:44 +07:00 committed by GitHub
parent 2501e04ccb
commit e1611cbc83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
20 changed files with 336 additions and 371 deletions

View File

@ -2,8 +2,8 @@ from enum import Enum
class Keycard(Enum):
KEYCARD_PIN = '111111'
KEYCARD_INCORRECT_PIN = '222222'
KEYCARD_PIN = '1'
KEYCARD_INCORRECT_PIN = '2'
KEYCARD_CORRECT_PUK = '111111111111'
KEYCARD_INCORRECT_PUK = '222222222222'
KEYCARD_NAME = 'Test Keycard'

View File

@ -13,7 +13,7 @@ class AuthenticatePopup(BasePopup):
def __init__(self):
super().__init__()
self._authenticate_popup_content = QObject(names.keycardSharedPopupContent_KeycardPopupContent)
self._password_text_edit = TextEdit(names.sharedPopup_Password_Input)
self._password_text_edit = TextEdit(names.password_PlaceholderText)
self._authenticate_button = Button(names.authenticate_StatusButton)
self._primary_button = Button(names.sharedPopup_Primary_Button)
self._close_button = Button(names.headerCloseButton_StatusFlatRoundButton)
@ -27,7 +27,7 @@ class AuthenticatePopup(BasePopup):
def authenticate(self, password: str):
self._password_text_edit.type_text(password)
# TODO https://github.com/status-im/status-desktop/issues/15345
self._authenticate_button.click(timeout=10)
self._primary_button.click(timeout=10)
self._authenticate_button.wait_until_hidden(10000)
@allure.step('Check if authenticate button is present')

View File

@ -54,7 +54,7 @@ class KeycardPopup(BasePopup):
@property
@allure.step('Get keycard popup header')
def keycard_header(self) -> str:
return self._keycard_popup_header.text
return str(self._keycard_popup_header.text)
@property
@allure.step('Get keycard instructions')
@ -102,7 +102,7 @@ class KeycardPopup(BasePopup):
@property
@allure.step('Get account name in keypair')
def keypair_account_name(self) -> str:
return self._keypair_tag.object.title
return str(self._keypair_tag.object.title)
@property
@allure.step('Get account color in keypair')
@ -136,6 +136,7 @@ class KeycardPopup(BasePopup):
@allure.step('Set pin')
def input_pin_or_puk(self, pin):
for i in range(7):
driver.nativeType(pin)
@allure.step('Click Next button')
@ -242,7 +243,7 @@ class KeycardPopup(BasePopup):
else:
raise RuntimeError("Wrong amount of seed words", len(seed_phrase_words))
for count, word in enumerate(seed_phrase_words, start=1):
self._seed_phrase_word_text_edit.real_name['objectName'] = f'statusSeedPhraseInputField{count}'
self._seed_phrase_word_text_edit.real_name['objectName'] = f'enterSeedPhraseInputField{count}'
self._seed_phrase_word_text_edit.text = word
self.click_next()

View File

@ -157,8 +157,7 @@ class AccountPopup(BasePopup):
self._origin_combobox.click()
self.click_new_master_key()
self._use_keycard_button.click()
assert KeycardSettingsView().exists, 'Keycard settings view was not opened'
return KeycardSettingsView()
return KeycardSettingsView().wait_until_appears(), 'Keycard settings view was not opened'
@allure.step('Click confirmation (add account / save changes) button')
def save_changes(self):

View File

@ -143,6 +143,7 @@ class LeftPanel(QObject):
self._settings_button.click()
time.sleep(0.5)
try:
SettingsScreen().left_panel.wait_until_appears()
return SettingsScreen()
except Exception as ex:
if attempts:

View File

@ -33,13 +33,14 @@ class MockedKeycardController(Window):
self._max_slots_reached_item = QObject(names.max_Pairing_Slots_Reached_StatusMenuItem)
self._mnemonic_metadata_item = QObject(names.keycard_With_Mnemonic_Metadata_StatusMenuItem)
self._field_object = QObject(names.keycard_edit_TextEdit)
self._scroll = Scroll(names.keycardFlickable)
self._scroll = Scroll(names.keycardSettingsTab)
self._scroll_flick = Scroll(names.keycardFlickable)
def wait_until_appears(self, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC):
driver.waitFor(lambda: self._plugin_reader_button.exists, timeout_msec)
return self
@property
@allure.step('Get text fields')
def get_text_fields(self) -> typing.List[str]:
return driver.findAllObjects(self._field_object.real_name)
@ -54,8 +55,7 @@ class MockedKeycardController(Window):
@allure.step('Click Register keycard')
def register_keycard(self):
time.sleep(1)
if not self._register_keycard_button.is_visible:
self._scroll.vertical_down_to(self._register_keycard_button)
self._scroll_flick.vertical_down_to(self._register_keycard_button)
self._register_keycard_button.click()
time.sleep(1)
return self
@ -64,7 +64,7 @@ class MockedKeycardController(Window):
def remove_keycard(self):
time.sleep(1)
if not self._remove_keycard_button.is_visible:
self._scroll.vertical_down_to(self._remove_keycard_button)
self._scroll.vertical_scroll_down(self._remove_keycard_button)
self._remove_keycard_button.click()
time.sleep(1)
return self
@ -86,10 +86,12 @@ class MockedKeycardController(Window):
@allure.step('Input custom keycard details to custom text field')
def input_custom_keycard_details(self, details: str, index: int):
fields = self.get_text_fields
fields = self.get_text_fields()
self._scroll.vertical_scroll_down(QObject(real_name=driver.objectMap.realName(fields[index])))
driver.type(fields[index], details)
driver.waitFor(lambda: fields[index].text != '', configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
time.sleep(1)
return self
@allure.step('Choose not Status keycard from initial keycard state dropdown')
def choose_not_status_keycard(self):

View File

@ -481,11 +481,11 @@ o_KeyPairItem = {"container": statusDesktop_mainWindow_overlay, "type": "KeyPair
o_KeyPairUnknownItem = {"container": statusDesktop_mainWindow_overlay, "type": "KeyPairUnknownItem", "unnamed": 1, "visible": True}
o_StatusListItemTag = {"container": statusDesktop_mainWindow_overlay, "type": "StatusListItemTag", "unnamed": 1, "visible": True}
radioButton_StatusRadioButton = {"checkable": True, "container": statusDesktop_mainWindow_overlay, "id": "radioButton", "type": "StatusRadioButton", "unnamed": 1, "visible": True}
statusSeedPhraseInputField_TextEdit = {"container": statusDesktop_mainWindow_overlay, "objectName": "statusSeedPhraseInputField", "type": "TextEdit", "visible": True}
switchTabBar_StatusSwitchTabBar = {"container": statusDesktop_mainWindow_overlay, "id": "switchTabBar", "type": "StatusSwitchTabBar", "unnamed": 1, "visible": True}
switchTabBar_12_words_StatusSwitchTabButton = {"checkable": True, "container": switchTabBar_StatusSwitchTabBar, "objectName": "12SeedButton", "text": "12 words", "type": "StatusSwitchTabButton", "visible": True}
switchTabBar_18_words_StatusSwitchTabButton = {"checkable": True, "container": switchTabBar_StatusSwitchTabBar, "objectName": "18SeedButton", "text": "18 words", "type": "StatusSwitchTabButton", "visible": True}
switchTabBar_24_words_StatusSwitchTabButton = {"checkable": True, "container": switchTabBar_StatusSwitchTabBar, "objectName": "24SeedButton", "text": "24 words", "type": "StatusSwitchTabButton", "visible": True}
statusSeedPhraseInputField_TextEdit = {"container": statusDesktop_mainWindow_overlay, "objectName": "enterSeedPhraseInputField", "type": "TextEdit", "visible": True}
switchTabBar_StatusSwitchTabBar = {"container": statusDesktop_mainWindow_overlay, "objectName": "enterSeedPhraseSwitchBar", "type": "StatusSwitchTabBar", "visible": True}
switchTabBar_12_words_StatusSwitchTabButton = {"checkable": True, "container": switchTabBar_StatusSwitchTabBar, "objectName": "12SeedButton", "type": "StatusSwitchTabButton", "visible": True}
switchTabBar_18_words_StatusSwitchTabButton = {"checkable": True, "container": switchTabBar_StatusSwitchTabBar, "objectName": "18SeedButton", "type": "StatusSwitchTabButton", "visible": True}
switchTabBar_24_words_StatusSwitchTabButton = {"checkable": True, "container": switchTabBar_StatusSwitchTabBar, "objectName": "24SeedButton", "type": "StatusSwitchTabButton", "visible": True}
i_understand_the_key_pair_on_this_Keycard_will_be_deleted_StatusCheckBox = {"checkable": True, "container": statusDesktop_mainWindow_overlay, "id": "confirmation", "type": "StatusCheckBox", "visible": True}
statusSmartIdenticonLetter_StatusLetterIdenticon = {"container": statusDesktop_mainWindow_overlay, "objectName": "statusSmartIdenticonLetter", "type": "StatusLetterIdenticon", "visible": True}
secondary_StatusButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "id": "secondaryButton", "type": "StatusButton", "unnamed": 1, "visible": True}

View File

@ -42,6 +42,7 @@ arrow_icon_StatusIcon = {"container": statusDesktop_mainWindow_overlay, "objectN
collectible_item = {"container": mainWindow_RightTabView, "type": "CollectibleView", "unnamed": 1, "visible": True}
mainWindow_settingsContentBaseScrollView_StatusScrollView_general = {"container": statusDesktop_mainWindow, "objectName": "settingsContentBaseScrollView", "type": "StatusScrollView", "visible": True}
settingsContentBaseScrollView_manageTokensDelegate_ManageTokensDelegate = {"container": mainWindow_settingsContentBaseScrollView_StatusScrollView_general, "objectName": RegularExpression("manageTokensDelegate-*"), "type": "ManageTokensDelegate", "visible": True}
tabBar_Assets_StatusTabButton = {"checkable": True, "container": mainWindow_settingsContentBaseScrollView_StatusScrollView_general, "objectName": "assetsButton", "type": "StatusTabButton", "unnamed": 1, "visible": True}
mainWindow_Save_and_apply_StatusButton = {"checkable": False, "container": statusDesktop_mainWindow, "objectName": "settingsDirtyToastMessageSaveButton", "text": "Save and apply", "type": "StatusButton", "visible": True}
mainWindow_Save_StatusFlatButton = {"checkable": False, "container": statusDesktop_mainWindow, "id": "saveForLaterButton", "text": "Save", "type": "StatusFlatButton", "unnamed": 1, "visible": True}

View File

@ -3,6 +3,7 @@ import time
import allure
import configs.system
import driver
from gui.components.back_up_your_seed_phrase_popup import BackUpYourSeedPhrasePopUp
from gui.elements.object import QObject
from gui.elements.scroll import Scroll
@ -48,6 +49,11 @@ class LeftPanel(QObject):
self.settings_section_back_up_seed_option = QObject(settings_names.settingsBackUpSeedPhraseOption)
self._settings_section_wallet_option = QObject(settings_names.settingsWalletOption)
@allure.step('Wait until appears {0}')
def wait_until_appears(self, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC):
self._settings_section_template.wait_until_appears(timeout_msec)
return self
def _open_settings(self, object_name: str):
self._settings_section_template.real_name['objectName'] = object_name
if not self._settings_section_template.is_visible:
@ -57,7 +63,7 @@ class LeftPanel(QObject):
@allure.step('Open messaging settings')
@handle_settings_opening(MessagingSettingsView, '4-AppMenuItem')
def open_messaging_settings(self, click_attempts: int = 2) -> 'MessagingSettingsView':
assert MessagingSettingsView().exists, 'Messaging settings view was not opened'
assert MessagingSettingsView().wait_until_appears(), 'Messaging settings view was not opened'
return MessagingSettingsView()
@allure.step('Open communities settings')
@ -69,7 +75,7 @@ class LeftPanel(QObject):
@allure.step('Open wallet settings')
@handle_settings_opening(WalletSettingsView, '5-AppMenuItem')
def open_wallet_settings(self, click_attempts: int = 2) -> 'WalletSettingsView':
assert WalletSettingsView().exists, 'Wallet settings view was not opened'
assert WalletSettingsView().wait_until_appears(), 'Wallet settings view was not opened'
return WalletSettingsView()
@allure.step('Open profile settings')
@ -105,7 +111,7 @@ class LeftPanel(QObject):
@allure.step('Open keycard settings')
@handle_settings_opening(KeycardSettingsView, '14-MainMenuItem')
def open_keycard_settings(self, click_attempts: int = 2) -> 'KeycardSettingsView':
assert KeycardSettingsView().exists, 'Keycard settings view was not opened'
assert KeycardSettingsView().wait_until_appears(), f'Keycard settings view was not opened'
return KeycardSettingsView()
@allure.step('Open ENS usernames settings')

View File

@ -21,6 +21,11 @@ class KeycardSettingsView(QObject):
self._check_whats_on_keycard_button = Button(settings_names.checkWhatsNewKeycard_StatusListItem)
self._factory_reset_keycard_button = Button(settings_names.factoryResetKeycard_StatusListItem)
@allure.step('Wait until appears {0}')
def wait_until_appears(self, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC):
self._create_new_keycard_account_button.wait_until_appears(timeout_msec)
return self
@allure.step('Check that keycard screen displayed')
def check_keycard_screen_loaded(self):
assert KeycardSettingsView().is_visible
@ -32,21 +37,25 @@ class KeycardSettingsView(QObject):
@allure.step('Choose import or restore keycard via seed phrase')
def click_import_restore_via_seed_phrase(self):
self._scroll.vertical_scroll_down(self._import_restore_via_seed_phrase_button)
self._import_restore_via_seed_phrase_button.click()
return KeycardPopup().wait_until_appears()
@allure.step('Choose setup keycard with an existing account')
def click_setup_keycard_with_existing_account(self):
self._scroll.vertical_scroll_down(self._setup_keycard_with_existing_account_button)
self._setup_keycard_with_existing_account_button.click()
return KeycardPopup().wait_until_appears()
@allure.step('Choose check whats on keycard')
def click_check_whats_on_keycard(self):
self._scroll.vertical_scroll_down(self._check_whats_on_keycard_button)
self._check_whats_on_keycard_button.click()
return KeycardPopup().wait_until_appears()
@allure.step('Choose factory reset a keycard')
def click_factory_reset_keycard(self):
self._scroll.vertical_scroll_down(self._factory_reset_keycard_button)
self._factory_reset_keycard_button.click()
return KeycardPopup().wait_until_appears()
@ -58,6 +67,7 @@ class KeycardSettingsView(QObject):
self._scroll.vertical_scroll_down(self._import_from_keycard_button)
assert driver.waitFor(lambda: self._import_from_keycard_button.is_visible,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), f'Import keycard button not visible'
self._scroll.vertical_scroll_down(self._check_whats_on_keycard_button)
assert driver.waitFor(lambda: self._check_whats_on_keycard_button.is_visible,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), f'Check whats new keycard button not visible'
self._scroll.vertical_scroll_down(self._factory_reset_keycard_button)

View File

@ -28,6 +28,11 @@ class MessagingSettingsView(QObject):
self._always_show_button = Button(settings_names.always_show_radioButton_StatusRadioButton)
self._never_ask_button = Button(settings_names.never_show_radioButton_StatusRadioButton)
@allure.step('Wait until appears {0}')
def wait_until_appears(self, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC):
self._contacts_button.wait_until_appears(timeout_msec)
return self
@allure.step('Open contacts settings')
def open_contacts_settings(self) -> 'ContactsSettingsView':
self._contacts_button.click()

View File

@ -44,6 +44,11 @@ class WalletSettingsView(QObject):
self._wallet_settings_total_balance_toggle = CheckBox(settings_names.settingsWalletAccountTotalBalanceToggle)
self._rename_keypair_menu_item = QObject(settings_names.rename_keypair_StatusMenuItem)
@allure.step('Wait until appears {0}')
def wait_until_appears(self, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC):
self._wallet_settings_add_new_account_button.wait_until_appears(timeout_msec)
return self
@allure.step('Open add account pop up in wallet settings')
def open_add_account_pop_up(self, attempts: int = 2) -> 'AccountPopup':
self._wallet_settings_add_new_account_button.click()
@ -89,9 +94,15 @@ class WalletSettingsView(QObject):
raise err
@allure.step('Open account order in wallet settings')
def open_account_order(self):
def open_account_order(self, attempts: int = 2):
self._account_order_button.click()
try:
return EditAccountOrderSettings().wait_until_appears()
except Exception as err:
if attempts:
return self.open_account_order(attempts - 1)
else:
raise err
@allure.step('Get keypair settings_names')
def get_keypairs_names(self):
@ -157,6 +168,11 @@ class AccountDetailsView(WalletSettingsView):
self._wallet_account_stored = TextLabel(settings_names.walletAccountViewStored)
self._wallet_preferred_networks = QObject(settings_names.walletAccountViewPreferredNetworks)
@allure.step('Wait until appears {0}')
def wait_until_appears(self, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC):
self._edit_account_button.wait_until_appears(timeout_msec)
return self
@allure.step('Click Edit button')
def click_edit_account_button(self):
self._edit_account_button.click()
@ -229,6 +245,11 @@ class SavedAddressesWalletSettings(WalletSettingsView):
self.add_new_address_button = Button(settings_names.settings_Wallet_SavedAddresses_AddAddressButton)
self.saved_address_item = QObject(settings_names.settings_Wallet_SavedAddress_ItemDelegate)
@allure.step('Wait until appears {0}')
def wait_until_appears(self, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC):
self.add_new_address_button.wait_until_appears(timeout_msec)
return self
@allure.step('Click add new address button')
def open_add_saved_address_popup(self, attempt: int = 2) -> 'AddressPopup':
self.add_new_address_button.click()
@ -335,6 +356,11 @@ class EditNetworkSettings(WalletSettingsView):
self._network_edit_view_back_button.click()
return NetworkWalletSettings().wait_until_appears()
@allure.step('Wait until appears {0}')
def wait_until_appears(self, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC):
self._live_network_tab.wait_until_appears(timeout_msec)
return self
@allure.step('Select Live Network tab')
def click_live_network_tab(self):
self._live_network_tab.click()
@ -521,6 +547,11 @@ class EditAccountOrderSettings(WalletSettingsView):
self._text_item = QObject(settings_names.settingsContentBaseScrollView_StatusBaseText)
self._back_button = Button(settings_names.main_toolBar_back_button)
@allure.step('Wait until appears {0}')
def wait_until_appears(self, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC):
self._account_item.wait_until_appears(timeout_msec)
return self
@property
@allure.step('Get edit account order recommendations')
def account_recommendations(self):
@ -580,6 +611,12 @@ class ManageTokensSettingsView(WalletSettingsView):
super(ManageTokensSettingsView, self).__init__()
self._window_item = QObject(wallet_names.statusDesktop_mainWindow)
self._token_item = QObject(wallet_names.settingsContentBaseScrollView_manageTokensDelegate_ManageTokensDelegate)
self._assets_button = Button(wallet_names.tabBar_Assets_StatusTabButton)
@allure.step('Wait until appears {0}')
def wait_until_appears(self, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC):
self._assets_button.wait_until_appears(timeout_msec)
return self
@property
@allure.step('Get tokens')

View File

@ -8,7 +8,6 @@ from . import marks
import configs
import constants
import driver
from constants import aut_options
from constants.images_paths import PLUG_IN_KEYCARD_IMAGE_PATH, INSERT_KEYCARD_IMAGE_PATH, EMPTY_KEYCARD_IMAGE_PATH, \
KEYCARD_SUCCESS_IMAGE_PATH, KEYCARD_INSERTED_IMAGE_PATH
from constants.keycard import Keycard
@ -17,132 +16,110 @@ from gui.mocked_keycard_controller import MockedKeycardController
pytestmark = marks
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703627', 'Check whats on a Keycard')
@pytest.mark.case(703627)
@pytest.mark.parametrize('user_account', [constants.user.user_account_one])
@pytest.mark.skip(reason="https://github.com/status-im/desktop-qa-automation/issues/274")
def test_check_whats_on_keycard(main_screen: MainWindow, user_account):
main_screen.prepare()
timeout = configs.timeouts.UI_LOAD_TIMEOUT_MSEC
pin = Keycard.KEYCARD_PIN.value
keycard_name = 'Card-1 Name'
with step('Choose option Check whats on keycard in settings'):
keycard_settings = main_screen.left_panel.open_settings().left_panel.open_keycard_settings()
keycard_popup = keycard_settings.click_check_whats_on_keycard()
with step('Verify displayed keycard popup instructions are correct'):
assert Keycard.KEYCARD_INSTRUCTIONS_PLUG_IN.value in keycard_popup.keycard_instructions, \
"There is no correct keycard instruction"
with step('Keycard welcome image source path is correct'):
assert PLUG_IN_KEYCARD_IMAGE_PATH == keycard_popup.keycard_image_source_path
with step('Verify displayed keycard popup instructions and welcome image source path are correct'):
actual_instructions = keycard_popup.keycard_instructions
actual_image_path = keycard_popup.keycard_image_source_path
assert Keycard.KEYCARD_INSTRUCTIONS_PLUG_IN.value in actual_instructions, f"There is no correct keycard instruction in {actual_instructions}"
assert PLUG_IN_KEYCARD_IMAGE_PATH == actual_image_path, f"Image path {actual_image_path} is wrong"
with step('Plug in reader'):
main_screen.hide()
keycard_controller = MockedKeycardController().wait_until_appears()
keycard_controller.plugin_reader()
keycard_controller = MockedKeycardController().wait_until_appears().plugin_reader()
main_screen.show()
with step('Verify displayed keycard popup instructions are correct'):
with step('Verify displayed keycard popup instructions and image source path are correct'):
assert driver.waitFor(
lambda: Keycard.KEYCARD_INSTRUCTIONS_INSERT_KEYCARD.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
with step('Keycard image source path is correct'):
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
time.sleep(2)
assert INSERT_KEYCARD_IMAGE_PATH == keycard_popup.keycard_image_source_path
actual_image_path = keycard_popup.keycard_image_source_path
assert INSERT_KEYCARD_IMAGE_PATH == actual_image_path, f"Image path {actual_image_path} is wrong"
with step('Register and insert not status keycard'):
main_screen.hide()
keycard_controller.choose_not_status_keycard()
keycard_controller.register_keycard()
keycard_controller.insert_keycard_1()
keycard_controller.choose_not_status_keycard().register_keycard().insert_keycard_1()
main_screen.show()
with step('Verify keycard is not recognized'):
assert driver.waitFor(lambda: Keycard.KEYCARD_NOT.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
assert driver.waitFor(lambda: Keycard.KEYCARD_NOT_RECOGNIZED_NOTE.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), f"There is no correct keycard instruction {keycard_popup.keycard_instructions}"
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
with step('Close keycard popup'):
keycard_popup.cancel()
with step('Insert empty keycard'):
main_screen.hide()
keycard_controller.choose_empty_keycard()
keycard_controller.register_keycard()
keycard_controller.insert_keycard_1()
keycard_controller.choose_empty_keycard().register_keycard().insert_keycard_1()
main_screen.show()
with step('Check what is on keycard'):
with step('Verify keycard is empty and image source path is correct'):
keycard_popup = keycard_settings.click_check_whats_on_keycard()
with step('Verify keycard is empty'):
assert driver.waitFor(lambda: Keycard.KEYCARD_EMPTY.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
assert driver.waitFor(lambda: Keycard.KEYCARD_NO_KEYPAIR.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
with step('Keycard image source path is correct'):
assert EMPTY_KEYCARD_IMAGE_PATH == keycard_popup.keycard_image_source_path
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
actual_image_path = keycard_popup.keycard_image_source_path
assert EMPTY_KEYCARD_IMAGE_PATH == actual_image_path, f"Image path {actual_image_path} is wrong"
with step('Close keycard popup'):
keycard_popup.click_next()
with step('Insert locked keycard'):
main_screen.hide()
keycard_controller.choose_max_slots_reached_keycard()
keycard_controller.register_keycard()
keycard_controller.insert_keycard_1()
keycard_controller.choose_max_slots_reached_keycard().register_keycard().insert_keycard_1()
main_screen.show()
with step('Check what is on keycard'):
keycard_popup = keycard_settings.click_check_whats_on_keycard()
with step('Verify keycard is locked'):
keycard_popup = keycard_settings.click_check_whats_on_keycard()
assert driver.waitFor(lambda: Keycard.KEYCARD_LOCKED.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
assert driver.waitFor(lambda: Keycard.KEYCARD_LOCKED_NOTE.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
with step('Close keycard popup'):
keycard_popup.cancel()
with step('Remove keycard and insert keycard with accounts on it'):
with (step('Remove keycard and insert keycard with accounts on it')):
main_screen.hide()
keycard_controller.remove_keycard()
keycard_controller.choose_mnemonic_metadata_keycard()
keycard_controller.register_keycard()
keycard_controller.insert_keycard_1()
keycard_controller.choose_mnemonic_metadata_keycard().register_keycard().insert_keycard_1()
main_screen.show()
with step('Check what is on keycard'):
with step('Enter PIN and repeat PIN and verify keycard popup instructions and image source path are correct'):
keycard_popup = keycard_settings.click_check_whats_on_keycard()
with step('Insert PIN and repeat PIN and verify keycard popup instructions are correct'):
with step('Verify that asked to choose PIN'):
assert driver.waitFor(lambda: Keycard.KEYCARD_ENTER_PIN.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
pin = Keycard.KEYCARD_PIN.value
keycard_name = 'Card-1 Name'
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
keycard_popup.input_pin_or_puk(pin)
assert driver.waitFor(lambda: Keycard.KEYCARD_PIN_VERIFIED.value in keycard_popup.keycard_instructions), \
"There is no correct keycard instruction"
assert driver.waitFor(lambda: Keycard.KEYCARD_PIN_VERIFIED.value in keycard_popup.keycard_instructions,
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
with step('Keycard image source path is correct'):
time.sleep(2)
assert KEYCARD_SUCCESS_IMAGE_PATH == keycard_popup.keycard_image_source_path
actual_image_path = keycard_popup.keycard_image_source_path
assert KEYCARD_SUCCESS_IMAGE_PATH == actual_image_path, f"Image path {actual_image_path} is wrong"
with step('Close keycard popup'):
with step('Click next and verify keycard image source path is correct'):
keycard_popup.click_next()
with step('Keycard image source path is correct'):
assert KEYCARD_INSERTED_IMAGE_PATH == keycard_popup.keycard_image_source_path
actual_image_path = keycard_popup.keycard_image_source_path
assert KEYCARD_INSERTED_IMAGE_PATH == actual_image_path, f"Image path {actual_image_path} is wrong"
with step('Verify that preview shows correct keycard and instructions are correct'):
assert driver.waitFor(lambda: Keycard.KEYCARD_ACCOUNTS.value in keycard_popup.keycard_instructions), \
assert driver.waitFor(lambda: Keycard.KEYCARD_ACCOUNTS.value in keycard_popup.keycard_instructions, timeout), \
"There is no correct keycard instruction"
assert keycard_popup.keypair_on_keycard_name == keycard_name, "Keycard name in preview is incorrect"
with step('Close keycard popup'):
keycard_popup.click_next()
keypair_on_keycard = keycard_popup.keypair_on_keycard_name
assert keypair_on_keycard == keycard_name, f"Keycard name in preview {keypair_on_keycard} is incorrect"

View File

@ -7,7 +7,6 @@ from . import marks
import configs
import driver
from constants import aut_options
from constants.images_paths import PLUG_IN_KEYCARD_IMAGE_PATH, INSERT_KEYCARD_IMAGE_PATH, CHOOSE_KEYCARD_PIN_IMAGE_PATH
from constants.keycard import Keycard
from gui.main_window import MainWindow
@ -15,77 +14,69 @@ from gui.mocked_keycard_controller import MockedKeycardController
pytestmark = marks
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703624',
'Create a new keycard account with a new seed phrase')
@pytest.mark.case(703624)
@pytest.mark.parametrize(
'name, color, emoji_name, emoji, name1, color1, emoji1_name, emoji1, name2, color2, emoji2_name, emoji2',
[
pytest.param('Test Account', '#216266', 'sunglasses', '😎 ', 'Test Account2', '#2a4af5',
[pytest.param('Test Account', '#216266', 'sunglasses', '😎 ', 'Test Account2', '#2a4af5',
'thumbsup', '👍 ', 'Test Account3', '#ff7d46', 'cool', '🆒 ')
])
@pytest.mark.skip(reason="https://github.com/status-im/desktop-qa-automation/issues/274")
def test_create_keycard_account_with_new_seed_phrase(main_screen: MainWindow, name, color, emoji_name, emoji,
name1, color1, emoji1_name, emoji1, name2, color2, emoji2_name,
emoji2):
def test_create_keycard_account_with_new_seed_phrase(main_screen: MainWindow, name, color, emoji_name, emoji, name1,
color1, emoji1_name, emoji1, name2, color2, emoji2_name, emoji2):
timeout = configs.timeouts.UI_LOAD_TIMEOUT_MSEC
pin = Keycard.KEYCARD_PIN.value
keycard_name = Keycard.KEYCARD_NAME.value
with step('Choose option Create a new Keycard account with a new seed phrase in settings'):
main_screen.prepare()
keycard_settings = main_screen.left_panel.open_settings().left_panel.open_keycard_settings()
keycard_popup = keycard_settings.click_create_new_account_with_new_seed_phrase()
with step('Verify displayed keycard popup instructions are correct'):
with step('Verify header is correct'):
assert keycard_popup.keycard_header == Keycard.KEYCARD_POPUP_HEADER_CREATE_SEED.value, "The header is incorrect"
with step('Verify instructions are correct'):
assert Keycard.KEYCARD_INSTRUCTIONS_PLUG_IN.value in keycard_popup.keycard_instructions, \
"There is no correct keycard instruction"
with step('Keycard welcome image source path is correct'):
assert PLUG_IN_KEYCARD_IMAGE_PATH == keycard_popup.keycard_image_source_path
with step('Verify displayed header, popup instructions and image source path are correct'):
actual_instructions = keycard_popup.keycard_instructions
actual_image_path = keycard_popup.keycard_image_source_path
actual_header_title = keycard_popup.keycard_header
assert actual_header_title == Keycard.KEYCARD_POPUP_HEADER_CREATE_SEED.value, f"The header {actual_header_title} is incorrect"
assert Keycard.KEYCARD_INSTRUCTIONS_PLUG_IN.value in actual_instructions, f"There is no correct keycard instruction in {actual_instructions}"
assert PLUG_IN_KEYCARD_IMAGE_PATH == actual_image_path, f"Image path {actual_image_path} is wrong"
with step('Plug in reader'):
main_screen.hide()
keycard_controller = MockedKeycardController().wait_until_appears()
keycard_controller.plugin_reader()
keycard_controller = MockedKeycardController().wait_until_appears().plugin_reader()
main_screen.show()
with step('Verify displayed keycard popup instructions are correct'):
with step('Verify displayed keycard popup instructions and image source path are correct'):
assert driver.waitFor(
lambda: Keycard.KEYCARD_INSTRUCTIONS_INSERT_KEYCARD.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
with step('Keycard image source path is correct'):
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
time.sleep(2)
assert INSERT_KEYCARD_IMAGE_PATH == keycard_popup.keycard_image_source_path
actual_image_path = keycard_popup.keycard_image_source_path
assert INSERT_KEYCARD_IMAGE_PATH == actual_image_path, f"Image path {actual_image_path} is wrong"
with step('Register and insert keycard'):
main_screen.hide()
keycard_controller.register_keycard()
keycard_controller.insert_keycard_1()
keycard_controller.register_keycard().insert_keycard_1()
main_screen.show()
with step('Verify displayed keycard popup instructions and image are correct'):
with step('Verify keycard is recognized'):
assert driver.waitFor(lambda: Keycard.KEYCARD_RECOGNIZED.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
with step('Verify that asked to choose PIN'):
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
assert driver.waitFor(lambda: Keycard.KEYCARD_CHOOSE_PIN.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
assert Keycard.KEYCARD_PIN_NOTE.value in keycard_popup.keycard_instructions
with step('Keycard image source path is correct'):
assert CHOOSE_KEYCARD_PIN_IMAGE_PATH == keycard_popup.keycard_image_source_path
actual_image_path = keycard_popup.keycard_image_source_path
assert CHOOSE_KEYCARD_PIN_IMAGE_PATH == actual_image_path, f"Image path {actual_image_path} is wrong"
with step('Enter and repeat PIN and verify keycard popup instructions are correct'):
pin = Keycard.KEYCARD_PIN.value
keycard_popup.input_pin_or_puk(pin)
assert driver.waitFor(lambda: Keycard.KEYCARD_REPEAT_PIN.value in keycard_popup.keycard_instructions), \
"There is no correct keycard instruction"
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
keycard_popup.input_pin_or_puk(pin)
assert driver.waitFor(lambda: Keycard.KEYCARD_PIN_SET.value in keycard_popup.keycard_instructions), \
"There is no correct keycard instruction"
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
with step('Create keycard and first keycard account using new seed phrase'):
keycard_name = Keycard.KEYCARD_NAME.value
keycard_popup.confirm_seed_phrase().name_keycard(keycard_name).name_account(name).set_color(color).set_emoji(
emoji_name)
@ -95,18 +86,14 @@ def test_create_keycard_account_with_new_seed_phrase(main_screen: MainWindow, na
assert keycard_popup.account_tags[0].icon_color == color
assert keycard_popup.account_tags[0].icon_emoji == emoji
with step('Add second keycard account'):
with step('Add second keycard account and verify account details on account tags are correct'):
keycard_popup.add_account().name_account(name1).set_emoji(emoji1_name).set_color(color1)
with step('Verify second account details on account tags are correct'):
assert keycard_popup.account_tags[1].name == name1
assert keycard_popup.account_tags[1].icon_color == color1
assert keycard_popup.account_tags[1].icon_emoji == emoji1
with step('Add third keycard account'):
with step('Add third keycard account and verify third account details on account tags are correct'):
keycard_popup.add_account().name_account(name2).set_emoji(emoji2_name).set_color(color2)
with step('Verify third account details on account tags are correct'):
assert keycard_popup.account_tags[2].name == name2
assert keycard_popup.account_tags[2].icon_color == color2
assert keycard_popup.account_tags[2].icon_emoji == emoji2
@ -116,7 +103,7 @@ def test_create_keycard_account_with_new_seed_phrase(main_screen: MainWindow, na
with step('Verify that keycard instructions are correct'):
assert driver.waitFor(lambda: Keycard.KEYCARD_NEW_ACCOUNT_CREATED.value in keycard_popup.keycard_instructions), \
"There is no correct keycard instruction"
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
with step('Go to wallet settings and verify accounts and account details are correct'):
account_order = main_screen.left_panel.open_settings().left_panel.open_wallet_settings().open_account_order()
@ -132,4 +119,3 @@ def test_create_keycard_account_with_new_seed_phrase(main_screen: MainWindow, na
assert account_order.accounts[3].name == name2
assert account_order.accounts[3].icon_color == color2
assert account_order.accounts[3].icon_emoji == emoji2

View File

@ -6,7 +6,6 @@ from . import marks
import configs
import constants
import driver
from constants import aut_options
from constants.images_paths import KEYCARD_ERROR_IMAGE_PATH
from constants.keycard import Keycard
from gui.main_window import MainWindow
@ -14,126 +13,113 @@ from gui.mocked_keycard_controller import MockedKeycardController
pytestmark = marks
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703628', 'Factory reset a Keycard')
@pytest.mark.case(703628)
@pytest.mark.parametrize('user_account', [constants.user.user_account_one])
@pytest.mark.skip(reason="https://github.com/status-im/desktop-qa-automation/issues/274")
def test_factory_reset_keycard(main_screen: MainWindow, user_account):
main_screen.prepare()
timeout = configs.timeouts.UI_LOAD_TIMEOUT_MSEC
pin = Keycard.KEYCARD_PIN.value
keycard_name = 'Card-1 Name'
with step('Open keycard settings'):
with step('Choose option Factory reset a keycard in keycard settings'):
keycard_settings = main_screen.left_panel.open_settings().left_panel.open_keycard_settings()
with step('Choose option Factory reset a keycard'):
keycard_popup = keycard_settings.click_factory_reset_keycard()
with step('Insert keycard with accounts on it'):
main_screen.hide()
keycard_controller = MockedKeycardController().wait_until_appears()
keycard_controller.plugin_reader()
keycard_controller.choose_mnemonic_metadata_keycard()
keycard_controller.register_keycard()
keycard_controller.insert_keycard_1()
keycard_controller.plugin_reader().choose_mnemonic_metadata_keycard().register_keycard().insert_keycard_1()
main_screen.show()
with step('Enter PIN and verify keycard popup instructions are correct'):
assert driver.waitFor(lambda: Keycard.KEYCARD_ENTER_PIN.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
pin = Keycard.KEYCARD_PIN.value
keycard_name = 'Card-1 Name'
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
keycard_popup.input_pin_or_puk(pin)
assert driver.waitFor(lambda: Keycard.KEYCARD_PIN_VERIFIED.value in keycard_popup.keycard_instructions), \
"There is no correct keycard instruction"
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
with step('Close keycard popup'):
keycard_popup.click_next()
with step('Verify that preview shows correct keycard and instructions are correct'):
assert driver.waitFor(lambda: Keycard.KEYCARD_ACCOUNTS.value in keycard_popup.keycard_instructions), \
"There is no correct keycard instruction"
assert keycard_popup.keypair_on_keycard_name == keycard_name, "Keycard name in preview is incorrect"
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
actual_keycard_name = keycard_popup.keypair_on_keycard_name
assert actual_keycard_name == keycard_name, f"Keycard name {actual_keycard_name} in preview is incorrect"
keycard_popup.click_next()
with step('Verify keycard factory reset title'):
assert driver.waitFor(lambda: Keycard.KEYCARD_FACTORY_RESET_TITLE.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), f"There is no correct keycard instruction {keycard_popup.keycard_instructions}"
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
with step('Confirm that keypair will be deleted in checkbox'):
keycard_popup.confirm_keypair_will_be_deleted(True)
keycard_popup.click_next()
with step('Verify keycard factory successful'):
with step('Verify keycard factory reset was successful'):
assert driver.waitFor(
lambda: Keycard.KEYCARD_FACTORY_RESET_SUCCESSFUL.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
assert driver.waitFor(
lambda: Keycard.KEYCARD_YOU_CAN_USE_AS_EMPTY.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
assert driver.waitFor(lambda: Keycard.KEYCARD_YOU_CAN_USE_AS_EMPTY.value in keycard_popup.keycard_instructions,
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/704606', 'Factory reset a Keycard: incorrect PIN')
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/704606',
'Factory reset a Keycard: incorrect PIN')
@pytest.mark.case(704606)
@pytest.mark.parametrize('user_account', [constants.user.user_account_one])
@pytest.mark.skip(reason="https://github.com/status-im/desktop-qa-automation/issues/274")
def test_factory_reset_keycard_incorrect_pin(main_screen: MainWindow, user_account):
main_screen.prepare()
incorrect_pin = Keycard.KEYCARD_INCORRECT_PIN.value
timeout = configs.timeouts.UI_LOAD_TIMEOUT_MSEC
with step('Open keycard settings'):
with step('Choose option Factory reset a keycard in keycard settings'):
keycard_settings = main_screen.left_panel.open_settings().left_panel.open_keycard_settings()
with step('Choose option Factory reset a keycard'):
keycard_popup = keycard_settings.click_factory_reset_keycard()
with step('Insert keycard with accounts on it'):
main_screen.hide()
keycard_controller = MockedKeycardController().wait_until_appears()
keycard_controller.plugin_reader()
keycard_controller.choose_mnemonic_metadata_keycard()
keycard_controller.register_keycard()
keycard_controller.insert_keycard_1()
keycard_controller.plugin_reader().choose_mnemonic_metadata_keycard().register_keycard().insert_keycard_1()
main_screen.show()
with step('Enter incorrect PIN and verify keycard popup instructions are correct'):
assert driver.waitFor(lambda: Keycard.KEYCARD_ENTER_PIN.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
incorrect_pin = Keycard.KEYCARD_INCORRECT_PIN.value
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
keycard_popup.input_pin_or_puk(incorrect_pin)
assert driver.waitFor(
lambda: Keycard.KEYCARD_INCORRECT_PIN_MESSAGE.value in keycard_popup.keycard_instructions), \
"There is no correct keycard instruction"
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
assert driver.waitFor(
lambda: Keycard.KEYCARD_2_ATTEMPTS_REMAINING.value in keycard_popup.keycard_instructions), \
"There is no correct keycard instruction"
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
assert KEYCARD_ERROR_IMAGE_PATH == keycard_popup.keycard_image_source_path
with step('Enter incorrect PIN again and verify keycard popup instructions are correct'):
assert driver.waitFor(lambda: Keycard.KEYCARD_ENTER_PIN_2.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
incorrect_pin = Keycard.KEYCARD_INCORRECT_PIN.value
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
keycard_popup.input_pin_or_puk(incorrect_pin)
assert driver.waitFor(
lambda: Keycard.KEYCARD_INCORRECT_PIN_MESSAGE.value in keycard_popup.keycard_instructions), \
"There is no correct keycard instruction"
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
assert driver.waitFor(
lambda: Keycard.KEYCARD_1_ATTEMPT_REMAINING.value in keycard_popup.keycard_instructions), \
"There is no correct keycard instruction"
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
assert KEYCARD_ERROR_IMAGE_PATH == keycard_popup.keycard_image_source_path
with step('Enter incorrect PIN again and verify keycard popup instructions are correct'):
assert driver.waitFor(lambda: Keycard.KEYCARD_ENTER_PIN_2.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
incorrect_pin = Keycard.KEYCARD_INCORRECT_PIN.value
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
keycard_popup.input_pin_or_puk(incorrect_pin)
assert driver.waitFor(
lambda: Keycard.KEYCARD_LOCKED.value in keycard_popup.keycard_instructions), \
"There is no correct keycard instruction"
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
assert driver.waitFor(
lambda: Keycard.KEYCARD_LOCKED_INCORRECT_PIN.value in keycard_popup.keycard_instructions), \
"There is no correct keycard instruction"
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
with step('Close keycard popup'):
keycard_popup.cancel()
@ -143,7 +129,7 @@ def test_factory_reset_keycard_incorrect_pin(main_screen: MainWindow, user_accou
with step('Verify keycard factory reset title'):
assert driver.waitFor(lambda: Keycard.KEYCARD_FACTORY_RESET_TITLE.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), f"There is no correct keycard instruction {keycard_popup.keycard_instructions}"
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
with step('Confirm that keypair will be deleted in checkbox'):
keycard_popup.confirm_keypair_will_be_deleted(True)
@ -152,7 +138,6 @@ def test_factory_reset_keycard_incorrect_pin(main_screen: MainWindow, user_accou
with step('Verify keycard factory successful'):
assert driver.waitFor(
lambda: Keycard.KEYCARD_FACTORY_RESET_SUCCESSFUL.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
assert driver.waitFor(
lambda: Keycard.KEYCARD_YOU_CAN_USE_AS_EMPTY.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
assert driver.waitFor(lambda: Keycard.KEYCARD_YOU_CAN_USE_AS_EMPTY.value in keycard_popup.keycard_instructions,
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"

View File

@ -8,7 +8,7 @@ from . import marks
import configs
import constants
import driver
from constants import ColorCodes, aut_options
from constants import ColorCodes
from constants.images_paths import PLUG_IN_KEYCARD_IMAGE_PATH, INSERT_KEYCARD_IMAGE_PATH, KEYCARD_SUCCESS_IMAGE_PATH
from constants.keycard import Keycard
from gui.main_window import MainWindow
@ -16,61 +16,58 @@ from gui.mocked_keycard_controller import MockedKeycardController
pytestmark = marks
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703625',
'Import or restore a Keycard via a seed phrase')
@pytest.mark.case(703625)
@pytest.mark.parametrize('user_account', [constants.user.user_account_one])
@pytest.mark.skip(reason="https://github.com/status-im/desktop-qa-automation/issues/274")
def test_import_restore_keycard_via_seed_phrase(main_screen: MainWindow, user_account):
timeout = configs.timeouts.UI_LOAD_TIMEOUT_MSEC
pin = Keycard.KEYCARD_PIN.value
keycard_name = Keycard.KEYCARD_NAME.value
account_name = Keycard.ACCOUNT_NAME.value
with step('Choose option Import or restore account via seed phrase in settings'):
main_screen.prepare()
keycard_settings = main_screen.left_panel.open_settings().left_panel.open_keycard_settings()
keycard_popup = keycard_settings.click_import_restore_via_seed_phrase()
with (step('Verify displayed keycard popup instructions are correct')):
with step('Verify header is correct'):
assert keycard_popup.keycard_header == Keycard.KEYCARD_POPUP_HEADER_IMPORT_SEED.value, "The header is incorrect"
with step('Verify instructions are correct'):
assert Keycard.KEYCARD_INSTRUCTIONS_PLUG_IN.value in keycard_popup.keycard_instructions, \
"There is no correct keycard instruction"
with step('Keycard welcome image source path is correct'):
assert PLUG_IN_KEYCARD_IMAGE_PATH == keycard_popup.keycard_image_source_path
with step('Verify that header, instructions and image path are correct'):
actual_keycard_header = keycard_popup.keycard_header
actual_instructions = keycard_popup.keycard_instructions
actual_image_path = keycard_popup.keycard_image_source_path
assert actual_keycard_header == Keycard.KEYCARD_POPUP_HEADER_IMPORT_SEED.value, f"The header is incorrect {actual_keycard_header}"
assert Keycard.KEYCARD_INSTRUCTIONS_PLUG_IN.value in actual_instructions, f"There is no correct keycard instruction in {actual_instructions}"
assert PLUG_IN_KEYCARD_IMAGE_PATH == actual_image_path
with step('Plug in reader'):
main_screen.hide()
keycard_controller = MockedKeycardController().wait_until_appears()
keycard_controller = MockedKeycardController().wait_until_appears(10000)
keycard_controller.plugin_reader()
main_screen.show()
with step('Verify displayed keycard popup instructions are correct'):
with step('Verify displayed keycard popup instructions and image path are correct'):
assert driver.waitFor(
lambda: Keycard.KEYCARD_INSTRUCTIONS_INSERT_KEYCARD.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
with step('Keycard image source path is correct'):
timeout), "There is no correct keycard instruction"
time.sleep(2)
assert INSERT_KEYCARD_IMAGE_PATH == keycard_popup.keycard_image_source_path
with step('Register and insert keycard'):
main_screen.hide()
keycard_controller.register_keycard()
keycard_controller.insert_keycard_1()
keycard_controller.register_keycard().insert_keycard_1()
main_screen.show()
with step('Verify displayed keycard popup instructions are correct'):
with step('Verify keycard is recognized'):
assert driver.waitFor(lambda: Keycard.KEYCARD_RECOGNIZED.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
with step('Import keycard via seed phrase'):
pin = Keycard.KEYCARD_PIN.value
keycard_name = Keycard.KEYCARD_NAME.value
account_name = Keycard.ACCOUNT_NAME.value
keycard_popup.import_keycard_via_seed_phrase(user_account.seed_phrase, pin, keycard_name, account_name)
with step('Verify that preview shows correct keycard and account name and color and instructions are correct'):
assert driver.waitFor(lambda: Keycard.KEYCARD_READY.value in keycard_popup.keycard_instructions), \
"There is no correct keycard instruction"
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
assert keycard_popup.keypair_name == keycard_name, "Keycard name in preview is incorrect"
assert keycard_popup.keypair_account_name == account_name, "Account name in preview is incorrect"
@ -79,5 +76,3 @@ def test_import_restore_keycard_via_seed_phrase(main_screen: MainWindow, user_ac
with step('Keycard image source path is correct'):
time.sleep(2)
assert KEYCARD_SUCCESS_IMAGE_PATH == keycard_popup.keycard_image_source_path
keycard_popup.click_next()

View File

@ -19,30 +19,34 @@ from gui.mocked_keycard_controller import MockedKeycardController
pytestmark = marks
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703623',
'Setup a keycard with an existing account')
@pytest.mark.case(703623)
@pytest.mark.parametrize('user_account', [constants.user.user_account_one])
@pytest.mark.parametrize('account_name', [pytest.param('Status account')])
@pytest.mark.skip(reason="https://github.com/status-im/desktop-qa-automation/issues/274")
@pytest.mark.parametrize('account_name', [pytest.param('Account 1')])
@pytest.mark.timeout(timeout=210)
def test_setup_keycard_with_existing_account(main_screen: MainWindow, user_account, account_name):
timeout = configs.timeouts.UI_LOAD_TIMEOUT_MSEC
first_details = '{}'
second_details_path = configs.testpath.TEST_FILES / 'Keycard1_details.txt'
second_details = Path(second_details_path).read_text()
pin = Keycard.KEYCARD_PIN.value
main_screen.prepare()
with step('Choose option Setup keycard with existing account in settings'):
keycard_settings = main_screen.left_panel.open_settings().left_panel.open_keycard_settings()
keycard_popup = keycard_settings.click_setup_keycard_with_existing_account()
with step('Verify displayed keycard popup instructions are correct'):
with step('Verify header is correct'):
assert keycard_popup.keycard_header == Keycard.KEYCARD_POPUP_HEADER_SET_UP_EXISTING.value, "The header is incorrect"
with step('Verify instructions are correct'):
with step('Verify displayed header and keycard popup instructions are correct'):
assert keycard_popup.keycard_header == Keycard.KEYCARD_POPUP_HEADER_SET_UP_EXISTING.value, f"The header {keycard_popup.keycard_header} is incorrect"
assert Keycard.KEYCARD_SELECT_KEYPAIR.value in keycard_popup.keycard_instructions, \
"There is no correct keycard instruction"
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
assert Keycard.KEYCARD_SELECT_WHICH_PAIR.value in keycard_popup.keycard_instructions, \
"There is no correct keycard instruction"
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
with step(
'Verify that profile keypair include correct keycard and account name, account color and info title are correct'):
with step('Verify that profile keypair include correct keycard and account name, color and info title are correct'):
assert keycard_popup.keypair_name == user_account.name, "Keycard name in keypair is incorrect"
assert keycard_popup.keypair_account_name == account_name, "Account name in keypair is incorrect"
assert keycard_popup.keypair_account_color == ColorCodes.BLUE.value, "Account color in keypair is incorrect"
@ -54,18 +58,15 @@ def test_setup_keycard_with_existing_account(main_screen: MainWindow, user_accou
with step('Click selection box on keypair and click continue'):
keycard_popup.click_selection_box_on_keypair().click_next()
with step(
'Verify that profile keypair include correct keycard and account name, account color and info title are correct'):
with step('Verify that profile keypair include correct keycard and account name, color and info title are correct'):
assert keycard_popup.keypair_name == user_account.name, "Keycard name in keypair is incorrect"
assert keycard_popup.keypair_account_name == account_name, "Account name in keypair is incorrect"
assert keycard_popup.keypair_account_color == ColorCodes.BLUE.value, "Account color in keypair is incorrect"
assert keycard_popup.keypair_info_title == Keycard.KEYCARD_KEYPAIR_INFO.value, "Info in keypair is incorrect"
with step('Verify displayed keycard popup instructions are correct'):
with step('Verify displayed keycard popup instructions, image path are correct'):
assert Keycard.KEYCARD_INSTRUCTIONS_PLUG_IN.value in keycard_popup.keycard_instructions, \
"There is no correct keycard instruction"
with step('Keycard welcome image source path is correct'):
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
assert PLUG_IN_KEYCARD_IMAGE_PATH == keycard_popup.keycard_image_source_path
with step('Verify input seed phrase button is disabled'):
@ -80,38 +81,30 @@ def test_setup_keycard_with_existing_account(main_screen: MainWindow, user_accou
with step('Verify displayed keycard popup instructions are correct'):
assert driver.waitFor(
lambda: Keycard.KEYCARD_INSTRUCTIONS_INSERT_KEYCARD.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
with step('Register and insert custom emtpy keycard with custom details'):
main_screen.hide()
first_details = '{}'
second_details_path = configs.testpath.TEST_FILES / 'Keycard1_details.txt'
second_details = Path(second_details_path).read_text()
keycard_controller.choose_custom_keycard()
keycard_controller.input_custom_keycard_details(first_details, 0)
keycard_controller.input_custom_keycard_details(second_details, 1)
keycard_controller.register_keycard()
keycard_controller.insert_keycard_1()
keycard_controller.input_custom_keycard_details(first_details, 0).input_custom_keycard_details(second_details, 1)
keycard_controller.register_keycard().insert_keycard_1()
main_screen.show()
with step('Verify displayed keycard popup instructions are correct'):
with step('Verify keycard is recognized'):
assert driver.waitFor(lambda: Keycard.KEYCARD_RECOGNIZED.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
with step('Verify that asked to choose PIN'):
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
assert driver.waitFor(lambda: Keycard.KEYCARD_CHOOSE_PIN.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
assert Keycard.KEYCARD_PIN_NOTE.value in keycard_popup.keycard_instructions
assert CHOOSE_KEYCARD_PIN_IMAGE_PATH == keycard_popup.keycard_image_source_path
with step('Insert PIN and repeat PIN and verify keycard popup instructions are correct'):
pin = Keycard.KEYCARD_PIN.value
with step('Enter and repeat PIN and verify keycard popup instructions are correct'):
keycard_popup.input_pin_or_puk(pin)
assert driver.waitFor(lambda: Keycard.KEYCARD_REPEAT_PIN.value in keycard_popup.keycard_instructions), \
"There is no correct keycard instruction"
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
keycard_popup.input_pin_or_puk(pin)
assert driver.waitFor(lambda: Keycard.KEYCARD_PIN_SET.value in keycard_popup.keycard_instructions), \
"There is no correct keycard instruction"
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
with step('Create keycard account using new seed phrase'):
keycard_popup.confirm_seed_phrase()
@ -119,19 +112,14 @@ def test_setup_keycard_with_existing_account(main_screen: MainWindow, user_accou
authenticate_popup.authenticate(user_account.password)
with step('Verify displayed keycard popup instructions are correct'):
assert driver.waitFor(
lambda: Keycard.KEYCARD_MIGRATING.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
assert driver.waitFor(lambda: Keycard.KEYCARD_MIGRATING.value in keycard_popup.keycard_instructions,
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
with step('Click on done and verify instructions are correct'):
assert driver.waitFor(
lambda: Keycard.KEYCARD_KEYPAIR_MIGRATED.value in keycard_popup.keycard_instructions,
configs.timeouts.APP_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
assert driver.waitFor(
lambda: Keycard.KEYCARD_COMPLETE_MIGRATION.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
assert driver.waitFor(lambda: Keycard.KEYCARD_KEYPAIR_MIGRATED.value in keycard_popup.keycard_instructions,
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
assert driver.waitFor(lambda: Keycard.KEYCARD_COMPLETE_MIGRATION.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
with step('Keycard image source path is correct'):
time.sleep(2)
assert KEYCARD_SUCCESS_IMAGE_PATH == keycard_popup.keycard_image_source_path
keycard_popup.click_next()

View File

@ -14,20 +14,21 @@ from gui.mocked_keycard_controller import MockedKeycardController
pytestmark = marks
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/704607', 'Unlock Keycard')
@pytest.mark.case(704607)
@pytest.mark.parametrize('user_account', [constants.user.user_with_random_attributes_1])
@pytest.mark.skip(reason="https://github.com/status-im/desktop-qa-automation/issues/274")
def test_unlock_keycard_using_correct_puk(main_screen: MainWindow, user_account):
timeout = configs.timeouts.UI_LOAD_TIMEOUT_MSEC
pin = Keycard.KEYCARD_PIN.value
incorrect_pin = Keycard.KEYCARD_INCORRECT_PIN.value
correct_puk = Keycard.KEYCARD_CORRECT_PUK.value
main_screen.prepare()
with step('Plug in reader'):
with step('Plug in reader and insert keycard'):
main_screen.hide()
keycard_controller = MockedKeycardController().wait_until_appears()
keycard_controller.plugin_reader()
keycard_controller.choose_mnemonic_metadata_keycard()
keycard_controller.register_keycard()
keycard_controller.insert_keycard_1()
keycard_controller.plugin_reader().choose_mnemonic_metadata_keycard().register_keycard().insert_keycard_1()
main_screen.show()
with step('Choose option Check whats on keycard in settings'):
@ -36,72 +37,62 @@ def test_unlock_keycard_using_correct_puk(main_screen: MainWindow, user_account)
with step('Enter incorrect PIN 3 times and verify keycard popup instructions are correct'):
assert driver.waitFor(lambda: Keycard.KEYCARD_ENTER_PIN.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
incorrect_pin = Keycard.KEYCARD_INCORRECT_PIN.value
keycard_popup.input_pin_or_puk(incorrect_pin)
time.sleep(1)
keycard_popup.input_pin_or_puk(incorrect_pin)
time.sleep(1)
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
for i in range(3):
keycard_popup.input_pin_or_puk(incorrect_pin)
time.sleep(1)
assert driver.waitFor(
lambda: Keycard.KEYCARD_LOCKED.value in keycard_popup.keycard_instructions), \
f"There is no correct keycard instruction {keycard_popup.keycard_instructions}"
assert driver.waitFor(
lambda: Keycard.KEYCARD_LOCKED_INCORRECT_PIN.value in keycard_popup.keycard_instructions), \
"There is no correct keycard instruction"
assert driver.waitFor(lambda: Keycard.KEYCARD_LOCKED.value in keycard_popup.keycard_instructions), \
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
assert driver.waitFor(lambda: Keycard.KEYCARD_LOCKED_INCORRECT_PIN.value in keycard_popup.keycard_instructions), \
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
with step('Click Unlock keycard button'):
keycard_popup.click_next()
with step('Verify keycard popup instructions are correct'):
assert driver.waitFor(
lambda: Keycard.KEYCARD_UNLOCK.value in keycard_popup.keycard_instructions), \
f"There is no correct keycard instruction {keycard_popup.keycard_instructions}"
assert driver.waitFor(lambda: Keycard.KEYCARD_UNLOCK.value in keycard_popup.keycard_instructions), \
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
with step('Click Unlock using PUK and enter incorrect PUK'):
keycard_popup.click_unlock_puk()
correct_puk = Keycard.KEYCARD_CORRECT_PUK.value
keycard_popup.input_pin_or_puk(correct_puk)
time.sleep(1)
keycard_popup.click_next()
with step('Verify that asked to choose PIN'):
assert driver.waitFor(lambda: Keycard.KEYCARD_CHOOSE_PIN.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
assert Keycard.KEYCARD_PIN_NOTE.value in keycard_popup.keycard_instructions
with step('Enter PIN and repeat PIN and verify keycard popup instructions are correct'):
pin = Keycard.KEYCARD_PIN.value
with step('Enter and repeat PIN and verify keycard popup instructions are correct'):
keycard_popup.input_pin_or_puk(pin)
assert driver.waitFor(lambda: Keycard.KEYCARD_REPEAT_PIN.value in keycard_popup.keycard_instructions), \
"There is no correct keycard instruction"
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
keycard_popup.input_pin_or_puk(pin)
assert driver.waitFor(lambda: Keycard.KEYCARD_PIN_SET.value in keycard_popup.keycard_instructions), \
"There is no correct keycard instruction"
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
keycard_popup.click_next()
with step('Verify keycard popup instructions are correct'):
assert driver.waitFor(
lambda: Keycard.KEYCARD_UNLOCK_SUCCESSFUL.value in keycard_popup.keycard_instructions), \
f"There is no correct keycard instruction {keycard_popup.keycard_instructions}"
assert driver.waitFor(lambda: Keycard.KEYCARD_UNLOCK_SUCCESSFUL.value in keycard_popup.keycard_instructions), \
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/704608', 'Unlock Keycard: incorrect PUK')
@pytest.mark.case(704608)
@pytest.mark.parametrize('user_account', [constants.user.user_with_random_attributes_1])
@pytest.mark.skip(reason="https://github.com/status-im/desktop-qa-automation/issues/274")
def test_unlock_keycard_using_incorrect_puk(main_screen: MainWindow, user_account):
timeout = configs.timeouts.UI_LOAD_TIMEOUT_MSEC
pin = Keycard.KEYCARD_PIN.value
incorrect_pin = Keycard.KEYCARD_INCORRECT_PIN.value
incorrect_puk = Keycard.KEYCARD_INCORRECT_PUK.value
main_screen.prepare()
with step('Plug in reader'):
with step('Plug in reader and insert keycard'):
main_screen.hide()
keycard_controller = MockedKeycardController().wait_until_appears()
keycard_controller.plugin_reader()
keycard_controller.choose_mnemonic_metadata_keycard()
keycard_controller.register_keycard()
keycard_controller.insert_keycard_1()
keycard_controller.plugin_reader().choose_mnemonic_metadata_keycard().register_keycard().insert_keycard_1()
main_screen.show()
with step('Choose option Check whats on keycard in settings'):
@ -110,62 +101,72 @@ def test_unlock_keycard_using_incorrect_puk(main_screen: MainWindow, user_accoun
with step('Enter incorrect PIN 3 times and verify keycard popup instructions are correct'):
assert driver.waitFor(lambda: Keycard.KEYCARD_ENTER_PIN.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
incorrect_pin = Keycard.KEYCARD_INCORRECT_PIN.value
keycard_popup.input_pin_or_puk(incorrect_pin)
time.sleep(1)
keycard_popup.input_pin_or_puk(incorrect_pin)
time.sleep(1)
timeout), f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
for i in range(3):
keycard_popup.input_pin_or_puk(incorrect_pin)
time.sleep(1)
assert driver.waitFor(
lambda: Keycard.KEYCARD_LOCKED.value in keycard_popup.keycard_instructions), \
f"There is no correct keycard instruction {keycard_popup.keycard_instructions}"
assert driver.waitFor(
lambda: Keycard.KEYCARD_LOCKED_INCORRECT_PIN.value in keycard_popup.keycard_instructions), \
"There is no correct keycard instruction"
assert driver.waitFor(lambda: Keycard.KEYCARD_LOCKED.value in keycard_popup.keycard_instructions), \
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
assert driver.waitFor(lambda: Keycard.KEYCARD_LOCKED_INCORRECT_PIN.value in keycard_popup.keycard_instructions), \
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
with step('Click Unlock keycard button'):
keycard_popup.click_next()
with step('Verify keycard popup instructions are correct'):
assert driver.waitFor(
lambda: Keycard.KEYCARD_UNLOCK.value in keycard_popup.keycard_instructions), \
assert driver.waitFor(lambda: Keycard.KEYCARD_UNLOCK.value in keycard_popup.keycard_instructions), \
f"There is no correct keycard instruction {keycard_popup.keycard_instructions}"
with step('Click Unlock using PUK and enter incorrect PUK'):
keycard_popup.click_unlock_puk()
incorrect_puk = Keycard.KEYCARD_INCORRECT_PUK.value
keycard_popup.input_pin_or_puk(incorrect_puk)
time.sleep(1)
keycard_popup.click_next()
with step('Verify that asked to choose PIN'):
assert driver.waitFor(lambda: Keycard.KEYCARD_CHOOSE_PIN.value in keycard_popup.keycard_instructions,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
timeout), f"There is no correct keycard instruction in in {keycard_popup.keycard_instructions}"
assert Keycard.KEYCARD_PIN_NOTE.value in keycard_popup.keycard_instructions
with step('Enter PIN and repeat PIN and verify keycard popup instructions are correct'):
pin = Keycard.KEYCARD_PIN.value
keycard_popup.input_pin_or_puk(pin)
assert driver.waitFor(lambda: Keycard.KEYCARD_REPEAT_PIN.value in keycard_popup.keycard_instructions), \
"There is no correct keycard instruction"
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
keycard_popup.input_pin_or_puk(pin)
assert driver.waitFor(lambda: Keycard.KEYCARD_PIN_SET.value in keycard_popup.keycard_instructions), \
"There is no correct keycard instruction"
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
keycard_popup.click_next()
with step('Verify keycard popup instructions are correct'):
assert driver.waitFor(
lambda: Keycard.KEYCARD_PUK_IS_INCORRECT.value in keycard_popup.keycard_instructions), \
f"There is no correct keycard instruction {keycard_popup.keycard_instructions}"
assert driver.waitFor(
lambda: Keycard.KEYCARD_4_ATTEMPTS_REMAINING.value in keycard_popup.keycard_instructions), \
f"There is no correct keycard instruction {keycard_popup.keycard_instructions}"
assert driver.waitFor(lambda: Keycard.KEYCARD_PUK_IS_INCORRECT.value in keycard_popup.keycard_instructions), \
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
assert driver.waitFor(lambda: Keycard.KEYCARD_4_ATTEMPTS_REMAINING.value in keycard_popup.keycard_instructions), \
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
with step('Enter incorrect PUK again'):
keycard_popup.input_pin_or_puk(incorrect_puk)
time.sleep(1)
keycard_popup.click_next()
with step('Verify keycard popup instructions are correct'):
assert driver.waitFor(lambda: Keycard.KEYCARD_PUK_IS_INCORRECT.value in keycard_popup.keycard_instructions), \
f"There is no correct keycard instruction {keycard_popup.keycard_instructions}"
assert driver.waitFor(lambda: Keycard.KEYCARD_3_ATTEMPTS_REMAINING.value in keycard_popup.keycard_instructions), \
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
with step('Enter incorrect PUK again'):
keycard_popup.input_pin_or_puk(incorrect_puk)
time.sleep(1)
keycard_popup.click_next()
with step('Verify keycard popup instructions are correct'):
assert driver.waitFor(lambda: Keycard.KEYCARD_PUK_IS_INCORRECT.value in keycard_popup.keycard_instructions), \
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
assert driver.waitFor(lambda: Keycard.KEYCARD_2_ATTEMPTS_REMAINING.value in keycard_popup.keycard_instructions), \
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
with step('Enter incorrect PUK again'):
incorrect_puk = Keycard.KEYCARD_INCORRECT_PUK.value
keycard_popup.input_pin_or_puk(incorrect_puk)
time.sleep(1)
keycard_popup.click_next()
@ -173,49 +174,18 @@ def test_unlock_keycard_using_incorrect_puk(main_screen: MainWindow, user_accoun
with step('Verify keycard popup instructions are correct'):
assert driver.waitFor(
lambda: Keycard.KEYCARD_PUK_IS_INCORRECT.value in keycard_popup.keycard_instructions), \
f"There is no correct keycard instruction {keycard_popup.keycard_instructions}"
assert driver.waitFor(
lambda: Keycard.KEYCARD_3_ATTEMPTS_REMAINING.value in keycard_popup.keycard_instructions), \
f"There is no correct keycard instruction {keycard_popup.keycard_instructions}"
with step('Enter incorrect PUK again'):
incorrect_puk = Keycard.KEYCARD_INCORRECT_PUK.value
keycard_popup.input_pin_or_puk(incorrect_puk)
time.sleep(1)
keycard_popup.click_next()
with step('Verify keycard popup instructions are correct'):
assert driver.waitFor(
lambda: Keycard.KEYCARD_PUK_IS_INCORRECT.value in keycard_popup.keycard_instructions), \
f"There is no correct keycard instruction {keycard_popup.keycard_instructions}"
assert driver.waitFor(
lambda: Keycard.KEYCARD_2_ATTEMPTS_REMAINING.value in keycard_popup.keycard_instructions), \
f"There is no correct keycard instruction {keycard_popup.keycard_instructions}"
with step('Enter incorrect PUK again'):
incorrect_puk = Keycard.KEYCARD_INCORRECT_PUK.value
keycard_popup.input_pin_or_puk(incorrect_puk)
time.sleep(1)
keycard_popup.click_next()
with step('Verify keycard popup instructions are correct'):
assert driver.waitFor(
lambda: Keycard.KEYCARD_PUK_IS_INCORRECT.value in keycard_popup.keycard_instructions), \
f"There is no correct keycard instruction {keycard_popup.keycard_instructions}"
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
assert driver.waitFor(
lambda: Keycard.KEYCARD_1_ATTEMPT_REMAINING.value in keycard_popup.keycard_instructions), \
f"There is no correct keycard instruction {keycard_popup.keycard_instructions}"
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
with step('Enter incorrect PUK again'):
incorrect_puk = Keycard.KEYCARD_INCORRECT_PUK.value
keycard_popup.input_pin_or_puk(incorrect_puk)
time.sleep(1)
keycard_popup.click_next()
with step('Verify keycard is locked and it says that PUK entered incorrectly'):
assert driver.waitFor(
lambda: Keycard.KEYCARD_LOCKED.value in keycard_popup.keycard_instructions), \
f"There is no correct keycard instruction {keycard_popup.keycard_instructions}"
assert driver.waitFor(
lambda: Keycard.KEYCARD_LOCKED_INCORRECT_PUK.value in keycard_popup.keycard_instructions), \
"There is no correct keycard instruction"
assert driver.waitFor(lambda: Keycard.KEYCARD_LOCKED.value in keycard_popup.keycard_instructions), \
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"
assert driver.waitFor(lambda: Keycard.KEYCARD_LOCKED_INCORRECT_PUK.value in keycard_popup.keycard_instructions), \
f"There is no correct keycard instruction in {keycard_popup.keycard_instructions}"

View File

@ -151,6 +151,7 @@ def test_wallet_sort_assets(main_screen: MainWindow, address, name, dai, wrapped
pytest.param('0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', 'AssetsCollectibles', 'Dai Stablecoin', 'Wrapped Ether',
'Status Test Token', 'Ether')
])
@pytest.mark.skip(reason="https://github.com/status-im/status-desktop/issues/15655")
def test_custom_ordering(main_screen: MainWindow, address, name, dai, wrappedeth, stt, eth):
with step('Turn on Testnet mode'):
networks = main_screen.left_panel.open_settings().left_panel.open_wallet_settings().open_networks()
@ -163,13 +164,13 @@ def test_custom_ordering(main_screen: MainWindow, address, name, dai, wrappedeth
account_popup.set_name(name).set_origin_watched_address(address).save_changes()
account_popup.wait_until_hidden()
with step(
'Choose Create custom order in sorting dropdown and verify Manage tokens view appears'):
with (step(
'Choose Create custom order in sorting dropdown and verify Manage tokens view appears')):
wallet_account_view = WalletAccountView()
sorting = wallet_account_view.open_assets_tab().click_filter_button()
sorting.choose_sort_by_value('Create custom order →')
manage_tokens = ManageTokensSettingsView()
assert manage_tokens.exists, 'Manage tokens view was not opened'
ManageTokensSettingsView().wait_until_appears(), 'Manage tokens view was not opened'
with step('Drag first token to the end of the list and save changes'):
manage_tokens.drag_token(dai, 3)

View File

@ -71,6 +71,7 @@ Item {
StatusTabButton {
leftPadding: 0
width: implicitWidth
objectName: "assetsButton"
text: qsTr("Assets")
}
StatusTabButton {