test(suite_settings): Updated bdd hooks and suite reorganization

- Created new test case `tst_signUpAndQuit`.
- Renamed `tst_settingsMenu` to `tst_mainSettingsSection`.
- Created specific `bdd_hooks.py` for test case `tst_mainSettingsSection` and `tst_userIdentity`.

Closes #8011
This commit is contained in:
Noelia 2022-11-16 13:06:37 +01:00 committed by Noelia
parent e2ff6f9029
commit ac89fc770b
14 changed files with 123 additions and 49 deletions

View File

@ -23,8 +23,9 @@ class SettingsSubsection(Enum):
ADVANCED: str = "10" + _SETTINGS_MENU_ITEM_OBJ_NAME
ABOUT: str = "11" + _EXTRA_MENU_ITEM_OBJ_NAME
COMMUNITY: str = "12" + _APP_MENU_ITEM_OBJ_NAME
SIGNOUT: str = "13" + _EXTRA_MENU_ITEM_OBJ_NAME
BACKUP_SEED: str = "14" + _MAIN_MENU_ITEM_OBJ_NAME
KEYCARD: str = "13" + _MAIN_MENU_ITEM_OBJ_NAME
SIGNOUT: str = "14" + _EXTRA_MENU_ITEM_OBJ_NAME
BACKUP_SEED: str = "15" + _MAIN_MENU_ITEM_OBJ_NAME
# Main:
navBarListView_Settings_navbar_StatusNavBarTabButton = {"checkable": True, "container": mainWindow_navBarListView_ListView, "objectName": "Settings-navbar", "type": "StatusNavBarTabButton", "visible": True}

View File

@ -20,15 +20,14 @@ def step(context):
@Given("the user lands on the signed in app")
def step(context):
the_user_lands_on_the_signed_in_app()
#########################
### ACTIONS region:
#########################
@When("user signs up with username \"|any|\" and password \"|any|\"")
@Given("the user signs up with username \"|any|\" and password \"|any|\"")
def step(context, username, password):
the_user_signs_up(username, password)
#########################
### ACTIONS region:
########################
@When("the user inputs username |any|")
def step(context, username):
_welcomeScreen.input_username(username)

View File

@ -17,8 +17,8 @@ Feature: Status Desktop login
Scenario Outline: User tries to login with a valid password
Given A first time user lands on the status desktop and generates new key
When user signs up with username "<username>" and password "<password>"
Then the user lands on the signed in app
And the user signs up with username "<username>" and password "<password>"
And the user lands on the signed in app
When the user restarts the app
And the user "<username>" logs in with password "<password>"
Then the user lands on the signed in app
@ -31,8 +31,8 @@ Feature: Status Desktop login
@merge
Scenario Outline: User tries to login with an invalid password
Given A first time user lands on the status desktop and generates new key
When user signs up with username "<username>" and password "<password>"
Then the user lands on the signed in app
And the user signs up with username "<username>" and password "<password>"
And the user lands on the signed in app
When the user restarts the app
And the user "<username>" logs in with password "<wrongpassword>"
Then the user is NOT able to login to Status Desktop application

View File

@ -16,8 +16,8 @@ Feature: Status Desktop Sign Up
Scenario: User signs up and signs in with password
Given A first time user lands on the status desktop and generates new key
When user signs up with username "tester123" and password "TesTEr16843/!@00"
Then the user lands on the signed in app
And the user signs up with username "tester123" and password "TesTEr16843/!@00"
And the user lands on the signed in app
@merge
@ -122,8 +122,8 @@ Feature: Status Desktop Sign Up
Given A first time user lands on the status desktop and navigates to import seed phrase
When The user inputs the seed phrase "<seed>"
And user clicks on the following ui-component seedPhraseView_Submit_Button
When user signs up with username "tester123" and password "TesTEr16843/!@00"
Then the user lands on the signed in app
Given the user signs up with username "tester123" and password "TesTEr16843/!@00"
And the user lands on the signed in app
Examples:
| seed | address |
| truth gold urban vital rose market legal release border gospel leave fame | 0x8672E2f1a7b28cda8bcaBb53B52c686ccB7735c3 |
@ -142,7 +142,7 @@ Feature: Status Desktop Sign Up
@merge
Scenario: After Signing up the Profile state should be online
Given A first time user lands on the status desktop and generates new key
When user signs up with username "tester123" and password "TesTEr16843/!@00"
And the user signs up with username "tester123" and password "TesTEr16843/!@00"
Then the user is online
@merge

