0

How do I run suites in protractor. Here is my config file:

exports.config = {
       seleniumAddress: 'http://localhost:4444/wd/hub',

       suites:
       {
         one: ['test.js'],
         two: ['homePageSpec.js']
       },

       onPrepare: function () {
           browser.driver.manage().window().setSize(1180, 900);

       },
   }

I tried protractor ProtractorConf.js --suite one

SUPARNA SOMAN
  • 2,311
  • 3
  • 19
  • 35
  • 1
    And what exception did you get? – FCin May 11 '17 at 15:36
  • I get the following error------$ protractor ProtractorConf.js --suite one [11:38:36] E/configParser - Error code: 105 [11:38:36] E/configParser - Error message: failed loading configuration file ProtractorConf.js [11:38:36] E/configParser - /Users/sup/Documents/ProFirstTest/ProtractorConf.js:9 onPrepare: function () { ^^^^^^^^^ SyntaxError: Unexpected identifier – SUPARNA SOMAN May 11 '17 at 15:40
  • 1
    The command `protractor ProtractorConf.js --suite one` is correct but you have syntax error in your onprepare function. – FCin May 11 '17 at 15:41
  • Try to run it without `onPrepare` method, because I'm not sure why exactly this error occurs. – FCin May 11 '17 at 15:45
  • the syntax was wrong! thanks @FCin – SUPARNA SOMAN May 11 '17 at 15:49
  • It was the square brackets that caused the problem. – SUPARNA SOMAN May 16 '17 at 15:25

1 Answers1

1

I removed the square brackets and it worked. like:

suites:
       {
         one: 'test.js',
         two: 'homePageSpec.js'
       },
SUPARNA SOMAN
  • 2,311
  • 3
  • 19
  • 35