2022-11-21 12:56:06 +00:00
|
|
|
import steps.commonInitSteps as init_steps
|
2022-05-26 15:00:00 +00:00
|
|
|
from screens.StatusWelcomeScreen import StatusWelcomeScreen
|
2022-06-07 15:19:52 +00:00
|
|
|
from screens.StatusMainScreen import StatusMainScreen
|
2023-05-30 10:24:04 +00:00
|
|
|
import builtins
|
2022-05-26 15:00:00 +00:00
|
|
|
|
2022-06-07 23:37:11 +00:00
|
|
|
_welcomeScreen = StatusWelcomeScreen()
|
2022-08-12 13:19:16 +00:00
|
|
|
_mainScreen = StatusMainScreen()
|
|
|
|
|
2022-10-13 16:03:10 +00:00
|
|
|
#########################
|
|
|
|
### PRECONDITIONS region:
|
|
|
|
#########################
|
2022-05-26 15:00:00 +00:00
|
|
|
|
2022-06-07 23:37:11 +00:00
|
|
|
@Given("A first time user lands on the status desktop and generates new key")
|
2022-05-26 15:00:00 +00:00
|
|
|
def step(context):
|
2022-12-26 21:53:47 +00:00
|
|
|
init_steps.a_first_time_user_lands_on_and_generates_new_key(context)
|
2022-06-07 23:37:11 +00:00
|
|
|
|
2022-06-29 01:12:35 +00:00
|
|
|
@Given("A first time user lands on the status desktop and navigates to import seed phrase")
|
|
|
|
def step(context):
|
2022-11-17 14:06:36 +00:00
|
|
|
init_steps.a_first_time_user_lands_on_and_navigates_to_import_seed_phrase(context)
|
2022-10-13 16:03:10 +00:00
|
|
|
|
|
|
|
@Given("the user lands on the signed in app")
|
|
|
|
def step(context):
|
2022-11-17 14:06:36 +00:00
|
|
|
init_steps.the_user_lands_on_the_signed_in_app()
|
2022-11-16 12:06:37 +00:00
|
|
|
|
|
|
|
@Given("the user signs up with username \"|any|\" and password \"|any|\"")
|
2022-05-26 15:00:00 +00:00
|
|
|
def step(context, username, password):
|
2022-11-17 14:06:36 +00:00
|
|
|
init_steps.the_user_signs_up(username, password)
|
|
|
|
|
|
|
|
@Given("the user signs up with profileImage \"|any|\", username \"|any|\" and password \"|any|\"")
|
|
|
|
def step(context, profileImageUrl: str, username: str, password: str):
|
|
|
|
_welcomeScreen.input_username_profileImage_password_and_finalize_sign_up("file:///"+context.userData["fixtures_root"]+"images/"+profileImageUrl, username, password)
|
|
|
|
|
|
|
|
@Given("my profile modal has the updated profile image")
|
|
|
|
def step(context):
|
2022-11-29 10:30:51 +00:00
|
|
|
_mainScreen.profile_modal_image_is_updated()
|
2022-11-17 14:06:36 +00:00
|
|
|
|
|
|
|
@Given("the profile setting has the updated profile image")
|
|
|
|
def step(context):
|
2022-11-29 10:30:51 +00:00
|
|
|
_mainScreen.profile_settings_image_is_updated()
|
2022-11-17 14:06:36 +00:00
|
|
|
|
|
|
|
@Given("a screenshot of the profileImage is taken")
|
|
|
|
def step(context):
|
|
|
|
_welcomeScreen.grab_screenshot()
|
|
|
|
|
|
|
|
@Given("the user inputs username \"|any|\"")
|
|
|
|
def step(context, username):
|
|
|
|
the_user_inputs_username(username)
|
2022-06-07 23:37:11 +00:00
|
|
|
|
2022-11-16 12:06:37 +00:00
|
|
|
#########################
|
|
|
|
### ACTIONS region:
|
|
|
|
########################
|
2022-12-26 21:53:47 +00:00
|
|
|
@When("the user lands on the status desktop and generates new key")
|
|
|
|
def step(context):
|
|
|
|
init_steps.a_user_lands_on_and_generates_new_key(context)
|
|
|
|
|
2022-11-17 14:06:36 +00:00
|
|
|
@When("the user signs up with username \"|any|\" and password \"|any|\"")
|
|
|
|
def step(context, username, password):
|
|
|
|
init_steps.the_user_signs_up(username, password)
|
2022-12-26 21:53:47 +00:00
|
|
|
|
|
|
|
@When("the user signs up again with username \"|any|\" and password \"|any|\"")
|
|
|
|
def step(context, username, password):
|
|
|
|
init_steps.the_user_signs_again_up(username, password)
|
2022-11-17 14:06:36 +00:00
|
|
|
|
|
|
|
@When("the user inputs username \"|any|\"")
|
2022-06-01 02:43:53 +00:00
|
|
|
def step(context, username):
|
2022-11-17 14:06:36 +00:00
|
|
|
the_user_inputs_username(username)
|
2022-08-03 17:31:59 +00:00
|
|
|
|
2022-11-17 14:06:36 +00:00
|
|
|
@When("the user inputs the seed phrase \"|any|\"")
|
2022-08-03 17:31:59 +00:00
|
|
|
def step(context, seed_phrase):
|
2022-11-17 14:06:36 +00:00
|
|
|
init_steps.the_user_inputs_the_seed_phrase(seed_phrase)
|
2022-10-13 16:03:10 +00:00
|
|
|
|
2022-11-17 14:06:36 +00:00
|
|
|
@When("the user logs in with password \"|any|\"")
|
2022-10-13 16:03:10 +00:00
|
|
|
def step(context, password: str):
|
|
|
|
_welcomeScreen.enter_password(password)
|
|
|
|
|
2022-11-17 14:06:36 +00:00
|
|
|
@When("the user inputs the new password \"|any|\"")
|
|
|
|
def step(context, password: str):
|
|
|
|
_welcomeScreen.type_new_password(password)
|
|
|
|
|
|
|
|
@When("the user inputs the new confirmation password \"|any|\"")
|
|
|
|
def step(context, password: str):
|
|
|
|
_welcomeScreen.type_confirm_password(password)
|
2022-10-13 16:03:10 +00:00
|
|
|
|
2022-12-16 18:24:51 +00:00
|
|
|
@When("the user lands on the signed in app")
|
|
|
|
def step(context):
|
|
|
|
the_user_lands_on_the_signed_in_app()
|
2023-05-30 10:24:04 +00:00
|
|
|
|
|
|
|
@When("the user maximizes the \"|any|\" application window")
|
|
|
|
def step(context, index):
|
|
|
|
init_steps.switch_aut_context(context, builtins.int(index)-1)
|
2022-12-16 18:24:51 +00:00
|
|
|
|
2022-10-13 16:03:10 +00:00
|
|
|
#########################
|
|
|
|
### VERIFICATIONS region:
|
|
|
|
#########################
|
2022-08-03 17:31:59 +00:00
|
|
|
|
2022-09-29 14:30:25 +00:00
|
|
|
@Then("the user lands on the signed in app")
|
|
|
|
def step(context):
|
2022-12-16 18:24:51 +00:00
|
|
|
the_user_lands_on_the_signed_in_app()
|
2022-09-29 14:30:25 +00:00
|
|
|
|
2022-08-03 17:31:59 +00:00
|
|
|
@Then("the invalid seed text is visible")
|
|
|
|
def step(context):
|
2022-08-12 13:19:16 +00:00
|
|
|
_welcomeScreen.seed_phrase_visible()
|
|
|
|
|
|
|
|
@Then("the user is online")
|
|
|
|
def step(context):
|
|
|
|
_mainScreen.user_is_online()
|
2022-08-18 07:38:47 +00:00
|
|
|
|
|
|
|
@Then("the profile navigation bar has the updated profile image")
|
|
|
|
def step(context):
|
2022-11-29 10:30:51 +00:00
|
|
|
_mainScreen.profile_image_is_updated()
|
|
|
|
filesMngr.delete_created_searchImage(context.userData["search_images"] + "profiletestimage.png")
|
|
|
|
filesMngr.delete_created_searchImage(context.userData["search_images"] + "loginUserName.png")
|
2022-10-13 16:03:10 +00:00
|
|
|
|
|
|
|
###########################################################################
|
|
|
|
### COMMON methods used in different steps given/when/then region:
|
|
|
|
###########################################################################
|
2022-11-17 14:06:36 +00:00
|
|
|
def the_user_inputs_username(username: str):
|
|
|
|
_welcomeScreen.input_username(username)
|
2022-12-16 18:24:51 +00:00
|
|
|
|
|
|
|
def the_user_lands_on_the_signed_in_app():
|
|
|
|
init_steps.the_user_lands_on_the_signed_in_app()
|