View File

@ -1,6 +1,6 @@
AUT=nim_status_client
LANGUAGE=Python
OBJECTMAPSTYLE=script
TEST_CASES=tst_settingsMenu tst_userIdentity tst_languageSettings
TEST_CASES=tst_mainSettingsSection tst_userIdentity tst_languageSettings tst_signUpAndQuit
VERSION=3
WRAPPERS=Qt

View File

@ -17,8 +17,8 @@ Feature: Status Language Settings
Background:
Given A first time user lands on the status desktop and generates new key
When user signs up with username "tester123" and password "TesTEr16843/!@00"
Then the user lands on the signed in app
And the user signs up with username "tester123" and password "TesTEr16843/!@00"
And the user lands on the signed in app
When the user opens app settings screen
And the user clicks on Language & Currency
@ -60,7 +60,6 @@ Feature: Status Language Settings
#| Turkish | Türkçe |
# Each language run takes 30 seconds, so only some of them are enabled until we can parallelize executions
@merge
Scenario Outline: The user is able to search and select a specific language and after a restart, the language is kept
When the user opens the language selector
And the user searches the language <native>

View File

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# This file contains hook functions to run as the .feature file is executed
sys.path.append(os.path.join(os.path.dirname(__file__), "../../../testSuites/global_shared/"))
sys.path.append(os.path.join(os.path.dirname(__file__), "../../../src/"))
import steps.startupSteps as init_steps
# Global properties for the specific feature
_user = "tester123"
_password = "TesTEr16843/!@00"
@OnFeatureStart
def hook(context):
init_steps.context_init(context)
init_steps.signs_up_process_steps(context, _user, _password)
@OnFeatureEnd
def hook(context):
currentApplicationContext().detach()
snooze(_app_closure_timeout)
@OnStepEnd
def hook(context):
context.userData["step_name"] = context._data["text"]

View File

@ -1,54 +1,53 @@
Feature: Status Desktop Settings Menu
Feature: Status Desktop Main Settings Section
As a user I want to login the app go to Settings and go through all settings menu
checking the result of each menu item
As a user I want to login the app go to Settings and make basic settings actions like change my online state and/or store my seed phrase.
Background: Sign up and open settings section
Given A first time user lands on the status desktop and generates new key
When user signs up with username "tester123" and password "TesTEr16843/!@00"
Then the user lands on the signed in app
When the user opens app settings screen
The feature start sequence is the following (setup on its own `bdd_hooks`):
** given A first time user lands on the status desktop and generates new key
** when user signs up with username "tester123" and password "TesTEr16843/!@00"
** and the user lands on the signed in app
@merge @mayfail
Scenario: The user quits the app
When the user clicks on Sign out and Quit
Then the app is closed
Background: Open settings section
Given the user opens app settings screen
@merge @mayfail
Scenario: User can backup seed phrase
When the user activates wallet
# TODO: It must be reformulated or extracted to a different feature file bc preconditions of this feature file also include closing the backup seed phrase indicator at first instance
# so the validation is not providing relevant information
Scenario: The user can backup seed phrase
Given the user activates wallet
And the user opens the wallet settings
And the user backs up the wallet seed phrase
When the user backs up the wallet seed phrase
Then the backup seed phrase indicator is not displayed
@merge
Scenario: The user can switch state to offline
When the users switches state to offline
Then the user appears offline
When the user restarts the app
Given the user restarts the app
And the user "tester123" logs in with password "TesTEr16843/!@00"
Then the user appears offline
@merge
Scenario: The user can switch state to online
When the users switches state to offline
And the user restarts the app
And the user "tester123" logs in with password "TesTEr16843/!@00"
Then the user appears offline
When the users switches state to online
Then the user appears online
When the user restarts the app
And the user "tester123" logs in with password "TesTEr16843/!@00"
Then the user appears online
Scenario: The user can switch state to automatic
Scenario: The user can switch state to automatic
When the users switches state to automatic
Then the user status is automatic
When the user restarts the app
And the user "tester123" logs in with password "TesTEr16843/!@00"
Then the user status is automatic
Scenario: The user can change the password and login with new password
Scenario: The user can change the password and login with new password
When the user changes the password from TesTEr16843/!@00 to NewPassword@12345
And the user restarts the app
And the user "tester123" logs in with password "NewPassword@12345"

