Log in
Skip to sidebar
Skip to main content
Linked Applications
Loading…
Confluence
Spaces
Create
Create
Hit enter to search
Help
Online Help
Keyboard Shortcuts
Feed Builder
What’s new
Available Gadgets
About Confluence
Log in
Profile-API documentation
Pages
Profile-API documentation Home
Change global config properties during testing
Change global config properties during testing
search
attachments
weblink
advanced
image-effects
image-attributes
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
Colour picker
More colours
Formatting
Strikethrough
Subscript
Superscript
Monospace
Clear formatting
Bullet list
Numbered list
Task list
Outdent
Indent
Align left
Align center
Align right
Page layout
Link
Table
Insert
Insert content
Files and images
Link
Markup
Horizontal rule
Task list
Date
Emoticon
Symbol
Insert macro
User mention
Jira Issue/Filter
Info
Status
Gallery
Table of Contents
Other macros
Page layout
No layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard shortcuts help
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account.
This page is also being edited by
. Your changes will be merged with theirs when you save.
<h3><strong>This functionality is supported only for global configuration file in YAML-format (application.yml)!</strong></h3><p>If you need to change any property from the YAML global configuration file during testing, you should use tag <strong><configuration></strong> in scenario.xml. Write an appropriate comment and specify as many properties as you need inside the tag. To change property, you need to specify its full path from the highest level and the desired value. The value should have the same type as the property has in global configuration file.</p><p><br /></p><p>Let's take a look at the following configuration file:</p><table class="wysiwyg-macro" data-macro-name="code" data-macro-id="f9bf9958-47fb-4275-a917-89e66dbd5ad1" data-macro-parameters="language=yml|title=application.yml" data-macro-schema-version="1" style="background-image: url(https://wiki.knubisoft.com/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6bGFuZ3VhZ2U9eW1sfHRpdGxlPWFwcGxpY2F0aW9uLnltbH0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>accountManagement: registration: emailRegistrationEnabled: true phoneRegistrationEnabled: true</pre></td></tr></table><p><br /></p><p>To change values of <strong>emailRegistrationEnabled</strong> and <strong>phoneRegistrationEnabled</strong> properties, you need to specify their full path using dot separation, in our case <em><strong>accountManagement.registration.emailRegistrationEnabled</strong></em> and <em><strong>accountManagement.registration.phoneRegistrationEnabled</strong>. </em>So in test scenario it should be the following:</p><table class="wysiwyg-macro" data-macro-name="code" data-macro-id="dc6bade7-8799-42be-aab3-17bbb3233a19" data-macro-parameters="language=xml|title=scenario.xml" data-macro-schema-version="1" style="background-image: url(https://wiki.knubisoft.com/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6bGFuZ3VhZ2U9eG1sfHRpdGxlPXNjZW5hcmlvLnhtbH0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>... <configuration comment="Disabling registration via phone, enabling registration via email"> <property path="accountManagement.registration.phoneRegistrationEnabled" value="false"/> <property path="accountManagement.registration.emailRegistrationEnabled" value="false"/> </configuration> ...</pre></td></tr></table><p>So, the next step in the scenario, the system will behave as the properties above have the value <strong>false</strong>. Such behavior will last until the end of the scenario or until properties' values will be changed again.</p><p>You can specify as many properties as you need. Also you can use the tag <strong><configuration> </strong>itself as many times as you need.</p><h4>Also it's required to have stated paths of properties in GlobalConfigurationPathResolver.</h4><h1>How to add required path to GlobalConfigurationPathResolver</h1><p>To add path which you need to GlobalConfigurationResolver, you should use command for invoking generator which adds appropriate paths to GlobalConfigurationPathResolver:</p><table class="wysiwyg-macro" data-macro-name="code" data-macro-id="2b43cd61-c0fd-4776-b683-2b8e3c67123d" data-macro-parameters="language=bash" data-macro-schema-version="1" style="background-image: url(https://wiki.knubisoft.com/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6bGFuZ3VhZ2U9YmFzaH0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>cmd/run generate cfg-with-resolver</pre></td></tr></table><p>The command above generates GlobalConfigurationPathResolver with ALL properties from global configuration file if it has YAML-format.</p><p>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 <strong>(no spaces, just comma!)</strong>.</p><p>For example, if you has the following configuration file</p><table class="wysiwyg-macro" data-macro-name="code" data-macro-id="dbbbe178-5dc2-4b2a-ae4a-7aa351b7058b" data-macro-parameters="language=yml|title=application.yml" data-macro-schema-version="1" style="background-image: url(https://wiki.knubisoft.com/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6bGFuZ3VhZ2U9eW1sfHRpdGxlPWFwcGxpY2F0aW9uLnltbH0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>googleAuth: companyName: "Knubisoft.com" geoLite2: enabled: false name: "GEOLITE2" delaysTracking: api-duration: 5000ms dao-duration: 5000ms service-duration: 5000ms</pre></td></tr></table><p>and you need to generate paths only for properties <strong>companyName </strong>and <strong>api-duration</strong> to change their values via tag <configuration>, you should run the following command from the project root directory:</p><table class="wysiwyg-macro" data-macro-name="code" data-macro-id="ad46b621-ff99-4cf7-9bbb-223253a3f4fe" data-macro-parameters="language=bash" data-macro-schema-version="1" style="background-image: url(https://wiki.knubisoft.com/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6bGFuZ3VhZ2U9YmFzaH0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>cmd/run generate cfg-with-resolver googleAuth,delaysTracking</pre></td></tr></table><p><br /></p><p>You can also specify values to exclude from generation considering that all properties's paths will be generated. For that use the flag <strong>'-e'</strong> or <strong>'--exclude'</strong> and list required separated with comma the highest level properties to exclude. E.g.</p><table class="wysiwyg-macro" data-macro-name="code" data-macro-id="2be2b065-b9f6-418b-979d-4fa3b352dfcf" data-macro-parameters="language=bash" data-macro-schema-version="1" style="background-image: url(https://wiki.knubisoft.com/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6bGFuZ3VhZ2U9YmFzaH0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>cmd/run generate cfg-with-resolver -e geoLite2</pre></td></tr></table><table class="wysiwyg-macro" data-macro-name="code" data-macro-id="43b5d43d-9711-4379-b5ca-208abda9c270" data-macro-parameters="language=bash" data-macro-schema-version="1" style="background-image: url(https://wiki.knubisoft.com/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6bGFuZ3VhZ2U9YmFzaH0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>cmd/run generate cfg-with-resolver --exclude geoLite2</pre></td></tr></table><h4><strong>NOTE: </strong>After test scenario completion all changed properties' values are reverted to their values before changing via tag <strong><configuration> </strong>(values which were stated in configuration file).</h4><p><br /></p><p>If you have any questions/suggestions feel free to contact <a class="confluence-link confluence-userlink user-mention" data-username="Diakonov Serhii" href="/display/~Diakonov+Serhii" data-linked-resource-id="57180419" data-linked-resource-version="1" data-linked-resource-type="userinfo" userkey="ff808181813d482c01842ee0d073002e" data-linked-resource-default-alias="Diakonov Serhii" data-base-url="https://wiki.knubisoft.com">Diakonov Serhii</a> (email: s.dyakonov@knubisoft.com)</p><p><br /></p>
Edit
Preview
Save
Close
{"serverDuration": 95, "requestCorrelationId": "7b8dcef863018eda"}