Piyush Jajoo
Piyush Jajoo

Reputation: 1093

Unable to use --suites option in protractor, gives 'Spec patterns did not match any files' error

I've used suites: {} block as explained on github. My config file is as follows -

//server config information
var serverConfig=require('./serverConfig.js').serverConfig;

var $browser= serverConfig.$browser;

//got the browser name
process.argv.forEach(function (val, index) {
  if(val==='-browser'){
    $browser=process.argv[index+1];
  }
});

// !!! update the server config
serverConfig.$browser=  $browser;

 //config
 //browser.driver.manage().timeouts().setScriptTimeout(TIME_OUT);

// The main suite of Protractor tests.
exports.config = {
  seleniumServerJar: '../../selenium/selenium-server-standalone-2.37.0.jar',
  chromeDriver: '../../selenium/chromedriver.exe',

  seleniumAddress: serverConfig.SELENIUMN_ADDRESS,


    //SUITES
suites : {
    BAT: ['../e2e/BAT/verifyDefaultLandingPage.js', '../e2e/BAT/verifyViewManagement.js', '../e2e/BAT/verifyMachineManagement.js', '../e2e/BAT/verifyMachinePage.js', '../e2e/BAT/verifyUserManagement.js', '../e2e/BAT/verifyRegisterAgent.js', '../e2e/BAT/verifyAgentPage.js', '../e2e/BAT/HelloWorldSampleAgent.js', '../e2e/BAT/TomcatSampleAgent.js', '../e2e/BAT/EMSSampleAgent.js', '../e2e/BAT/AMXSampleAgent.js', '../e2e/BAT/MDMAgent.js', '../e2e/BAT/BWAgent.js']
},


  capabilities: {
    'browserName': $browser
  },
  onPrepare:'../prepareStartup.js',

  //When the angular bootstrap not from the <html></html>
  rootElement: 'body>div',

  baseUrl: serverConfig.BASE_URL
};

When I try to run it as follows, it shows following error.

C:\TRUNK\tests\func\gui\protractor>protractor .\config\protractorConfig.js --browser chrome --suite BAT

------------------------------------
PID: 20964 (capability: chrome #1)
------------------------------------


C:\Users\pjajoo\AppData\Roaming\npm\node_modules\protractor\lib\runner.js:329
    throw new Error('Spec patterns did not match any files.');
          ^
Error: Spec patterns did not match any files.
    at Runner.run (C:\Users\user\AppData\Roaming\npm\node_modules\protractor\lib\runner.js:329:11)
    at process.<anonymous> (C:\Users\user\AppData\Roaming\npm\node_modules\protractor\lib\runFromLauncher.js:32:14)
    at process.EventEmitter.emit (events.js:98:17)
    at handleMessage (child_process.js:318:10)
    at Pipe.channel.onread (child_process.js:345:11)
[launcher] Runner Process Exited With Error Code: 8

Can anybody suggest me what am I doing wrong.

I'm using the latest Protractor version - 0.20.1

Upvotes: 2

Views: 7486

Answers (2)

Piyush Jajoo
Piyush Jajoo

Reputation: 1093

I would like to provide a workaround to use --suite option in protractor.

It was supposed to be in the latest version but it is not shipped yet. To use it, please download the angular/protractor from git (https://github.com/angular/protractor/archive/master.zip) and replace your protractor/* files with these files. You should be able to run the suites option as follows -

protractor <relative_path_to_config_file> --browser chrome --suite <suite_name>

I've cross checked it myself, it is working for me.

Upvotes: 4

rjferguson21
rjferguson21

Reputation: 1014

I don't think the 'suites' option has been officially released yet as of 0.20.1 Try running from the latest source.

Edit: '--suites' feature has been released and should work now as of 0.21.0 https://github.com/angular/protractor/blob/master/CHANGELOG.md

Upvotes: 1

Related Questions