2022-11-21 12:56:06 +00:00
|
|
|
import steps.commonInitSteps as init_steps
|
2022-06-29 01:12:35 +00:00
|
|
|
from screens.SettingsScreen import SettingsScreen
|
2022-08-11 13:27:13 +00:00
|
|
|
from screens.StatusLanguageScreen import StatusLanguageScreen
|
2023-04-24 09:39:07 +00:00
|
|
|
from screens.StatusMainScreen import StatusMainScreen
|
2022-06-29 01:12:35 +00:00
|
|
|
|
|
|
|
_statusMain = StatusMainScreen()
|
2022-07-21 12:15:02 +00:00
|
|
|
_settingsScreen = SettingsScreen()
|
2022-08-11 13:27:13 +00:00
|
|
|
_languageScreen = StatusLanguageScreen()
|
2022-06-29 01:12:35 +00:00
|
|
|
|
2022-10-13 16:03:10 +00:00
|
|
|
#########################
|
|
|
|
### PRECONDITIONS region:
|
|
|
|
#########################
|
|
|
|
|
|
|
|
@Given("the user opens app settings screen")
|
|
|
|
def step(context: any):
|
|
|
|
the_user_opens_app_settings_screen()
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-10-13 16:03:10 +00:00
|
|
|
@Given("the user opens the messaging settings")
|
|
|
|
def step(context: any):
|
|
|
|
the_user_opens_the_messaging_settings()
|
2022-11-30 09:20:25 +00:00
|
|
|
|
2023-03-17 11:39:50 +00:00
|
|
|
@Given("the user opens the wallet section")
|
2022-10-21 07:17:48 +00:00
|
|
|
def step(context: any):
|
2023-03-17 11:39:50 +00:00
|
|
|
init_steps.the_user_opens_the_wallet_section()
|
|
|
|
|
2022-10-21 07:17:48 +00:00
|
|
|
@Given("the user toggles test networks")
|
|
|
|
def step(context: any):
|
2022-11-21 12:56:06 +00:00
|
|
|
init_steps.the_user_toggles_test_networks()
|
2022-10-21 07:17:48 +00:00
|
|
|
|
|
|
|
@Given("the user opens the wallet settings")
|
|
|
|
def step(context: any):
|
|
|
|
the_user_opens_the_wallet_settings()
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-12-16 18:24:51 +00:00
|
|
|
@Given("the user opens the profile settings")
|
|
|
|
def step(context: any):
|
|
|
|
the_user_opens_the_profile_settings()
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-12-16 18:24:51 +00:00
|
|
|
@Given("the user's display name is \"|any|\"")
|
|
|
|
def step(context, display_name: str):
|
|
|
|
if "popup" in context.userData["scenario_name"]:
|
|
|
|
the_user_display_name_in_profile_popup_is(display_name)
|
|
|
|
else:
|
2023-03-17 11:39:50 +00:00
|
|
|
the_user_display_name_is(display_name)
|
|
|
|
|
2022-12-16 18:24:51 +00:00
|
|
|
@Given("the user's bio is empty")
|
|
|
|
def step(context):
|
2023-04-24 09:39:07 +00:00
|
|
|
_settingsScreen.profile_settings.verify_bio("")
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-12-16 18:24:51 +00:00
|
|
|
@Given("the user's social links are empty")
|
|
|
|
def step(context):
|
2023-04-24 09:39:07 +00:00
|
|
|
_settingsScreen.profile_settings.verify_social_no_links()
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-12-16 18:24:51 +00:00
|
|
|
@Given("the user opens own profile popup")
|
|
|
|
def step(context: any):
|
|
|
|
the_user_opens_own_profile_popup()
|
2023-03-15 12:53:56 +00:00
|
|
|
|
|
|
|
@Given("Application Settings \"|any|\" is open")
|
|
|
|
def step(context: any, settings_type:str):
|
|
|
|
#TODO: Implement parameters for settings
|
|
|
|
_settingsScreen.open_advanced_settings()
|
|
|
|
|
|
|
|
@Given("\"|any|\" is toggled on under Experimental features")
|
|
|
|
def step(context: any, settings_type:str):
|
2023-04-26 16:22:57 +00:00
|
|
|
_settingsScreen.toggle_experimental_feature(settings_type)
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2023-05-03 16:24:21 +00:00
|
|
|
@Given("the user opens the community named \"|any|\"")
|
|
|
|
def step(context, community_name:str):
|
|
|
|
_settingsScreen.open_community(community_name)
|
|
|
|
|
2022-10-13 16:03:10 +00:00
|
|
|
#########################
|
|
|
|
### ACTIONS region:
|
|
|
|
#########################
|
2022-06-29 01:12:35 +00:00
|
|
|
|
2022-11-30 09:20:25 +00:00
|
|
|
@When("the user activates the link preview if it is deactivated")
|
|
|
|
def step(context: any):
|
|
|
|
_settingsScreen.activate_link_preview_if_dectivated()
|
|
|
|
|
|
|
|
@When("the user activates tenor GIFs preview")
|
|
|
|
def step(context: any):
|
|
|
|
_settingsScreen.the_user_activates_tenor_gif_preview()
|
|
|
|
|
2022-06-29 01:12:35 +00:00
|
|
|
@When("the user opens app settings screen")
|
2022-07-07 23:56:21 +00:00
|
|
|
def step(context: any):
|
2022-10-13 16:03:10 +00:00
|
|
|
the_user_opens_app_settings_screen()
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-08-12 12:11:57 +00:00
|
|
|
@When("the user opens the messaging settings")
|
|
|
|
def step(context: any):
|
2022-10-13 16:03:10 +00:00
|
|
|
the_user_opens_the_messaging_settings()
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-12-26 21:53:47 +00:00
|
|
|
@When("the user opens the contacts settings")
|
|
|
|
def step(context: any):
|
|
|
|
the_user_opens_the_contact_settings()
|
2022-09-15 16:32:14 +00:00
|
|
|
|
|
|
|
@When("the user activates image unfurling")
|
|
|
|
def step(context: any):
|
|
|
|
_settingsScreen.activate_image_unfurling()
|
2022-10-21 07:17:48 +00:00
|
|
|
|
|
|
|
@When("the user opens the wallet settings")
|
2022-07-07 23:56:21 +00:00
|
|
|
def step(context: any):
|
2022-10-21 07:17:48 +00:00
|
|
|
the_user_opens_the_wallet_settings()
|
2022-07-20 08:18:27 +00:00
|
|
|
|
2023-07-26 10:23:27 +00:00
|
|
|
@When("the user adds a generated account with \"|any|\" color \"|any|\" and emoji \"|any|\" in Settings")
|
|
|
|
def step(context, name, color, emoji):
|
|
|
|
account_popup = _settingsScreen.open_add_new_account_popup()
|
|
|
|
account_popup.set_name(name).set_emoji(emoji).set_color(color).save()
|
|
|
|
AuthenticatePopup().wait_until_appears().authenticate()
|
|
|
|
account_popup.wait_until_hidden()
|
|
|
|
|
|
|
|
@Then("the account is present with \"|any|\" and \"|any|\" and emoji unicode \"|any|\" in the accounts list in Settings")
|
|
|
|
def step(context: any, account_name, color, emoji):
|
|
|
|
_settingsScreen._find_account_index(account_name)
|
|
|
|
|
|
|
|
|
2023-02-03 12:22:02 +00:00
|
|
|
@When("the user deletes the account \"|any|\" with password \"|any|\"")
|
|
|
|
def step(context: any, account_name: str, password: str):
|
2022-07-20 08:18:27 +00:00
|
|
|
_statusMain.open_settings()
|
2023-02-03 12:22:02 +00:00
|
|
|
_settingsScreen.delete_account(account_name, password)
|
2022-08-10 09:23:06 +00:00
|
|
|
|
2023-06-07 12:19:04 +00:00
|
|
|
@When("the user selects the default Status account")
|
2022-08-10 09:23:06 +00:00
|
|
|
def step(context: any):
|
|
|
|
_settingsScreen.select_default_account()
|
|
|
|
|
2023-06-07 12:19:04 +00:00
|
|
|
@When("the user edits default Status account to \"|any|\" name and \"|any|\" color")
|
2022-08-10 09:23:06 +00:00
|
|
|
def step(context: any, account_name: str, account_color: str):
|
|
|
|
_settingsScreen.edit_account(account_name, account_color)
|
|
|
|
|
2022-10-21 07:17:48 +00:00
|
|
|
@When("the user registers a random ens name with password \"|any|\"")
|
2022-08-09 13:52:17 +00:00
|
|
|
def step(context, password):
|
|
|
|
_statusMain.open_settings()
|
|
|
|
_settingsScreen.register_random_ens_name(password)
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-08-11 13:27:13 +00:00
|
|
|
@When("the user clicks on Language & Currency")
|
|
|
|
def step(context):
|
2023-03-17 11:39:50 +00:00
|
|
|
_settingsScreen.open_language_and_currency_settings()
|
2022-08-11 13:27:13 +00:00
|
|
|
_languageScreen.is_screen_loaded()
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-08-11 13:27:13 +00:00
|
|
|
@When("the user opens the language selector")
|
|
|
|
def step(context):
|
|
|
|
_languageScreen.open_language_combobox()
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-08-11 13:27:13 +00:00
|
|
|
@When("the user selects the language |any|")
|
|
|
|
def step(context, native):
|
|
|
|
_languageScreen.select_language(native)
|
|
|
|
snooze(5) # TODO: Wait until language has changed
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-08-11 13:27:13 +00:00
|
|
|
@When("the user searches the language |any|")
|
|
|
|
def step(context, native):
|
|
|
|
_languageScreen.search_language(native)
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-08-10 10:57:21 +00:00
|
|
|
@When("the user clicks on Sign out and Quit")
|
|
|
|
def step(context: any):
|
2023-05-03 16:23:12 +00:00
|
|
|
_settingsScreen.menu.sign_out_and_quit()
|
2023-03-17 11:39:50 +00:00
|
|
|
|
|
|
|
@Given("the user opens the communities settings")
|
2022-08-11 12:24:49 +00:00
|
|
|
@When("the user opens the communities settings")
|
|
|
|
def step(context: any):
|
|
|
|
_settingsScreen.open_communities_section()
|
|
|
|
|
2023-01-25 12:16:58 +00:00
|
|
|
@When("the user leaves \"|any|\" community")
|
|
|
|
def step(context: any, communityName):
|
|
|
|
_settingsScreen.leave_community(communityName)
|
2022-08-12 15:51:33 +00:00
|
|
|
|
|
|
|
@When("the user opens the profile settings")
|
|
|
|
def step(context: any):
|
2022-12-16 18:24:51 +00:00
|
|
|
the_user_opens_the_profile_settings()
|
2022-08-12 15:51:33 +00:00
|
|
|
|
|
|
|
@When("the user sets display name to \"|any|\"")
|
2023-03-17 11:39:50 +00:00
|
|
|
def step(context, display_name):
|
2023-04-24 09:39:07 +00:00
|
|
|
_settingsScreen.profile_settings.display_name = display_name
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-10-13 16:03:10 +00:00
|
|
|
@When("the user backs up the wallet seed phrase")
|
|
|
|
def step(context):
|
|
|
|
_settingsScreen.check_backup_seed_phrase_workflow()
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2023-04-24 09:39:07 +00:00
|
|
|
|
2022-12-16 18:24:51 +00:00
|
|
|
@When("the user sets social links to:")
|
|
|
|
def step(context):
|
2023-04-24 09:39:07 +00:00
|
|
|
profile_settings = _settingsScreen.profile_settings
|
|
|
|
profile_settings.social_links = context.table
|
|
|
|
profile_settings.save_changes()
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-10-13 16:03:10 +00:00
|
|
|
@When("the user sets bio to \"|any|\"")
|
|
|
|
def step(context, bio):
|
2023-04-24 09:39:07 +00:00
|
|
|
_settingsScreen.profile_settings.bio = bio
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-10-13 16:03:10 +00:00
|
|
|
@When("the users switches state to offline")
|
|
|
|
def step(context: any):
|
|
|
|
_statusMain.set_user_state_offline()
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-10-13 16:03:10 +00:00
|
|
|
@When("the users switches state to online")
|
|
|
|
def step(context: any):
|
|
|
|
_statusMain.set_user_state_online()
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-10-13 16:03:10 +00:00
|
|
|
@When("the users switches state to automatic")
|
|
|
|
def step(context: any):
|
|
|
|
_statusMain.set_user_state_to_automatic()
|
|
|
|
|
|
|
|
@When("the user changes the password from |any| to |any|")
|
|
|
|
def step(context: any, oldPassword: str, newPassword: str):
|
2023-04-24 09:39:07 +00:00
|
|
|
_settingsScreen.profile_settings.open_change_password_popup().change_password(oldPassword, newPassword)
|
2022-10-13 16:03:10 +00:00
|
|
|
|
2022-10-26 20:00:40 +00:00
|
|
|
@When("the user sends a contact request to the chat key \"|any|\" with the reason \"|any|\"")
|
|
|
|
def step(context: any, chat_key: str, reason: str):
|
|
|
|
_settingsScreen.add_contact_by_chat_key(chat_key, reason)
|
2022-12-26 21:53:47 +00:00
|
|
|
|
|
|
|
@When("the user sends a contact request with the reason \"|any|\"")
|
|
|
|
def step(context: any, reason: str):
|
|
|
|
_settingsScreen.send_contact_request_via_profile_popup(reason)
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-12-16 18:24:51 +00:00
|
|
|
@When("the user opens own profile popup")
|
|
|
|
def step(context: any):
|
|
|
|
the_user_opens_own_profile_popup()
|
|
|
|
|
|
|
|
@When("the user navigates to edit profile")
|
|
|
|
def step(context: any):
|
|
|
|
_statusMain.navigate_to_edit_profile()
|
2022-10-26 20:00:40 +00:00
|
|
|
|
2022-12-26 21:53:47 +00:00
|
|
|
@When("the user closes the popup")
|
2023-03-17 11:39:50 +00:00
|
|
|
def step(context: any):
|
2022-12-26 21:53:47 +00:00
|
|
|
_statusMain.close_popup()
|
|
|
|
|
2022-10-13 16:03:10 +00:00
|
|
|
#########################
|
|
|
|
### VERIFICATIONS region:
|
|
|
|
#########################
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-10-13 16:03:10 +00:00
|
|
|
@Then("the address |any| is displayed in the wallet")
|
|
|
|
def step(context: any, address: str):
|
|
|
|
_settingsScreen.verify_address(address)
|
|
|
|
|
2022-10-21 07:17:48 +00:00
|
|
|
@Then("the account \"|any|\" is not in the list of accounts")
|
2022-10-13 16:03:10 +00:00
|
|
|
def step(context: any, account_name):
|
2023-03-17 11:39:50 +00:00
|
|
|
_settingsScreen.verify_no_account(account_name)
|
2022-10-13 16:03:10 +00:00
|
|
|
|
2022-10-21 07:17:48 +00:00
|
|
|
@Then("the default account is updated to be named \"|any|\" with color \"|any|\"")
|
2022-10-13 16:03:10 +00:00
|
|
|
def step(context, new_name: str, new_color: str):
|
|
|
|
_settingsScreen.verify_editedAccount(new_name, new_color)
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-10-13 16:03:10 +00:00
|
|
|
@Then("the app is closed")
|
|
|
|
def step(context: any):
|
|
|
|
_settingsScreen.verify_the_app_is_closed()
|
2022-08-12 15:51:33 +00:00
|
|
|
|
2022-12-16 18:24:51 +00:00
|
|
|
@Then("the user's display name is \"|any|\"")
|
|
|
|
def step(context, display_name: str):
|
|
|
|
if "popup" in context.userData["scenario_name"]:
|
|
|
|
the_user_display_name_in_profile_popup_is(display_name)
|
|
|
|
else:
|
|
|
|
the_user_display_name_is(display_name)
|
2022-08-12 15:51:33 +00:00
|
|
|
|
2022-12-16 18:24:51 +00:00
|
|
|
@Then("the user's bio is \"|any|\"")
|
2022-08-12 15:51:33 +00:00
|
|
|
def step(context, bio):
|
2023-04-24 09:39:07 +00:00
|
|
|
_settingsScreen.profile_settings.verify_bio(bio)
|
2022-08-12 15:51:33 +00:00
|
|
|
|
2022-12-16 18:24:51 +00:00
|
|
|
@Then("the user's social links are:")
|
2022-08-12 15:51:33 +00:00
|
|
|
def step(context):
|
2023-04-24 09:39:07 +00:00
|
|
|
_settingsScreen.profile_settings.verify_social_links(context.table)
|
2022-08-11 13:27:13 +00:00
|
|
|
|
|
|
|
@Then("the application displays |any| as the selected language")
|
|
|
|
def step(context, native):
|
|
|
|
_languageScreen.verify_current_language(native)
|
2023-03-17 11:39:50 +00:00
|
|
|
# TODO: Verify some texts have been changed in the application (not done now bc translations are inconsistent
|
2022-08-16 16:35:10 +00:00
|
|
|
# and not all expected languages have the same texts translated
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-08-16 16:35:10 +00:00
|
|
|
@Then("the backup seed phrase indicator is not displayed")
|
|
|
|
def step(context):
|
|
|
|
_settingsScreen.verify_seed_phrase_indicator_not_visible()
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-08-12 16:31:39 +00:00
|
|
|
@Then("the user appears offline")
|
|
|
|
def step(context: any):
|
|
|
|
_statusMain.user_is_offline()
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-08-12 16:31:39 +00:00
|
|
|
@Then("the user appears online")
|
|
|
|
def step(context: any):
|
|
|
|
_statusMain.user_is_online()
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-08-12 16:31:39 +00:00
|
|
|
@Then("the user status is automatic")
|
|
|
|
def step(context: any):
|
2023-03-17 11:39:50 +00:00
|
|
|
_statusMain.user_is_set_to_automatic()
|
2022-08-29 18:03:50 +00:00
|
|
|
|
2022-10-26 20:00:40 +00:00
|
|
|
@Then("the contact request for chat key \"|any|\" is present in the pending requests tab")
|
|
|
|
def step(context, chat_key: str):
|
|
|
|
_settingsScreen.verify_contact_request(chat_key)
|
2022-12-26 21:53:47 +00:00
|
|
|
|
|
|
|
@Then("a contact request is present in the sent pending requests tab")
|
|
|
|
def step(context):
|
|
|
|
_settingsScreen.verify_there_is_a_sent_contact_request()
|
|
|
|
|
|
|
|
@Then("a contact request is present in the received pending requests tab")
|
|
|
|
def step(context):
|
|
|
|
_settingsScreen.verify_there_is_a_received_contact_request()
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2023-03-15 12:53:56 +00:00
|
|
|
@Then("the user opens the community named \"|any|\"")
|
|
|
|
def step(context, community_name:str):
|
|
|
|
_settingsScreen.open_community(community_name)
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-10-13 16:03:10 +00:00
|
|
|
###########################################################################
|
|
|
|
### COMMON methods used in different steps given/when/then region:
|
2023-03-17 11:39:50 +00:00
|
|
|
###########################################################################
|
|
|
|
|
2022-10-13 16:03:10 +00:00
|
|
|
def the_user_opens_app_settings_screen():
|
2022-11-21 12:56:06 +00:00
|
|
|
init_steps.the_user_opens_app_settings_screen()
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-10-13 16:03:10 +00:00
|
|
|
def the_user_opens_the_messaging_settings():
|
2022-10-21 07:17:48 +00:00
|
|
|
_settingsScreen.open_messaging_settings()
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-12-26 21:53:47 +00:00
|
|
|
def the_user_opens_the_contact_settings():
|
|
|
|
_settingsScreen.open_contacts_settings()
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-10-21 07:17:48 +00:00
|
|
|
def the_user_opens_the_wallet_settings():
|
2023-01-23 10:24:58 +00:00
|
|
|
_settingsScreen.open_wallet_settings()
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-12-16 18:24:51 +00:00
|
|
|
def the_user_opens_the_profile_settings():
|
2023-04-24 09:39:07 +00:00
|
|
|
_settingsScreen.profile_settings
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-12-16 18:24:51 +00:00
|
|
|
def the_user_display_name_is(display_name: str):
|
2023-04-24 09:39:07 +00:00
|
|
|
_settingsScreen.profile_settings.verify_display_name(display_name)
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-12-16 18:24:51 +00:00
|
|
|
def the_user_display_name_in_profile_popup_is(display_name: str):
|
|
|
|
_statusMain.verify_profile_popup_display_name(display_name)
|
2023-03-17 11:39:50 +00:00
|
|
|
|
2022-12-16 18:24:51 +00:00
|
|
|
def the_user_opens_own_profile_popup():
|
2023-03-17 11:39:50 +00:00
|
|
|
_statusMain.open_own_profile_popup()
|