diff --git a/test/ui-test/testSuites/global_shared/steps/settingsSteps.py b/test/ui-test/testSuites/global_shared/steps/settingsSteps.py index 4d3a59e10b..4d4668c817 100644 --- a/test/ui-test/testSuites/global_shared/steps/settingsSteps.py +++ b/test/ui-test/testSuites/global_shared/steps/settingsSteps.py @@ -104,11 +104,11 @@ def step(context: any, account_name: str, password: str): _statusMain.open_settings() _settingsScreen.delete_account(account_name, password) -@When("the user selects the default account") +@When("the user selects the default Status account") def step(context: any): _settingsScreen.select_default_account() -@When("the user edits default account to \"|any|\" name and \"|any|\" color") +@When("the user edits default Status account to \"|any|\" name and \"|any|\" color") def step(context: any, account_name: str, account_color: str): _settingsScreen.edit_account(account_name, account_color) diff --git a/test/ui-test/testSuites/suite_wallet/shared/scripts/bdd_hooks.py b/test/ui-test/testSuites/suite_wallet/shared/scripts/bdd_hooks.py new file mode 100644 index 0000000000..b6636feb3a --- /dev/null +++ b/test/ui-test/testSuites/suite_wallet/shared/scripts/bdd_hooks.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +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.commonInitSteps as init_steps + +# This file contains hook functions to run as the .feature file is executed. +# +# A common use-case is to use the OnScenarioStart/OnScenarioEnd hooks to +# start and stop an AUT, e.g. +# +# @OnScenarioStart +# def hook(context): +# startApplication("addressbook") +# +# @OnScenarioEnd +# def hook(context): +# currentApplicationContext().detach() +# +# For the complete reference to this and similar available APIs +# (OnFeatureStart/OnFeatureEnd, OnStepStart/OnStepEnd) see the section +# 'Performing Actions During Test Execution Via Hooks' in the Squish manual: +# +# https://doc.qt.io/squish/behavior-driven-testing.html#performing-actions-during-test-execution-via-hooks + +# Detach (i.e. potentially terminate) all AUTs at the end of a scenario +@OnScenarioEnd +def hook(context): + init_steps.driver.detach() + diff --git a/test/ui-test/testSuites/suite_wallet/shared/steps/steps.py b/test/ui-test/testSuites/suite_wallet/shared/steps/steps.py new file mode 100644 index 0000000000..b77dc62d36 --- /dev/null +++ b/test/ui-test/testSuites/suite_wallet/shared/steps/steps.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +# A quick introduction to implementing scripts for BDD tests: +# +# This file contains snippets of script code to be executed as the .feature +# file is processed. See the section 'Behaviour Driven Testing' in the 'API +# Reference Manual' chapter of the Squish manual for a comprehensive reference. +# +# The decorators Given/When/Then/Step can be used to associate a script snippet +# with a pattern which is matched against the steps being executed. Optional +# table/multi-line string arguments of the step are passed via a mandatory +# 'context' parameter: +# +# @When("I enter the text") +# def whenTextEntered(context): +# +# +# The pattern is a plain string without the leading keyword, but a couple of +# placeholders including |any|, |word| and |integer| are supported which can be +# used to extract arbitrary, alphanumeric and integer values resp. from the +# pattern; the extracted values are passed as additional arguments: +# +# @Then("I get |integer| different names") +# def namesReceived(context, numNames): +# +# +# Instead of using a string with placeholders, a regular expression can be +# specified. In that case, make sure to set the (optional) 'regexp' argument +# to True. + +import names diff --git a/test/ui-test/testSuites/suite_wallet/suite.conf b/test/ui-test/testSuites/suite_wallet/suite.conf index 0002e634a4..1817815ad0 100644 --- a/test/ui-test/testSuites/suite_wallet/suite.conf +++ b/test/ui-test/testSuites/suite_wallet/suite.conf @@ -4,6 +4,6 @@ HOOK_SUB_PROCESSES=true IMPLICITAUTSTART=0 LANGUAGE=Python OBJECTMAPSTYLE=script -TEST_CASES=tst_wallet tst_transaction tst_wallet_section_accounts_management +TEST_CASES=tst_wallet_savedAddresses tst_wallet_transactions tst_wallet_accountsManagement tst_wallet_settingsManagement VERSION=3 WRAPPERS=Qt diff --git a/test/ui-test/testSuites/suite_wallet/tst_wallet_section_accounts_management/bdd_hooks.py b/test/ui-test/testSuites/suite_wallet/tst_wallet_accountsManagement/bdd_hooks.py similarity index 100% rename from test/ui-test/testSuites/suite_wallet/tst_wallet_section_accounts_management/bdd_hooks.py rename to test/ui-test/testSuites/suite_wallet/tst_wallet_accountsManagement/bdd_hooks.py diff --git a/test/ui-test/testSuites/suite_wallet/tst_wallet/config.xml b/test/ui-test/testSuites/suite_wallet/tst_wallet_accountsManagement/config.xml similarity index 100% rename from test/ui-test/testSuites/suite_wallet/tst_wallet/config.xml rename to test/ui-test/testSuites/suite_wallet/tst_wallet_accountsManagement/config.xml diff --git a/test/ui-test/testSuites/suite_wallet/tst_wallet_section_accounts_management/test.feature b/test/ui-test/testSuites/suite_wallet/tst_wallet_accountsManagement/test.feature similarity index 100% rename from test/ui-test/testSuites/suite_wallet/tst_wallet_section_accounts_management/test.feature rename to test/ui-test/testSuites/suite_wallet/tst_wallet_accountsManagement/test.feature diff --git a/test/ui-test/testSuites/suite_wallet/tst_transaction/test.py b/test/ui-test/testSuites/suite_wallet/tst_wallet_accountsManagement/test.py similarity index 65% rename from test/ui-test/testSuites/suite_wallet/tst_transaction/test.py rename to test/ui-test/testSuites/suite_wallet/tst_wallet_accountsManagement/test.py index b4eaa33146..685e000651 100644 --- a/test/ui-test/testSuites/suite_wallet/tst_transaction/test.py +++ b/test/ui-test/testSuites/suite_wallet/tst_wallet_accountsManagement/test.py @@ -1,7 +1,8 @@ source(findFile('scripts', 'python/bdd.py')) -setupHooks('bdd_hooks.py') -collectStepDefinitions('./steps', '../shared/steps/', '../../global_shared/steps/') +setupHooks('../../global_shared/scripts/bdd_hooks.py') +collectStepDefinitions('./steps', '../shared/steps/', '../../global_shared/steps/', + '../../suite_onboarding/shared/steps/', '../../suite_wallet/steps/') import configs diff --git a/test/ui-test/testSuites/suite_wallet/tst_wallet/bdd_hooks.py b/test/ui-test/testSuites/suite_wallet/tst_wallet_savedAddresses/bdd_hooks.py similarity index 100% rename from test/ui-test/testSuites/suite_wallet/tst_wallet/bdd_hooks.py rename to test/ui-test/testSuites/suite_wallet/tst_wallet_savedAddresses/bdd_hooks.py diff --git a/test/ui-test/testSuites/suite_wallet/tst_wallet_section_accounts_management/config.xml b/test/ui-test/testSuites/suite_wallet/tst_wallet_savedAddresses/config.xml similarity index 100% rename from test/ui-test/testSuites/suite_wallet/tst_wallet_section_accounts_management/config.xml rename to test/ui-test/testSuites/suite_wallet/tst_wallet_savedAddresses/config.xml diff --git a/test/ui-test/testSuites/suite_wallet/tst_wallet/test.feature b/test/ui-test/testSuites/suite_wallet/tst_wallet_savedAddresses/test.feature similarity index 64% rename from test/ui-test/testSuites/suite_wallet/tst_wallet/test.feature rename to test/ui-test/testSuites/suite_wallet/tst_wallet_savedAddresses/test.feature index 32a1d2cdf9..b199157a5c 100644 --- a/test/ui-test/testSuites/suite_wallet/tst_wallet/test.feature +++ b/test/ui-test/testSuites/suite_wallet/tst_wallet_savedAddresses/test.feature @@ -1,8 +1,6 @@ -Feature: Status Desktop Wallet +Feature: Wallet -> Saved addresses Management - As a user I want to use the wallet - The feature start sequence is the following (setup on its own `bdd_hooks`): Background: 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" @@ -10,21 +8,14 @@ Background: And the user opens the wallet section And the user accepts the signing phrase - ############################################# - # WALLET SECTION PART - ############################################# - Scenario Outline: The user can manage a saved address When the user adds a saved address named "" and address "
" And the user edits a saved address with name "" to "" Then the name "" is in the list of saved addresses - When the user deletes the saved address with name "" Then the name "" is not in the list of saved addresses - When the user adds a saved address named "" and ENS name "" Then the name "" is in the list of saved addresses - # Test for toggling favourite button is disabled until favourite functionality is enabled # When the user adds a saved address named "" and address "
" # And the user toggles favourite for the saved address with name "" @@ -32,15 +23,8 @@ Background: Examples: | name | address | new_name | ens_name | | bar | 0x8397bc3c5a60a1883174f722403d63a8833312b7 | foo | status.eth | - - - ############################################# - # WALLET SETTINGS PART - ############################################# - - Scenario: The user edits the default account - Given the user opens app settings screen - And the user opens the wallet settings - When the user selects the default account - And the user edits default account to "Default" name and "#f6af3c" color - Then the default account is updated to be named "DefaultStatus account" with color "#f6af3c" + # TODO: add saved address with all the networks + # TODO: actions from burger menu + # TODO: split the scenario above to several (exlude delete i think) + # TODO: enhance edit actions to change networks + # TODO: test for Share button \ No newline at end of file diff --git a/test/ui-test/testSuites/suite_wallet/tst_wallet/test.py b/test/ui-test/testSuites/suite_wallet/tst_wallet_savedAddresses/test.py similarity index 100% rename from test/ui-test/testSuites/suite_wallet/tst_wallet/test.py rename to test/ui-test/testSuites/suite_wallet/tst_wallet_savedAddresses/test.py diff --git a/test/ui-test/testSuites/suite_wallet/tst_wallet/verificationPoints/can_see_collectibles_for_an_account/when_the_user_accepts_the_signing_phrase_YugaLabs_0xA858DDc0445d8131daC4d1DE01f834ffcbA52Ef1 b/test/ui-test/testSuites/suite_wallet/tst_wallet_savedAddresses/verificationPoints/can_see_collectibles_for_an_account/when_the_user_accepts_the_signing_phrase_YugaLabs_0xA858DDc0445d8131daC4d1DE01f834ffcbA52Ef1 similarity index 100% rename from test/ui-test/testSuites/suite_wallet/tst_wallet/verificationPoints/can_see_collectibles_for_an_account/when_the_user_accepts_the_signing_phrase_YugaLabs_0xA858DDc0445d8131daC4d1DE01f834ffcbA52Ef1 rename to test/ui-test/testSuites/suite_wallet/tst_wallet_savedAddresses/verificationPoints/can_see_collectibles_for_an_account/when_the_user_accepts_the_signing_phrase_YugaLabs_0xA858DDc0445d8131daC4d1DE01f834ffcbA52Ef1 diff --git a/test/ui-test/testSuites/suite_wallet/tst_wallet/verificationPoints/user_can_toggle_network_and_see_balances/and_the_user_opens_wallet_screen_one_0x5fFa75CE51c3a7ebE23BdE37b5E3A0143DfBceE0 b/test/ui-test/testSuites/suite_wallet/tst_wallet_savedAddresses/verificationPoints/user_can_toggle_network_and_see_balances/and_the_user_opens_wallet_screen_one_0x5fFa75CE51c3a7ebE23BdE37b5E3A0143DfBceE0 similarity index 100% rename from test/ui-test/testSuites/suite_wallet/tst_wallet/verificationPoints/user_can_toggle_network_and_see_balances/and_the_user_opens_wallet_screen_one_0x5fFa75CE51c3a7ebE23BdE37b5E3A0143DfBceE0 rename to test/ui-test/testSuites/suite_wallet/tst_wallet_savedAddresses/verificationPoints/user_can_toggle_network_and_see_balances/and_the_user_opens_wallet_screen_one_0x5fFa75CE51c3a7ebE23BdE37b5E3A0143DfBceE0 diff --git a/test/ui-test/testSuites/suite_wallet/tst_wallet_settingsManagement/test.feature b/test/ui-test/testSuites/suite_wallet/tst_wallet_settingsManagement/test.feature new file mode 100644 index 0000000000..fa6f0559fd --- /dev/null +++ b/test/ui-test/testSuites/suite_wallet/tst_wallet_settingsManagement/test.feature @@ -0,0 +1,16 @@ +Feature: Settings -> Wallet + + +Background: + 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 + And the user opens the wallet section + And the user accepts the signing phrase + + Scenario: The user edits the default account + Given the user opens app settings screen + And the user opens the wallet settings + When the user selects the default Status account + And the user edits default Status account to "Default" name and "#f6af3c" color + Then the default account is updated to be named "DefaultStatus account" with color "#f6af3c" \ No newline at end of file diff --git a/test/ui-test/testSuites/suite_wallet/tst_wallet_section_accounts_management/test.py b/test/ui-test/testSuites/suite_wallet/tst_wallet_settingsManagement/test.py similarity index 55% rename from test/ui-test/testSuites/suite_wallet/tst_wallet_section_accounts_management/test.py rename to test/ui-test/testSuites/suite_wallet/tst_wallet_settingsManagement/test.py index 1ac7b80b1d..ec85dfabf8 100644 --- a/test/ui-test/testSuites/suite_wallet/tst_wallet_section_accounts_management/test.py +++ b/test/ui-test/testSuites/suite_wallet/tst_wallet_settingsManagement/test.py @@ -1,7 +1,8 @@ source(findFile('scripts', 'python/bdd.py')) -setupHooks('bdd_hooks.py') -collectStepDefinitions('./steps', '../shared/steps/', '../../global_shared/steps/', '../../suite_onboarding/shared/steps/') +setupHooks('../../global_shared/scripts/bdd_hooks.py') +collectStepDefinitions('./steps', '../shared/steps/', '../../global_shared/steps/', + '../../suite_onboarding/shared/steps/', '../../suite_wallet/steps/') import configs @@ -10,4 +11,4 @@ def main(): testSettings.throwOnFailure = True configs.path.TMP.mkdir(parents=True, exist_ok=True) runFeatureFile('test.feature') - configs.path.TMP.rmtree(ignore_errors=True) + configs.path.TMP.rmtree(ignore_errors=True) \ No newline at end of file diff --git a/test/ui-test/testSuites/suite_wallet/tst_transaction/bdd_hooks.py b/test/ui-test/testSuites/suite_wallet/tst_wallet_transactions/bdd_hooks.py similarity index 100% rename from test/ui-test/testSuites/suite_wallet/tst_transaction/bdd_hooks.py rename to test/ui-test/testSuites/suite_wallet/tst_wallet_transactions/bdd_hooks.py diff --git a/test/ui-test/testSuites/suite_wallet/tst_transaction/test.feature b/test/ui-test/testSuites/suite_wallet/tst_wallet_transactions/test.feature similarity index 100% rename from test/ui-test/testSuites/suite_wallet/tst_transaction/test.feature rename to test/ui-test/testSuites/suite_wallet/tst_wallet_transactions/test.feature diff --git a/test/ui-test/testSuites/suite_wallet/tst_wallet_transactions/test.py b/test/ui-test/testSuites/suite_wallet/tst_wallet_transactions/test.py new file mode 100644 index 0000000000..ec85dfabf8 --- /dev/null +++ b/test/ui-test/testSuites/suite_wallet/tst_wallet_transactions/test.py @@ -0,0 +1,14 @@ +source(findFile('scripts', 'python/bdd.py')) + +setupHooks('../../global_shared/scripts/bdd_hooks.py') +collectStepDefinitions('./steps', '../shared/steps/', '../../global_shared/steps/', + '../../suite_onboarding/shared/steps/', '../../suite_wallet/steps/') + +import configs + + +def main(): + testSettings.throwOnFailure = True + configs.path.TMP.mkdir(parents=True, exist_ok=True) + runFeatureFile('test.feature') + configs.path.TMP.rmtree(ignore_errors=True) \ No newline at end of file