Configuration
The Testabulous runner is configured locally using the testabulous.config.json file.
By default the runner expects to find the config file in the project root. It is possible to specify an alternative config file and this then becomes the project root directory.
Root directory
All file paths are relative to the root directory. This can be specified, in order of preference, as follows:
- With the
--root-diror-rcommand line argument - The folder containing the config file
- The current working directory
The root directory should contain the config file and the base directory.
Base directory
The base directory contains the project subfolders. By default this is <root folder>/testabulous. It can be changed to some other folder using the baseDir config file option.
Project subfolders
The base directory contains the following subfolders:
tests- put your test scripts herecache- this contains a Sqlite database which caches test scripts locally. Tests are also cached on the Testabulous platform. In case of emergency, the database can be deleted and will be recreated on next run.logs- this contains test run logs, both inJSONandHTMLformats.screenshots- if screenshots are enabled (see below) then a screenshot will be taken after each step and stored in this folder. Use the logs to find the relevant screenshot.uploadResults- by default the runner does not report results to the project dashboard when run locally. Set this totrueto upload test results.scripts- any (custom scripts)[/reference/scripts] should be stored here.
Project keys
The project ID and API key can be specified, in order of preference, as follows:
- With the command line options
--project-idand--api-keyor-pand-k - In the environment variable file (see below)
- As environment variables (see below for names)
- In the config file (useful for testing but not recommended for production)
Config file
Testabulous uses sensible defaults to get you started as quickly as possible. These defaults can be overriden using the testabulous.config.json configuration file. This file must be a standard JSON formatted text file.
The following properties are supported:
Credentials
It is possible to store the project ID and API key in the config file. This is useful for testing purposes but not recommended for production. Do not commit the API key to source control (e.g. Github)
{
projectId: "",
apiKey: "",
}
Base directory
By default all Testabulous resources are located in a subfolder in your project called testabulous. It is possible to override this with the baseDir property.
{
baseDir: "testabulous",
}
Screenshots
Testabulous can take a screenshot of the page in the browser after each step. This is disabled by default. It can be enabled with the screenshots property. If enabled then screenshots are stored in the <testabulous root>/screenshots directory. For easier navigation they are referenced in the test run logs stored in the <testabulous root>/folder
{
screenshots: true|false,
}
Browser
It is possible to control the browser configuration. At the moment only the Chrome browser is supported however the window size of the browser is configurable. By default the browser is run in headless mode i.e. the browser has no UI. It is possible to disable headless mode and display the browser window.
{
browser: {
browser: "chrome",
headless: true|false,
windowSize: {
width: 1920,
height: 1080,
},
},
}
Environment variables
It is possible to specifiy a file containing environment variable keys and values which are loaded prior to running tests. No file is used by default. See the next section for more details.
{
envFile: ".env",
}
Env vars file
The envFile property of the config file can be used to reference a local file containing environment variable key value pairs. Typically this is something like .env or .env.local.
The Testabulous specific environment variables are:
TESTABULOUS_PROJECT_ID - as copied from the dashboard
TESTABULOUS_API_KEY - again copied from the dashboard. It's possible to create multiple keys, one per team member if desired.