Selenium/How-to/Debug with browser.debug()

Environments
This tip works if you're targeting:
 * a local MediaWiki
 * MediaWiki-Docker
 * MediaWiki-Docker-Dev
 * MediaWiki-Vagrant
 * a remote wiki
 * Beta cluster

Make the browser visible
To speed up the debugging, you will probably want to run make the browser visible. See Selenium/How-to/Make the browser visible.

mochaOpts
By default, Mocha will abort the test suite if it takes more than 60 seconds. That is usually plenty when you're just running tests, but it's usually not enough when you're debugging. Until 679355 is merged, you have to manually increase    in. This example extends the timeout to 60 minutes.

browser.debug
Put  at a place you want to debug.

Run Selenium tests
To speed up the debugging, you will probably want to run only one test. See Selenium/How-to/Run a subset of a test suite. Test suite will stop when it reaches.

Use the browser developer tools and WebdriverIO REPL interface to debug.

Examples
For example, you can ask for browser URL.

Or, if an element with ID  is displayed.

More information

 * debug
 * REPL interface