Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languageyml
titleapplication.yml
linenumberstrue
accountManagement:
  registration:
    emailRegistrationEnabled: true
    phoneRegistrationEnabled: true

...

Code Block
languagexml
titlescenario.xml
...
<configuration comment="Disabling registration via phone, enabling registration via email">
    <property path="accountManagement.registration.phoneRegistrationEnabled" value="false"/>
    <property path="accountManagement.registration.emailRegistrationEnabled" value="truefalse"/>
</configuration>
...

So, the next step in the scenario, the system will behave as the properties above have the value false. Such behavior will last until the end of the scenario or until properties' values will be changed again.

You can specify as many properties as you need. Also you can use the tag <configuration> itself as many times as you need.

...

The command above generates GlobalConfigurationPathResolver with ALL properties from global configuration file if it has YAML-format.

If you don't need all properties to be included in GlobalConfigurationPathResolver, you can list only required the highest level properties to include. For this separate them with comma (no spaces, just comma!).

For example, if you has the following configuration file

Code Block
languageyml
titleapplication.yml
googleAuth:
  companyName: "Knubisoft.com"

geoLite2:
  enabled: false
  name: "GEOLITE2"

delaysTracking:
  api-duration: 5000ms
  dao-duration: 5000ms
  service-duration: 5000ms

and you need to generate paths only for properties companyName and api-duration to change their values via tag <configuration>, you should run the following command from the project root directory:

Code Block
languagebash
cmd/run generate cfg-with-resolver googleAuth,delaysTracking


You can also specify values to exclude from generation considering that all properties's paths will be generated. For that use the flag '-e' or '--exclude' and list required separated with comma the highest level properties to exclude. E.g.

Code Block
languagebash
cmd/run generate cfg-with-resolver -e geoLite2
Code Block
languagebash
cmd/run generate cfg-with-resolver --exclude geoLite2

NOTE: After test scenario completion all changed properties' values are reverted to their values before changing via tag <configuration> (values which were stated in configuration file).


If you have any questions/suggestions feel free to contact Diakonov Serhii (email: s.dyakonov@knubisoft.com)