chun2014
chun2014

Reputation: 91

Protractor suite option won't run any test

I read somewhere that protractor can specify suite option in its configuration file, I used something like

suites: {
homepage: 'test/e2e/homepage/*.js'
},

Then I run the suite with:

protractor protractor.conf.js --suite homepage

or

protractor protractor.conf.js --suite=homepage

But both didn't run any test, and say: 0 test, 0 assertions, 0 failures

Any advice is greatly appreciated

Upvotes: 1

Views: 2897

Answers (1)

f1lt3r
f1lt3r

Reputation: 2223

Makes sure the path suite is relative to the protractor.conf file. For example with the directory structure like this:

├── app
│   └── test1.e2e.js
│   └── test2.e2e.js
├── test
│   └── protractor-conf.js

Your protractor.conf should look like this:

suites: {
  mySuite: [

    // The suite path is relative to the protractor.conf file
    '../app/*.e2e.js'
  ],
},

This is different from spec, which uses paths relative to the CWD from which protractor is run:

// Assuming you run tests from parent dir of `app`
specs: [
  'app/test1.e2e.js'
  'app/test2.e2e.js'
],

Upvotes: 2

Related Questions