View File

@ -0,0 +1,8 @@
source(findFile('scripts', 'python/bdd.py'))
setupHooks('bdd_hooks.py')
collectStepDefinitions('./steps', '../shared/steps/', '../../global_shared/steps/', '../../suite_onboarding/shared/steps/')
def main():
testSettings.throwOnFailure = True
runFeatureFile('test.feature')

View File

@ -0,0 +1,15 @@
Feature: Status Desktop Sign out and Quit
As a user I want to login the app go to Settings and make basic settings actions related to extra settings settions (
The feature start sequence follows the global one (setup on global `bdd_hooks`): No additional steps
Background: Sign up and open settings section
Given A first time user lands on the status desktop and generates new key
And the user signs up with username "tester123" and password "TesTEr16843/!@00"
And the user lands on the signed in app
Given the user opens app settings screen
Scenario: The user quits the app
When the user clicks on Sign out and Quit
Then the app is closed

View File

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# This file contains hook functions to run as the .feature file is executed
sys.path.append(os.path.join(os.path.dirname(__file__), "../../../testSuites/global_shared/"))
sys.path.append(os.path.join(os.path.dirname(__file__), "../../../src/"))
import steps.startupSteps as init_steps
# Global properties for the specific feature
_user = "tester123"
_password = "TesTEr16843/!@00"
@OnFeatureStart
def hook(context):
init_steps.context_init(context)
init_steps.signs_up_process_steps(context, _user, _password)
@OnFeatureEnd
def hook(context):
currentApplicationContext().detach()
snooze(_app_closure_timeout)
@OnStepEnd
def hook(context):
context.userData["step_name"] = context._data["text"]

View File

@ -2,11 +2,13 @@ Feature: User Identity
As a user I want to set my identity, that is: display name, bio and social links.
Background: Sign up and land
Given A first time user lands on the status desktop and generates new key
When user signs up with username "tester123" and password "TesTEr16843/!@00"
Then the user lands on the signed in app
The feature start sequence is the following (setup on its own `bdd_hooks`):
** given A first time user lands on the status desktop and generates new key
** when user signs up with username "tester123" and password "TesTEr16843/!@00"
** and the user lands on the signed in app
# TODO: Scenario broken due to new user profile design. It will be addressed in task #8281
@mayfail
Scenario: User sets display name, bio and social links
When the user opens app settings screen
@ -26,8 +28,9 @@ Feature: User Identity
And the user's bio should be "Hello, I am super tester!"
And the user's social links should be: "twitter_handle", personal site: "status.im", "customLink": "customUrl"
@merge
Scenario: The user sets can change own display name in profile popup
# TODO: Scenario broken due to new user profile design. It will be addressed in task #8281
@mayfail
Scenario: The user can change own display name in profile popup
When the user opens own profile popup
Then in profile popup the user's display name should be "tester123"
When in profile popup the user sets display name to "tester123_changed"

View File

@ -1,6 +1,6 @@
source(findFile('scripts', 'python/bdd.py'))
setupHooks('../../global_shared/scripts/bdd_hooks.py')
setupHooks('bdd_hooks.py')
collectStepDefinitions('./steps', '../shared/steps/', '../../global_shared/steps/', '../../suite_onboarding/shared/steps/')
def main():