Global Configuration - TestlumFramework/Testlum GitHub Wiki
global-config.xml
- is a file which will contain the main configuration settings of your project. You have the
ability to create multiple configuration files and divide the testing environment.
To tell Testlum which configurations to use, you need to pass the file name to the startup parameters using the -c flag.
java -jar testlum.jar -c={config-file-name}.xml -p=path/to/test-resources
π Location: test-resources-base-folder/global-config.xml
No, you can give it any name you like. But we provide an example of how to name this file for convenience!
For example:
- global-config-local.xml
- global-config-dev.xml
- global-config-jenkins.xml
The default set of basic commands for configuration global-config.xml
:
<globalTestConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.knubisoft.com/testlum/testing/model/global-config"
xsi:schemaLocation="http://www.knubisoft.com/testlum/testing/model/global-config global-config.xsd">
<parallelExecution>false</parallelExecution>
<stopScenarioOnFailure>false</stopScenarioOnFailure>
<stopIfInvalidScenario>false</stopIfInvalidScenario>
<delayBetweenScenarioRuns seconds="1" enabled="true"/>
<runScenariosByTag enabled="true">
<tag name="web" enabled="true"/>
<tag name="api" enabled="true"/>
</runScenariosByTag>
<report>
<extentReports projectName="testlum">
<htmlReportGenerator enabled="true"/>
<klovServerReportGenerator enabled="false">
<mongoDB host="host" port="1111"/>
<klovServer url="http://host:port"/>
</klovServerReportGenerator>
</extentReports>
</report>
<environments>
<env folder="env_0" enabled="true" threads="2"/>
</environments>
<vault>
<host>HOST</host>
<port>PORT</port>
<scheme>SCHEME</scheme>
<token>TOKEN</token>
</vault>
</globalTestConfiguration>
π Letβs go through each command of the global configuration and explain what it does:
It is a command for enabling or disabling parallel execution of test scenarios.
<parallelExecution>true/false</parallelExecution>
true
- Enables parallel execution of test scenarios, if environments are set up.
false
- Disables parallel execution of test scenarios.Testlum supports two types of test parallelization:
- Parallel execution for different environments. If you have two active envs configured and parallelExecution is enabled Testlum will run all your tests in parallel for all enabled environments
- Parallel execution of tests for single environment. See environment setup for clarification.
It is a command that controls the passage of your test scenarios.
<stopScenarioOnFailure>true/false</stopScenarioOnFailure>
true
- When starting several or one test scenario, and detecting an error (bug) then the scenario will be stopped on this step.
false
- When running several or one test scenario, and an exception is detected, the starter will not be stopped, all the scenarios and steps will be executed until the starter finishes working, with further logs for all steps during the scenario.
It is a command that controls the validity of your test scenarios.
<stopIfInvalidScenario>true/false</stopIfInvalidScenario>
true
- When starting several or one test scenario, and detecting an invalid test scenario in test resources, the start will be terminated with an error output, which will show the path to an invalid scenario.
false
- When running several or one test scenario, and an exception is detected, the starter will not be stopped, all the scenarios and steps will be executed until the starter finishes working, except the invalid scenario.
It is a command, that adds a timeout between script executions.
<delayBetweenScenariosRuns seconds="3" enabled="true"/>
π§Ύ Attributes
Attribute | Type | Required | Default | Description |
---|---|---|---|---|
seconds | Integer | true | - | Sets the time counter between the script timeout. |
enabled | Boolean | true | false | The ability to perform a timeout between scenarios is disabled or enabled. |
Allows you to be able to implement a global launch of test scenarios for a specific command. It is designed to separate the launch of test scenarios.
- Create your own FilterTag for your convenience.
- Set a created tag for each scenario.
<runScenariosByTag enable="true"> <tag name="WEB" enable="true"/> <tag name="API" enable="false"/> </runScenariosByTag>When configuring - you have the ability to create your own set of tags and give them names that will be used to separate and run test scenarios by tag
π§Ύ runScenariosByTag
attributes
Attribute | Type | Required | Default | Description |
---|---|---|---|---|
enabled | Boolean | true | false | The ability to run scenarios by all or specific tags is enabled/disabled. |
π§Ύ tag
attributes
Attribute | Type | Required | Default | Description |
---|---|---|---|---|
name | String | true | - | Allows to come up with and specify, which exactly tag user wants to run. |
enabled | Boolean | true | false | Whether or not to run test scenarios with this tag specified |
Allows you to configure local and server reporting.
<report> <extentReports projectName="mega-test-app" onlyFailedScenarios="false"> <htmlReportGenerator enabled="true"/> <klovServerReportGenerator enabled="false"> <mongoDB host="localhost" port="27016"/> <klovServer url="http://localhost:1010"/> </klovServerReportGenerator> </extentReports> </report>Report settings and their necessity are described in detail here. Don't forget to read.
It is a command, that allows to set up several environments for parallel test execution.
<environments> <env folder="env0" enabled="true"/> <env folder="disabled_env" enabled="false" threads="2"/> </environments>
π§Ύ env
attributes
Attribute | Type | Required | Default | Description |
---|---|---|---|---|
folder | String | true | - | Is to specify folder name with integration.xml and ui.xml files for specific environment. |
enabled | Boolean | true | false | Is used to enable or disable specific environment. |
threads | Integer | false | 1 | Parallel execution allow to run tests concurrently, however, in the case of tests that affect each other, the tests will fail because of the same environment. |
It is a command for interaction with the Vault service and creation of variables for configurations. It offers features for secret storage, dynamic secret generation, authentication.
<vault> <host>HOST</host> <port>PORT</port> <scheme>SCHEME</scheme> <token>TOKEN</token> </vault>Vault usage and configuration along with system env variable described in details is here.