pause() command provides the following functionalities:

  • Pause the test execution for the given time in milliseconds.
  • Pause the test execution indefinitely, until resumed by pressing a key in terminal.
  • Pause the test execution, and then step over to the next test command (execute the next test command) and pause again.

This command will allow you to pause the test execution in between, hop on to the browser to check the state of your
application (or use DevTools to debug), and once satisfied, either resume the test execution from where it was left
off or step over to the next test command (execute the next test command) and pause again.

Stepping over to the next test command would allow you to see what exactly changed in your application when the next
test command was executed. You can also use DevTools to monitor those changes, like the network calls that were made
during the execution of that command, etc.

Usage

Parameters

Name Type description
ms
Optional
number

The number of milliseconds to wait.

callback
Optional
function

Optional callback function to be called when the command finishes.

Example

this.demoTest = function (browser) {
  // pause for 1000 ms
  browser.pause(1000);
  // pause indefinitely until resumed
  browser.pause();
};