test: test_unlock_keycard with correct and incorrect PUK added (#312)
This commit is contained in:
parent
fc2e6c3287
commit
8c933e75bd
|
@ -4,6 +4,8 @@ from enum import Enum
|
||||||
class Keycard(Enum):
|
class Keycard(Enum):
|
||||||
KEYCARD_PIN = '111111'
|
KEYCARD_PIN = '111111'
|
||||||
KEYCARD_INCORRECT_PIN = '222222'
|
KEYCARD_INCORRECT_PIN = '222222'
|
||||||
|
KEYCARD_CORRECT_PUK = '111111111111'
|
||||||
|
KEYCARD_INCORRECT_PUK = '222222222222'
|
||||||
KEYCARD_NAME = 'Test Keycard'
|
KEYCARD_NAME = 'Test Keycard'
|
||||||
ACCOUNT_NAME = 'Test Account'
|
ACCOUNT_NAME = 'Test Account'
|
||||||
KEYCARD_POPUP_HEADER_CREATE_SEED = 'Create a new Keycard account with a new seed phrase'
|
KEYCARD_POPUP_HEADER_CREATE_SEED = 'Create a new Keycard account with a new seed phrase'
|
||||||
|
@ -40,6 +42,13 @@ class Keycard(Enum):
|
||||||
KEYCARD_FACTORY_RESET_SUCCESSFUL = 'Keycard successfully factory reset'
|
KEYCARD_FACTORY_RESET_SUCCESSFUL = 'Keycard successfully factory reset'
|
||||||
KEYCARD_YOU_CAN_USE_AS_EMPTY = 'You can now use this Keycard as if it\nwas a brand new empty Keycard'
|
KEYCARD_YOU_CAN_USE_AS_EMPTY = 'You can now use this Keycard as if it\nwas a brand new empty Keycard'
|
||||||
KEYCARD_INCORRECT_PIN_MESSAGE = 'PIN incorrect'
|
KEYCARD_INCORRECT_PIN_MESSAGE = 'PIN incorrect'
|
||||||
|
KEYCARD_4_ATTEMPTS_REMAINING = '4 attempts remaining'
|
||||||
|
KEYCARD_3_ATTEMPTS_REMAINING = '3 attempts remaining'
|
||||||
KEYCARD_2_ATTEMPTS_REMAINING = '2 attempts remaining'
|
KEYCARD_2_ATTEMPTS_REMAINING = '2 attempts remaining'
|
||||||
KEYCARD_1_ATTEMPT_REMAINING = '1 attempt remaining'
|
KEYCARD_1_ATTEMPT_REMAINING = '1 attempt remaining'
|
||||||
KEYCARD_LOCKED_INCORRECT_PIN = 'Pin entered incorrectly too many times'
|
KEYCARD_LOCKED_INCORRECT_PIN = 'Pin entered incorrectly too many times'
|
||||||
|
KEYCARD_LOCKED_INCORRECT_PUK = 'Puk entered incorrectly too many times'
|
||||||
|
KEYCARD_UNLOCK = 'Unlock this Keycard'
|
||||||
|
KEYCARD_ENTER_PUK = 'Enter PUK'
|
||||||
|
KEYCARD_UNLOCK_SUCCESSFUL = 'Unlock successful'
|
||||||
|
KEYCARD_PUK_IS_INCORRECT = 'The PUK is incorrect, try entering it again'
|
||||||
|
|
|
@ -43,6 +43,7 @@ class KeycardPopup(BasePopup):
|
||||||
'i_understand_the_key_pair_on_this_Keycard_will_be_deleted_StatusCheckBox')
|
'i_understand_the_key_pair_on_this_Keycard_will_be_deleted_StatusCheckBox')
|
||||||
self._emoji_button = QObject('statusSmartIdenticonLetter_StatusLetterIdenticon')
|
self._emoji_button = QObject('statusSmartIdenticonLetter_StatusLetterIdenticon')
|
||||||
self._add_another_account_button = Button('add_another_account_StatusButton')
|
self._add_another_account_button = Button('add_another_account_StatusButton')
|
||||||
|
self._secondary_button = Button('secondary_StatusButton')
|
||||||
self._color_radiobutton = QObject('color_StatusColorRadioButton')
|
self._color_radiobutton = QObject('color_StatusColorRadioButton')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -134,7 +135,7 @@ class KeycardPopup(BasePopup):
|
||||||
return self
|
return self
|
||||||
|
|
||||||
@allure.step('Set pin')
|
@allure.step('Set pin')
|
||||||
def input_pin(self, pin):
|
def input_pin_or_puk(self, pin):
|
||||||
driver.nativeType(pin)
|
driver.nativeType(pin)
|
||||||
|
|
||||||
@allure.step('Click Next button')
|
@allure.step('Click Next button')
|
||||||
|
@ -177,7 +178,7 @@ class KeycardPopup(BasePopup):
|
||||||
|
|
||||||
@allure.step('Add another account')
|
@allure.step('Add another account')
|
||||||
def add_account(self):
|
def add_account(self):
|
||||||
self._add_another_account_button.click()
|
self._secondary_button.click()
|
||||||
return self
|
return self
|
||||||
|
|
||||||
@allure.step('Name account')
|
@allure.step('Name account')
|
||||||
|
@ -225,8 +226,8 @@ class KeycardPopup(BasePopup):
|
||||||
@allure.step('Import keycard via seed phrase')
|
@allure.step('Import keycard via seed phrase')
|
||||||
def import_keycard_via_seed_phrase(self, seed_phrase_words: list, pin: str, keycard_name: str, account_name: str):
|
def import_keycard_via_seed_phrase(self, seed_phrase_words: list, pin: str, keycard_name: str, account_name: str):
|
||||||
self.input_seed_phrase(seed_phrase_words)
|
self.input_seed_phrase(seed_phrase_words)
|
||||||
self.input_pin(pin)
|
self.input_pin_or_puk(pin)
|
||||||
self.input_pin(pin)
|
self.input_pin_or_puk(pin)
|
||||||
self.click_next()
|
self.click_next()
|
||||||
self.name_keycard_and_account(keycard_name, account_name)
|
self.name_keycard_and_account(keycard_name, account_name)
|
||||||
|
|
||||||
|
@ -252,3 +253,8 @@ class KeycardPopup(BasePopup):
|
||||||
@allure.step('Confirm that understand that keypair will be deleted in checkbox')
|
@allure.step('Confirm that understand that keypair will be deleted in checkbox')
|
||||||
def confirm_keypair_will_be_deleted(self, value: bool):
|
def confirm_keypair_will_be_deleted(self, value: bool):
|
||||||
self._understand_keypair_deleted_checkbox.set(value)
|
self._understand_keypair_deleted_checkbox.set(value)
|
||||||
|
|
||||||
|
@allure.step('Click Unlock using PUK')
|
||||||
|
def click_unlock_puk(self):
|
||||||
|
self._secondary_button.click()
|
||||||
|
return self
|
||||||
|
|
|
@ -345,4 +345,4 @@ switchTabBar_18_words_StatusSwitchTabButton = {"checkable": True, "container": s
|
||||||
switchTabBar_24_words_StatusSwitchTabButton = {"checkable": True, "container": switchTabBar_StatusSwitchTabBar, "objectName": "24SeedButton", "text": "24 words", "type": "StatusSwitchTabButton", "visible": True}
|
switchTabBar_24_words_StatusSwitchTabButton = {"checkable": True, "container": switchTabBar_StatusSwitchTabBar, "objectName": "24SeedButton", "text": "24 words", "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}
|
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}
|
statusSmartIdenticonLetter_StatusLetterIdenticon = {"container": statusDesktop_mainWindow_overlay, "objectName": "statusSmartIdenticonLetter", "type": "StatusLetterIdenticon", "visible": True}
|
||||||
add_another_account_StatusButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "id": "secondaryButton", "type": "StatusButton", "unnamed": 1, "visible": True}
|
secondary_StatusButton = {"checkable": False, "container": statusDesktop_mainWindow_overlay, "id": "secondaryButton", "type": "StatusButton", "unnamed": 1, "visible": True}
|
||||||
|
|
|
@ -122,7 +122,7 @@ def test_check_whats_on_keycard(main_screen: MainWindow, user_account):
|
||||||
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
|
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
|
||||||
pin = Keycard.KEYCARD_PIN.value
|
pin = Keycard.KEYCARD_PIN.value
|
||||||
keycard_name = 'Card-1 Name'
|
keycard_name = 'Card-1 Name'
|
||||||
keycard_popup.input_pin(pin)
|
keycard_popup.input_pin_or_puk(pin)
|
||||||
assert driver.waitFor(lambda: Keycard.KEYCARD_PIN_VERIFIED.value in keycard_popup.keycard_instructions), \
|
assert driver.waitFor(lambda: Keycard.KEYCARD_PIN_VERIFIED.value in keycard_popup.keycard_instructions), \
|
||||||
"There is no correct keycard instruction"
|
"There is no correct keycard instruction"
|
||||||
|
|
||||||
|
|
|
@ -75,10 +75,10 @@ def test_create_keycard_account_with_new_seed_phrase(main_screen: MainWindow, na
|
||||||
|
|
||||||
with step('Enter and repeat PIN and verify keycard popup instructions are correct'):
|
with step('Enter and repeat PIN and verify keycard popup instructions are correct'):
|
||||||
pin = Keycard.KEYCARD_PIN.value
|
pin = Keycard.KEYCARD_PIN.value
|
||||||
keycard_popup.input_pin(pin)
|
keycard_popup.input_pin_or_puk(pin)
|
||||||
assert driver.waitFor(lambda: Keycard.KEYCARD_REPEAT_PIN.value in keycard_popup.keycard_instructions), \
|
assert driver.waitFor(lambda: Keycard.KEYCARD_REPEAT_PIN.value in keycard_popup.keycard_instructions), \
|
||||||
"There is no correct keycard instruction"
|
"There is no correct keycard instruction"
|
||||||
keycard_popup.input_pin(pin)
|
keycard_popup.input_pin_or_puk(pin)
|
||||||
assert driver.waitFor(lambda: Keycard.KEYCARD_PIN_SET.value in keycard_popup.keycard_instructions), \
|
assert driver.waitFor(lambda: Keycard.KEYCARD_PIN_SET.value in keycard_popup.keycard_instructions), \
|
||||||
"There is no correct keycard instruction"
|
"There is no correct keycard instruction"
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ def test_factory_reset_keycard(main_screen: MainWindow, user_account):
|
||||||
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
|
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
|
||||||
pin = Keycard.KEYCARD_PIN.value
|
pin = Keycard.KEYCARD_PIN.value
|
||||||
keycard_name = 'Card-1 Name'
|
keycard_name = 'Card-1 Name'
|
||||||
keycard_popup.input_pin(pin)
|
keycard_popup.input_pin_or_puk(pin)
|
||||||
assert driver.waitFor(lambda: Keycard.KEYCARD_PIN_VERIFIED.value in keycard_popup.keycard_instructions), \
|
assert driver.waitFor(lambda: Keycard.KEYCARD_PIN_VERIFIED.value in keycard_popup.keycard_instructions), \
|
||||||
"There is no correct keycard instruction"
|
"There is no correct keycard instruction"
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ def test_factory_reset_keycard_incorrect_pin(main_screen: MainWindow, user_accou
|
||||||
assert driver.waitFor(lambda: Keycard.KEYCARD_ENTER_PIN.value in keycard_popup.keycard_instructions,
|
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"
|
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
|
||||||
incorrect_pin = Keycard.KEYCARD_INCORRECT_PIN.value
|
incorrect_pin = Keycard.KEYCARD_INCORRECT_PIN.value
|
||||||
keycard_popup.input_pin(incorrect_pin)
|
keycard_popup.input_pin_or_puk(incorrect_pin)
|
||||||
|
|
||||||
assert driver.waitFor(
|
assert driver.waitFor(
|
||||||
lambda: Keycard.KEYCARD_INCORRECT_PIN_MESSAGE.value in keycard_popup.keycard_instructions), \
|
lambda: Keycard.KEYCARD_INCORRECT_PIN_MESSAGE.value in keycard_popup.keycard_instructions), \
|
||||||
|
@ -110,7 +110,7 @@ def test_factory_reset_keycard_incorrect_pin(main_screen: MainWindow, user_accou
|
||||||
assert driver.waitFor(lambda: Keycard.KEYCARD_ENTER_PIN_2.value in keycard_popup.keycard_instructions,
|
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"
|
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
|
||||||
incorrect_pin = Keycard.KEYCARD_INCORRECT_PIN.value
|
incorrect_pin = Keycard.KEYCARD_INCORRECT_PIN.value
|
||||||
keycard_popup.input_pin(incorrect_pin)
|
keycard_popup.input_pin_or_puk(incorrect_pin)
|
||||||
|
|
||||||
assert driver.waitFor(
|
assert driver.waitFor(
|
||||||
lambda: Keycard.KEYCARD_INCORRECT_PIN_MESSAGE.value in keycard_popup.keycard_instructions), \
|
lambda: Keycard.KEYCARD_INCORRECT_PIN_MESSAGE.value in keycard_popup.keycard_instructions), \
|
||||||
|
@ -124,7 +124,7 @@ def test_factory_reset_keycard_incorrect_pin(main_screen: MainWindow, user_accou
|
||||||
assert driver.waitFor(lambda: Keycard.KEYCARD_ENTER_PIN_2.value in keycard_popup.keycard_instructions,
|
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"
|
configs.timeouts.UI_LOAD_TIMEOUT_MSEC), "There is no correct keycard instruction"
|
||||||
incorrect_pin = Keycard.KEYCARD_INCORRECT_PIN.value
|
incorrect_pin = Keycard.KEYCARD_INCORRECT_PIN.value
|
||||||
keycard_popup.input_pin(incorrect_pin)
|
keycard_popup.input_pin_or_puk(incorrect_pin)
|
||||||
|
|
||||||
assert driver.waitFor(
|
assert driver.waitFor(
|
||||||
lambda: Keycard.KEYCARD_LOCKED.value in keycard_popup.keycard_instructions), \
|
lambda: Keycard.KEYCARD_LOCKED.value in keycard_popup.keycard_instructions), \
|
||||||
|
|
|
@ -104,10 +104,10 @@ def test_setup_keycard_with_existing_account(main_screen: MainWindow, user_accou
|
||||||
|
|
||||||
with step('Insert PIN and repeat PIN and verify keycard popup instructions are correct'):
|
with step('Insert PIN and repeat PIN and verify keycard popup instructions are correct'):
|
||||||
pin = Keycard.KEYCARD_PIN.value
|
pin = Keycard.KEYCARD_PIN.value
|
||||||
keycard_popup.input_pin(pin)
|
keycard_popup.input_pin_or_puk(pin)
|
||||||
assert driver.waitFor(lambda: Keycard.KEYCARD_REPEAT_PIN.value in keycard_popup.keycard_instructions), \
|
assert driver.waitFor(lambda: Keycard.KEYCARD_REPEAT_PIN.value in keycard_popup.keycard_instructions), \
|
||||||
"There is no correct keycard instruction"
|
"There is no correct keycard instruction"
|
||||||
keycard_popup.input_pin(pin)
|
keycard_popup.input_pin_or_puk(pin)
|
||||||
assert driver.waitFor(lambda: Keycard.KEYCARD_PIN_SET.value in keycard_popup.keycard_instructions), \
|
assert driver.waitFor(lambda: Keycard.KEYCARD_PIN_SET.value in keycard_popup.keycard_instructions), \
|
||||||
"There is no correct keycard instruction"
|
"There is no correct keycard instruction"
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,219 @@
|
||||||
|
import time
|
||||||
|
|
||||||
|
import allure
|
||||||
|
import pytest
|
||||||
|
from allure import step
|
||||||
|
|
||||||
|
import configs
|
||||||
|
import constants
|
||||||
|
import driver
|
||||||
|
from constants.keycard import Keycard
|
||||||
|
from gui.main_window import MainWindow
|
||||||
|
from gui.mocked_keycard_controller import MockedKeycardController
|
||||||
|
|
||||||
|
|
||||||
|
@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_account_one])
|
||||||
|
@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):
|
||||||
|
main_screen.prepare()
|
||||||
|
|
||||||
|
with step('Plug in reader'):
|
||||||
|
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()
|
||||||
|
main_screen.show()
|
||||||
|
|
||||||
|
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('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)
|
||||||
|
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"
|
||||||
|
|
||||||
|
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}"
|
||||||
|
|
||||||
|
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"
|
||||||
|
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"
|
||||||
|
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"
|
||||||
|
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}"
|
||||||
|
|
||||||
|
|
||||||
|
@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_account_one])
|
||||||
|
@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):
|
||||||
|
main_screen.prepare()
|
||||||
|
|
||||||
|
with step('Plug in reader'):
|
||||||
|
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()
|
||||||
|
main_screen.show()
|
||||||
|
|
||||||
|
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('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)
|
||||||
|
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"
|
||||||
|
|
||||||
|
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}"
|
||||||
|
|
||||||
|
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"
|
||||||
|
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"
|
||||||
|
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"
|
||||||
|
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}"
|
||||||
|
|
||||||
|
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_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}"
|
||||||
|
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}"
|
||||||
|
|
||||||
|
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"
|
Loading…
Reference in New Issue