Skip to main content

context

A context in which to perform tests. 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 example, if a browser isn't specified but is required by steps in the test, Doc Detective will search for and use a supported browser available in the current environment.

Fields

FieldTypeDescriptionDefault
contextIdstringOptional. Unique identifier for the context.Generated UUID
platformsOne of
- string
- array of string
Optional. Platforms to run tests on.
browsersOne of
- string
- object
- array of
  one of:
  - string
  - object
Optional. Browsers to run tests on.
browsers.namestringRequired. Name of the browser.

Accepted values: chrome, firefox, safari, webkit
browsers.headlessbooleanOptional. If true, runs the browser in headless mode.true
browsers.windowobjectOptional. Browser dimensions.
browsers.window.widthintegerOptional. Width of the browser window in pixels.
browsers.window.heightintegerOptional. Height of the browser window in pixels.
browsers.viewportobjectOptional. Viewport dimensions.
browsers.viewport.widthintegerOptional. Width of the viewport in pixels.
browsers.viewport.heightintegerOptional. Height of the viewport in pixels.

Examples

{
"platforms": "linux",
"browsers": "chrome"
}
{
"platforms": [
"windows",
"mac",
"linux"
],
"browsers": [
"chrome",
"firefox",
"webkit"
]
}
{
"browsers": {
"name": "chrome",
"headless": true
}
}
{
"browsers": [
{
"name": "chrome",
"headless": true
},
{
"name": "firefox"
}
]
}
{
"platforms": [
"mac",
"linux"
],
"browsers": {
"name": "chrome",
"headless": true
}
}
{
"platforms": [
"windows",
"mac",
"linux"
],
"browsers": [
{
"name": "chrome",
"headless": true,
"window": {
"width": 1920,
"height": 1080
},
"viewport": {
"width": 1600,
"height": 900
}
},
{
"name": "firefox",
"window": {
"width": 1366,
"height": 768
}
},
{
"name": "webkit",
"headless": false,
"viewport": {
"width": 1440,
"height": 900
}
}
]
}
{
"platforms": "mac",
"browsers": [
{
"name": "safari",
"window": {
"width": 1280,
"height": 800
}
}
]
}