Skip to main content

context

An application and supported platforms.

If no contexts are specified but a context is required by one or more tests, Doc Detective attempts to identify a supported context in the current environment and run tests against it. For browsers, context priority is Firefox > Chrome > Chromium.

Fields

FieldTypeDescriptionDefault
appobjectRequired. The application to run.
app.namestringRequired. Name of the application.

Accepted values: chrome, firefox, safari, edge
app.pathstringOptional. Absolute path or command for the application. If not specified, defaults to typical install paths per platform. If specified but the path is invalid, the context is skipped.
app.optionsobjectOptional. Options to pass to the app. Only works when name is firefox or chrome.
app.options.widthintegerOptional. Width of the window in pixels.
app.options.heightintegerOptional. Height of the window in pixels.
app.options.headlessbooleanOptional. If true, runs the browser in headless mode. Not supported by Safari.
app.options.driverPathstringOptional. Path to the browser driver. If not specified, defaults to internally managed dependencies.
platformsarray of stringsRequired. Supported platforms for the application.

Examples

{
"app": {
"name": "chrome"
},
"platforms": [
"linux"
]
}
{
"app": {
"name": "firefox",
"options": {
"width": 800,
"height": 600,
"headless": false,
"driverPath": "/usr/bin/geckodriver"
}
},
"platforms": [
"linux",
"windows",
"mac"
]
}
{
"app": {
"name": "safari"
},
"platforms": [
"mac"
]
}
{
"app": {
"name": "firefox",
"path": "/usr/bin/firefox"
},
"platforms": [
"linux"
]
}