http://localhost). A simple perform command which allows access to the "api" in a callback.Can be useful if you want to read variables set by other commands. Checks if the given element is visible on the page. By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service.

To get an idea of how running unit tests with Nightwatch works you can head over to our GitHub page, clone the project and follow the instructions on how to run the tests. Selected radio button shows user more content. It was started as part of the Selenium project, which is a very popular and comprehensive set of tools for browser automation, initially written for Java but now with support for most programming languages. Scrolls into view the form control element and then sends the provided keys to the element, or returns the current value of the element. Only tests that have the specified tags will be loaded. Can a frightened creature freely circle the source of its fear? application specific commands and assertions. An object which will be passed to the Selenium WebDriver when a new session will be created.

API to perform commands and assertions on DOM elements. Determine if an element is currently enabled. Location(s) where custom commands will be loaded from. This can be useful when you're working with multiple windows open (e.g.

When using the mocha test runner from Nightwatch some cli options are not available, like --retries, --suiteRetries, --reporter. First, load the Nightwatch grunt task at the top in your Gruntfile.js. Lastly... where the DOCs might fail you, the code will never lie: That above is the is a snippet Nightwatch's test-runner (nightwatch/lib/runner/run.js). The false flag only gives the method the character to be evaluated by the test-runner as a non-breaking Determine if an OPTION element, or an INPUT element of type checkbox or radio button is currently selected.

For example. Your command module needs to export a command function, which needs to call at least one Nightwatch api method (such as .execute()).

Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame. You can overwrite globals per environment as needed. Some of them are basic commands (such as url and execute) and others are internal commands being used by Nightwatch commands and assertions.

If you have installed Nightwatch globally (with -g option), the binary nightwatch will be available anywhere: If you have Nightwatch installed as a dependency of your project, you can refer the binary from the node_modules/.bin folder: Create a file nightwatch.js and add the following line: The optional source argument can be either one or more files or an entire folder. The element's coordinates are returned as a JSON object with x and y properties.

Optional log message to display in the output.

Currently, I have an element, let's call it ClickMe, that, when the page loads, is well below the view being shown in the browser.

CSS3's border-radius property and border-collapse:collapse don't mix. The same set of hooks as per test suite is also available globally, outside the scope of the test.

If an element is provided but no offset, the mouse will be moved to the center of the element. If not specified or is null, the offset is relative to current position of the mouse.