Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[engine] Do not allow to overwrite default composite paths #3436

Merged
merged 1 commit into from
Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions docs/modules/ROOT/pages/tests-configuration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ NOTE: The properties marked with *bold* are mandatory.
|`report.text-length-diff-threshold`
|`100`
|Defines text threshold length to enable unified diff report publishing on failure, for variable comparisons. If you want to have this report despite the size of the compared data set 0.

|`engine.composite-paths`
ikalinin1 marked this conversation as resolved.
Show resolved Hide resolved
|<empty>
|Paths to the composite steps e.g. `steps/*.steps`
|===

=== Profiles
Expand Down Expand Up @@ -726,6 +730,43 @@ http.auth.password=ENC(WVnXhzG704KRZZFYL7hfpA4YoSm8V2F5eNXyr7CRYCichteHvNS3nB23z

Please see <<_externalized_configuration>> to get more information about how encryptor password can be passed to the tests.

== Composite steps

https://jbehave.org/reference/stable/composite-steps.html[Composite steps] allow to reuse set of actions via custom steps with own wordings.

=== How to use composite steps

. Define composite step in `*.steps` file, e.g. `steps/ui/my-app.steps`:
+
.Compsite step definition
[source,gherkin]
----
Composite: When I login with username `$username` and password `$password`
When I enter `<username>` in field located by `id(username)`
When I enter `<password>` in field located by `id(password)`
When I click on element located by `id(signInButton)`
----

. Configure paths to files with custom steps:
+
.Compsite steps paths configuration
[source,gherkin]
----
engine.composite-paths=steps/ui/*.steps
----

. Use your step in the story:
+
.Composite step usage example
[source,gherkin]
----
Scenario: Verify login
Given I am on the main application page
When I login with username `admin` and password `pa$$w0rd`
----

TIP: Users are allowed to use composite steps in composite step definition.

== Steps aliases

VIVIDUS allows to define set of aliases for steps in JSON format and then use them in stories.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<property name="storyLoader" ref="storyLoader" />
<property name="storyReporterBuilder" ref="storyReporterBuilder" />
<property name="placeholderResolver" ref="placeholderResolver" />
<property name="compositePaths" value="${bdd.configuration.all-composite-paths}"/>
<property name="compositePaths" value="${engine.composite-paths},steps/defaults/*.steps"/>
<property name="aliasPaths" value="${engine.alias-paths}"/>
<property name="storyControls" ref="springStoryControls" />
<property name="parallelStoryExamplesEnabled" value="${bdd.configuration.parallel-story-examples-enabled}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ batch-1.threads=2
batch-2.resource-location=story/integration/failFast
batch-2.resource-include-patterns=Should not be executed.story

bdd.configuration.composite-paths=steps/*.steps
engine.composite-paths=steps/*.steps
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
csv.escape-char=\\
bdd.configuration.skip-story-if-given-story-failed=true
bdd.configuration.composite-paths=steps/*.steps
engine.composite-paths=steps/*.steps
rest-api.http.cookie-store-level=scenario

variables.examples-table-path=/data/tables/locales/ca/locale-based.table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ batch.fail-fast=false
story.fail-fast=false
scenario.fail-fast=false

bdd.configuration.all-composite-paths=${bdd.configuration.composite-paths},steps/defaults/*.steps
bdd.configuration.composite-paths=
engine.composite-paths=
engine.alias-paths=
bdd.configuration.formats=
bdd.configuration.dry-run=false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ bdd\\.story-loader\\.batch-(\\d+)(.+)=batch-$1$2
bdd\\.batch-(\\d+)(.+)=batch-$1$2
bdd\\.variables\\.global\\.(.+)=variables.$1
bdd\\.variables\\.batch-(\\d+)\\.(.+)=batch-$1.variables.$2
bdd.configuration.composite-paths=engine.composite-paths
bdd.configuration.all-composite-paths=bdd.configuration.composite-paths