webdriverio: Inspect not working

Environment (please complete the following information):

  • WebdriverIO version: 5.15.7
  • Mode: WDIO Testrunner
  • If WDIO Testrunner, running sync/async: async
  • Node.js version: v10.13.0
  • NPM version: 6.7.0
  • Browser name and version: Chrome 78.0.3904.108
  • Platform name and version: macOs 10.15.1
  • Additional wdio packages used (if applicable):@wdio/selenium-standalone

Config of WebdriverIO

exports.config = {
    runner: 'local',
    specs: [
        './test/specs/**/*.ts'
    ],
    exclude: [
        // 'path/to/excluded/files'
    ],
    maxInstances: 10,
    capabilities: [{
       
        maxInstances: 5,
        browserName: 'chrome',
     
    }],
    
    logLevel: 'trace',
    bail: 0,
    baseUrl: 'localhost:8100',
    waitforTimeout: 10000,
    connectionRetryTimeout: 90000,
    connectionRetryCount: 3,
    services: ['selenium-standalone'],
    framework: 'mocha',
    reporters: ['spec'],
    mochaOpts: {
        ui: 'bdd',
        timeout: 60000
    },
    before: function (config, capabilities, specs) {
        require('ts-node').register({
        project: './test/tsconfig.e2e.json'
        });
    },
}

Describe the bug Tried to stop the tests for inspection as written in the official docs The tests are not stopping.

To Reproduce Steps to reproduce the behavior:
./node_modules/.bin/wdio ./test/conf/wdio.conf.js --inspect-brk

Expected behavior The tests stop on the first line.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 28 (15 by maintainers)

Most upvoted comments

Hi, I tried the workaround @saito-tom suggested and it works. The NiM starts correctly and stops at the “debugger” statement. Anyway when I try to execute a live command (ie: “browser.getTitle()”) I just get a pending request and no results, here’s a screenshot. image On the wdio 4 I’m able to test the live commands using the console, any hints to get the same behaviour on wdio5?

Thanks

I’m having the same problem with the --inspect/–inspect-brk options. Honestly I think this is a HUGE problem if compared to wdio 4, and despite my personal opinion I’d suggest finding a solution in order to prevent people from abandoning this beautiful framework.

All complex tests rely on page objects and require a powerful debugging support, REPL is not enough when you have page objects with many methods, inheritance etc.

What I do with v4 is: stop the execution with browser.debug() and then use chrome dev tools to debug node and call or check my page object methods (this is why I use the --inspect flag in order to start node in debug mode).

How can we achieve the same result with wdio 5?