TestEngine general settings
TestEngine API allows you to view and modify the following settings:
Allowed paths
A list of paths to which TestEngine has access.
Allowed connection targets
A list of endpoints to which TestEngine can send requests. The default value is *
that allows any connection targets.
Tip: | The setting supports the * wildcard symbol in the leftmost position. For example, you can specify the *.smartbear.com connection target to allow connections to all the subdomains of the smartbear.com domain. |
Allowed incoming connection targets
A list of endpoints that TestEngine listens to for incoming connections.
Tip: | The setting supports the * wildcard symbol in the leftmost position. For example, you can specify the *.smartbear.com connection target to allow connections to all the subdomains of the smartbear.com domain. |
This setting is not available in the Web UI. To view or set the setting, use TestEngine’s API. |
Maximum days to keep
Test jobs created earlier than this date will be removed if you omit the before parameter when removing old test jobs.
Maximum jobs to keep
Allow test steps connecting to databases using JDBC
false
(by default), TestEngine blocks all the JDBC connections. It means JDBC test steps and JDBC data sources will not work. Set it to true
to enable them.
When you enable this option, a malefactor can read information from local file-based databases.
You can edit them by using TestEngine API or Web UI.
Configuring via API
View settings
To get the current TestEngine settings, use the following command:
Authentication
Set settings
To modify TestEngine settings, use the following command:
Body
A JSON object containing one or more of the following settings. See the possible elements in the SwaggerHub specification. The omitted settings will not be modified.
For example:
"allowedFilePaths" : [
"C:\\Work\\Tests\\Petstore"
],
"allowedConnectTargets" : [
"*.swagger.io"
]
}
Authentication
Configuring via Web UI
-
Go to the home page of TestEngine:
http://<testengine-host>:<port>/For example, if TestEngine is installed on your local machine and you run it on the default port, use the following link:
-
Open the Server tab and modify the needed settings:
To Add a new entry to a list, click Add New Path or Add New Target and specify the needed path or connection target.
To remove an entry from a list, click .
Change connection settings
To change the default TestEngine connection settings (the protocol and port), edit the readyapi-testengine.yaml configuration file in any text editor.
We do not recommend that you modify other settings in the file, since it may cause errors.
The file location depends on the operating system and on the permissions TestEngine or its installer has:
-
Windows
<user folder>/.readyapi/readyapi-testengine.yaml
-
Linux and macOS
If you installed TestEngine or ran it with root access:
/etc/readyapi-testengine.yaml
If you installed TestEngine without root access:
/.readyapi/readyapi-testengine.yaml
You need to restart TestEngine after modifying the file to apply the changes.
readyapi-testengine.yaml |
Comments |
server: |
|
- type: http port: 8080 |
These settings configure connections established through the HTTP protocol. |
#Uncomment these settings to enable communication with TestEngine through the HTTPS protocol. # - type: https # port: 8443 |
|
# keyStorePath: example.keystore | The path to the Java keystore containing the TestEngine certificate. |
# keyStorePassword: example | The password for accessing the keystore. |
# validateCerts: false | Whether TestEngine validates certificates. If it is true, TestEngine will not start if the certificate has expired or is invalid. |
Groovy restrictions
By default, Groovy scripting has limitations on writing data to properties and files. If you need fully functional Groovy scripts in your tests, you can turn off these restrictions.
Turning off the restrictions can cause security vulnerabilities.
To turn off the limitations, you need to set the groovy.allow.all
system property to true. The way you do this depends on how you run TestEngine:
Executable file
-
Go to the TestEngine installation folder.
-
Open the ReadyAPITestEngine.vmoptions file in any text editor.
-
Add the following line at the end of the file:
-Dgroovy.allow.all=trueThe last line in the .vmoptions file must be followed by a new line. -
Save the file and restart TestEngine.
Command line
When you use the .bat or .sh file to run TestEngine, add the system property to the script file:
-
Open the script file (
readyapi-testengine.bat/sh
). -
Go to the last but one line and insert the system property between the
JAVA_OPT
variable and the-cp
option:-
.bat file:
"%JAVA%" %JAVA_OPTS% -Dgroovy.allow.all=true -cp "%CLASSPATH%" com.smartbear.ready.testserver.ReadyApiTestServerMain %* -
.sh file:
"$JAVA $JAVA_OPTS -Dgroovy.allow.all=true -cp $READY_API_CLASSPATH com.smartbear.ready.testserver.ReadyApiTestServerMain "$@"
-
Docker
If you run TestEngine in a Docker container, pass the system property to the JVM_OPT_GROOVY
environment variable:
Environment variable | Value |
---|---|
JVM_OPT_GROOVY |
-Dgroovy.allow.all=true |
For example, if you use the docker run
command to start a container, add the -e JVM_OPT_GROOVY=-Dgroovy.allow.all=true
option to the command:
Relative Paths to Project Resources
By default, ReadyAPI uses absolute paths to files. This approach must change when you use the same test on multiple machines or share it with multiple users because not all of them will have the files you need in the same place. To solve this issue, use the Resource Root project property.
Please see here for instructions on how to configure the Resource Root project property.
Use alternative configuration file
By default, TestEngine uses the configuration file described above. You can make TestEngine use an alternative settings file.
To do this, run the TestEngine executable with the -c (--cfg) <arg>
argument. For example:
Windows
Linux/macOS
To avoid errors, copy the settings file to the needed place, then run TestEngine with the -c (--cfg)
option, and change settings by using web UI or API if possible.
The address and port of your TestEngine installation.
The address and port of your TestEngine installation.