DebugSession

DebugSession

Debug execution, enabled by config.debug (or the "--debug" command line option).

It activates the V8 inspector of the pagewalker process, and launches another browser which shows the DevTools connected to it. The execution is paused before the scenario starts, so that you can set breakpoints in your scenario and step through it, while the browser under test is operated by the scenario as usual.

The browser showing DevTools is a separate one from the browser under test.

Note that DevTools can not be opened by its own "devtools://" URL: Chrome rejects that URL when it is given from the outside, either by CDP or by the command line. Instead, a browser launched with "--remote-debugging-port" serves the same DevTools over that port as an ordinary http:// page, and this class opens it with the "ws" parameter pointing at the inspector of this process.

Constructor

new DebugSession()

Source:

Methods

waitUntilResumed() → {Promise}

Description:
  • Pause the execution until it is resumed on DevTools, so that you can set breakpoints in your scenario before it runs. It does nothing when debug mode is disabled.

Source:
Returns:

resolved when the execution is resumed

Type
Promise

(static) create(config) → {DebugSession}

Description:
  • Create a session and start preparing it. The returned session does nothing when config.debug is false, so that the caller does not have to care whether it is enabled.

Source:
Parameters:
Name Type Description
config Config
Returns:
Type
DebugSession