Nightwatch.js
nightwatch.js config
| 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
Properties
Location(s) where custom commands will be loaded from.
Location(s) where custom assertions will be loaded from.
Location(s) where page object files will be loaded from.
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.
An object which will be made available on the main test api, throughout the test execution
11 nested properties
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
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()
This will overwrite the default polling interval (currently 500ms) for waitFor commands and expect assertions that use retry
Default timeout value in milliseconds for waitFor commands and implicit waitFor value for expect assertions
This will cause waitFor commands on elements to throw an error if multiple elements are found using the given locate strategy and selector
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
Controls the timeout value for async hooks. Expects the done() callback to be invoked within this time or an error is thrown
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
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
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.
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 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
The location where the JUnit XML report files will be saved. Set this to false if you want to disable XML reporting
A string or array of folders (excluding subfolders) where the tests are located.
Used when running in parallel to determine if the output should be collected and displayed at the end.
Used to disable colored output in the terminal.
Used when running in parallel to specify the delay (in milliseconds) between starting the child processes
An object containing Selenium Server related configuration options
8 nested properties
Whether or not to automatically start the Selenium/WebDriver session. If running unit tests, this should be set tot false.
End the session automatically when the test is being terminated, usually after a failed assertion.
Skip the remaining test cases from the current test suite, when one test case fails.
Whether or not to run individual test files in parallel.
3 nested properties
Automatically compute the number of workers based on CPU cores with "auto" or manually specify the number of workers
Pass node arguments to individual workers (all of the process.execArgv using "auto" or selectively pass node arguments via ["--inspect"])
Specifies which test runner to use: default|mocha
Defines options used to connect to the WebDriver/Selenium server
17 nested properties
Time to wait (in ms) before starting to check the Webdriver server is up and running
Maximum number of ping status check attempts before returning a timeout error
Interval (in ms) to use between status ping checks when checking if the Webdriver server is up and running
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
2 nested properties
A url which can be used later in the tests as the main url to load.
set to false if you want to show the extended http traffic command logs from the WebDriver server.
Used to disable terminal output completely.
Set this to false if you'd like to only see the test case name displayed and pass/fail status.
Set this to true if you'd like to see timestamps next to the logging output
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).
Take error and failure screenshots during test execution
Used to enable showing the Base64 image data in the (verbose) log when taking screenshots.
1 nested properties
An array of folders or file patterns to be skipped (relative to the main source folder).
Folder or file pattern to be used when loading the tests. Files that don't match this pattern will be ignored.
Skip a group of tests (a subfolder); can be a list of comma-separated values (no space)
Skip tests by tag name; can be a list of comma-separated values (no space)
Use xpath as the default locator strategy