Skip to content

Commit

Permalink
[engine] Do not allow to overwrite default composite paths
Browse files Browse the repository at this point in the history
  • Loading branch information
ikalinin1 committed Dec 7, 2022
1 parent 85c038b commit 578b56b
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 5 deletions.
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`
|<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] allows to reuse set of actions via step with a custom wording.

=== How to use composite steps

. Define composite step:
+
.Compsite step definition
[source,gherkin]
----
Composite: When I login with username `$username` and password `$password`
When I enter `<username>` in field located `id(username)`
When I enter `<password>` in field located `id(password)`
When I click on element located `id(signInButton)`
----

. Configure composite paths
+
.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

bdd.variables.global.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 @@ -3,3 +3,4 @@ bdd.story.fail-fast=story.fail-fast
bdd.scenario.fail-fast=scenario.fail-fast
bdd.story-loader.batch-(\\d+)(.+)=batch-$1$2
bdd.batch-(\\d+)(.+)=batch-$1$2
bdd.configuration.composite-paths=engine.composite-paths

0 comments on commit 578b56b

Please sign in to comment.