Type object
File match nightwatch.json
Schema URL https://catalog.lintel.tools/schemas/schemastore/nightwatch-js/latest.json
Source https://www.schemastore.org/nightwatch.json

Validate with Lintel

npx @lintel/lintel check
Type: object

Properties

custom_commands_path null | string | array

Location(s) where custom commands will be loaded from.

Default: null
custom_assertions_path null | string | array

Location(s) where custom assertions will be loaded from.

Default: null
page_objects_path null | string | array

Location(s) where page object files will be loaded from.

Default: null
globals_path null | string

Location of an external globals module which will be loaded and made available to the test as a property globals on the main client instance.

Default: null
globals object

An object which will be made available on the main test api, throughout the test execution

11 nested properties
abortOnAssertionFailure boolean

This controls whether to abort the test execution when an assertion failed and skip the rest. It's being used in waitFor commands and expect assertions

Default: true
abortOnElementLocateError boolean

This controls whether to abort the test execution when an element cannot be located; an error is logged in all cases, but this also enables skipping the rest of the testcase; It's being used in element commands such as .click() or .getText()

Default: false
waitForConditionPollInterval integer

This will overwrite the default polling interval (currently 500ms) for waitFor commands and expect assertions that use retry

Default: 500
waitForConditionTimeout integer

Default timeout value in milliseconds for waitFor commands and implicit waitFor value for expect assertions

Default: 5000
throwOnMultipleElementsReturned boolean

This will cause waitFor commands on elements to throw an error if multiple elements are found using the given locate strategy and selector

Default: false
suppressWarningsOnMultipleElementsReturned boolean

By default a warning is printed if multiple elements are found using the given locate strategy and selector; set this to true to suppress those warnings

Default: false
asyncHookTimeout integer

Controls the timeout value for async hooks. Expects the done() callback to be invoked within this time or an error is thrown

Default: 10000
unitTestsTimeout integer

Controls the timeout value for when running async unit tests. Expects the done() callback to be invoked within this time or an error is thrown

Default: 2000
customReporterCallbackTimeout integer

Controls the timeout value for when executing the global async reporter. Expects the done() callback to be invoked within this time or an error is thrown

Default: 20000
retryAssertionTimeout integer

Automatically retrying failed assertions - You can tell Nightwatch to automatically retry failed assertions until a given timeout is reached, before the test runner gives up and fails the test.

Default: 5000
reporter
dotenv object

Configuration settings for the dotenv module - a zero-dependency module that loads environment variables from a .env file into process.env. More details on https://www.npmjs.com/package/dotenv

persist_globals boolean

Persist the same globals object between runs or have a (deep) copy of it per each test; this can be useful when persisting data between test suites is needed, such as a cookie or session information

Default: false
output_folder string

The location where the JUnit XML report files will be saved. Set this to false if you want to disable XML reporting

Default: "tests_output"
src_folders null | string | array

A string or array of folders (excluding subfolders) where the tests are located.

Default: null
live_output boolean

Used when running in parallel to determine if the output should be collected and displayed at the end.

Default: false
disable_colors boolean

Used to disable colored output in the terminal.

Default: false
parallel_process_delay integer

Used when running in parallel to specify the delay (in milliseconds) between starting the child processes

Default: 10
selenium object

An object containing Selenium Server related configuration options

8 nested properties
start_process boolean
Default: false
cli_args object | array
server_path null | string
Default: null
log_path string | boolean
Default: ""
port
check_process_delay integer
Default: 500
max_status_poll_tries integer
Default: 15
status_poll_interval integer
Default: 200
start_session boolean

Whether or not to automatically start the Selenium/WebDriver session. If running unit tests, this should be set tot false.

Default: true
end_session_on_fail boolean

End the session automatically when the test is being terminated, usually after a failed assertion.

Default: true
skip_testcases_on_fail

Skip the remaining test cases from the current test suite, when one test case fails.

test_workers boolean | object

Whether or not to run individual test files in parallel.

Default: false
3 nested properties
enabled boolean
workers string | number

Automatically compute the number of workers based on CPU cores with "auto" or manually specify the number of workers

node_options string | array

Pass node arguments to individual workers (all of the process.execArgv using "auto" or selectively pass node arguments via ["--inspect"])

test_runner string

Specifies which test runner to use: default|mocha

Default: "default"
webdriver object

Defines options used to connect to the WebDriver/Selenium server

17 nested properties
start_process boolean
Default: false
cli_args object | array
server_path null | string
Default: null
log_path string
use_legacy_jsonwire
check_process_delay integer

Time to wait (in ms) before starting to check the Webdriver server is up and running

Default: 100
max_status_poll_tries integer

Maximum number of ping status check attempts before returning a timeout error

Default: 10
status_poll_interval integer

Interval (in ms) to use between status ping checks when checking if the Webdriver server is up and running

Default: 200
process_create_timeout integer

The entire time (in ms) to wait for the Node.js process to be created and running (default is 2 min), including spawning the child process and checking the status

Default: 120000
host
port
ssl
proxy
timeout_options object
2 nested properties
timeout
retry_attempts
default_path_prefix
username
access_key
test_settings object
launch_url string

A url which can be used later in the tests as the main url to load.

Default: ""
silent boolean

set to false if you want to show the extended http traffic command logs from the WebDriver server.

Default: true
output boolean

Used to disable terminal output completely.

Default: true
detailed_output boolean

Set this to false if you'd like to only see the test case name displayed and pass/fail status.

Default: true
output_timestamp boolean

Set this to true if you'd like to see timestamps next to the logging output

Default: false
disable_error_log boolean

Set this to true if you'd like to not display errors during the execution of the test (they are shown at the end always).

Default: false
screenshots boolean

Take error and failure screenshots during test execution

Default: false
log_screenshot_data boolean

Used to enable showing the Base64 image data in the (verbose) log when taking screenshots.

Default: false
desiredCapabilities object
1 nested properties
browserName string
exclude null | array

An array of folders or file patterns to be skipped (relative to the main source folder).

Default: null
filter null | string

Folder or file pattern to be used when loading the tests. Files that don't match this pattern will be ignored.

Default: null
skipgroup string

Skip a group of tests (a subfolder); can be a list of comma-separated values (no space)

Default: ""
sync_test_names boolean
Default: true
skiptags string

Skip tests by tag name; can be a list of comma-separated values (no space)

Default: ""
use_xpath boolean

Use xpath as the default locator strategy

Default: false
parallel_mode boolean
Default: false
report_prefix string
Default: ""
unit_tests_mode boolean
Default: false
default_reporter string
Default: "junit"