1

I am using WebdriverIO.

I start my tests from the command line using 'npm test', which triggers the command: wdio wdio.conf.js as specified in my package.json here:

  "scripts": {
    "test": "wdio wdio.conf.js"
  },

What I want to do is specify the actual test to run like this:

wdio wdio.conf.js --spec ./test/specs/e2e/login.js

My question is, how do I pass in the testcase from the npm command, i.e. how can I pass this --spec ./test/specs/e2e/login.js from the npm command into the wdio command?

Matt
  • 773
  • 2
  • 15
  • 30

1 Answers1

5

You can do something like this.

npm run test -- --spec ./test/specs/e2e/login.js

Check this out. https://stackoverflow.com/a/14404223/3879644

Raju
  • 2,299
  • 2
  • 16
  • 19