Giter VIP home page Giter VIP logo

grunt-protractor-runner's People

Contributors

0x-r4bbit avatar bayarmunkh avatar daverubert avatar devaos avatar f-istvan avatar forbesjo avatar gonzoyumo avatar guuz avatar hvdb avatar jamesmgreene avatar jeanperriault avatar jeinnovate avatar jfountain avatar jfroom avatar joehalliwell avatar kailuowang avatar kyukyukyu avatar mgol avatar orekhov avatar penfold avatar raine avatar royts avatar rubenv avatar stanleyhlng avatar stevermeister avatar studds avatar sullivanpt avatar teddyhwang avatar teerapap avatar wakandan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grunt-protractor-runner's Issues

Allow chromeOptions

Hi

I would like to be able to pass in chromeOptions --test-type and show-fps-counter on protractor.config.js I can do something like this:

                  capabilities: {
                        browserName: 'chrome',
                        chromeOptions: { args: ['--test-type', 'show-fps-counter=true'] }
                    },

Not able to run protractor, exited with "Fatal error: protractor exited with code: null".

Hi,
I am not able to run protractor tests using plugin on RHEL 6.5 box.

Other install information :
Node v0.11.12
grunt-cli v0.1.13
grunt v0.4.4
protractor 0.21.0
grunt-protractor-runner: latest

exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
capabilities: {
'browserName': 'firefox'
},
specs: ['/test/example-spec.js'],
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 20000
},
allScriptsTimeout: 20000
};

Running above script results in:

Running "protractor:e2e" (protractor) task
util.puts: Use console.log instead
Using the selenium server at http://localhost:4444/wd/hub

Fatal error: protractor exited with code: null

I tried to --verbose of grunt to capture more information, but no errors in grunt. I verified selenium start without any errors listening at 4444. (spawned by webdriver-manager start).

If this information is not sufficient, please let me know to enable more logging/ or any other pointers to catch the root cause.

Thanks.

running webdriver-manage update fails in package.json

As referenced here 165afbf

npm http GET https://registry.npmjs.org/grunt-protractor-runner
npm http 304 https://registry.npmjs.org/grunt-protractor-runner

[email protected] postinstall /home/autobuild/workspace/r10n-gui-PRs-continuous/node_modules/grunt-protractor-runner
./node_modules/.bin/webdriver-manager update

sh: ./node_modules/.bin/webdriver-manager: No such file or directory
npm ERR! weird error 127
npm ERR! not ok code 0

looks like npm is in a different cwd than expected root? unsure if npm has an env var set like $NPM_ROOT that can be used to reliably know where root is.

chromeOptions is ignored

Hi

Chrome shows some security warning that normally you can removing using chromeOptions but the plugging ignores completely, can you please implement this please?

e.g.
capabilities: {
'browserName': 'chrome',
'chromeOptions': {
args: ['--test-type']
}
}

please see angular/protractor#919

Problems with global protractor install

Should require.resolve('protractor') provide a reference to a _global_ install of protractor? I have protractor installed globally, not locally, but opening up a node session throws an error:

node
> require.resolve('protractor');
Error: Cannot find module 'protractor'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.require.resolve (module.js:384:19)
    at repl:1:9
    at REPLServer.self.eval (repl.js:110:21)
    at repl.js:249:20
    at REPLServer.self.eval (repl.js:122:7)
    at Interface.<anonymous> (repl.js:239:12)
    at Interface.EventEmitter.emit (events.js:95:17)
    at Interface._onLine (readline.js:202:10)
    at Interface._line (readline.js:531:8)

Assuming this is the same error when I run grunt protractor:

grunt protractor:dev
Running "protractor:dev" (protractor) task
Warning: Cannot find module 'protractor' Use --force to continue.

Aborted due to warnings.

This stackoverflow post makes me wonder if require does in fact check globally?

Unable to start selenium

Hey there,

I'm having some trouble booting up selenium.

If I just issue the command:

$ protractor test/conf.js

... everything works fine.

However, with the following config:

protractor: {
  options: {
    configFile: "test/conf.js",
    keepAlive: true,
    noColor: false
  },
  e2e: {}
}

... issuing:

$ grunt protractor:e2e

I get:

Error: Unable to start selenium. You must specify either a seleniumAddress, seleniumServerJar, or saucelabs account, or use webdriver-manager.
    at setUpSelenium (./node_modules/protractor/lib/runner.js:174:15)
    at Object.runOnce ./node_modules/protractor/lib/runner.js:363:10)
    at Object.<anonymous> (./node_modules/protractor/lib/cli.js:80:8)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:901:3

Can you help me get past what is probably a really silly problem?

Thanks,
J

Target-specific config file should override default options

I would love to be able to specify:

options: {
  configFile: "common_defaults.js", // Default config file

and then have multiple targets like:

test_env: {
  options: {
    configFile: "test_env.js", // Target-specific config file

where common_defaults.js would be the big file with all protractor configs and test_env.js would only contain the changes to the commons, like different baseUrl and nothing else. Now in above example the test_env.js completely replaces the common_defaults.js.

breaks Protractor sharding

Does the runner support Protractor sharding? I'm seeing a semi-frequent (50%+) instances where even with one "shard", the Protractor tests fail to ever exit because they're detecting a remaining webdriver instance, even after logging that it was shutting down the remaining instance

Shutting down selenium standalone server.
[launcher] 1 instance(s) of WebDriver still running
Shutting down selenium standalone server.
[launcher] 1 instance(s) of WebDriver still running

Please let me know what additional information you'd need

Travis + Saucelabs: protractor Unexpected server error

Running "protractor" task
Using SauceLabs selenium server at http://adamquadmon:[email protected]:80/wd/hub

/home/travis/build/xxx/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:1542
      throw error;
            ^
UnknownError: Unexpected server error.

my .travis.yml:

language: node_js
node_js:
  - "0.10"
before_script:
  - gem install compass
  - npm install -g bower
  - npm install -g protractor
  - npm install grunt-cli
  - npm install
  - bower install
script:
  #- grunt test:mocha:saucelabs
  - grunt test:jasmine:saucelabs # this is grunt-protractor-runner
addons:
  sauce_connect:
    username: "adamquadmon"
    access_key: "xxx"
  hosts:
    - xxx.com
  • I tried both with local or -g protractor installations
  • I can run saucelabs test from my local
  • I can run saucelabs test with grunt-mocha-protractor with the same configuration

that's why I think the issue is related to this task.

run multiple browser tests

Has anyone figured out how to efficiently run tests on multiple browsers? I have been thinking of different approaches around this idea:

  • Modify protractor core to support passing array as capabilities.
  • Modify runners to support config array. If array would launch each protractor instance in series. Optionally could use grunt parallel tasks to run in parallel.

Thoughts?

Problem with target-capabilities in Gruntfile.js

Hello,

ive installed multiple versions of firefox on the selenium-node machine. Now ill want to run frontend-tests with protractor via grunt on the different versions.

First of all, here are the important parts of my Selenium-Node configuration file:

"capabilities":
    [
        {
            "browserName": "firefox",
            "version": "25",
            "firefox_binary": "C:\\Program Files (x86)\\Mozilla Firefox 25\\firefox.exe",
            "firefox_profile": "Firefox_25",
            "platform": "WINDOWS",
            "maxInstances": 1
        },
        {
            "browserName": "firefox",
            "version": "26",
            "firefox_binary": "C:\\Program Files (x86)\\Mozilla Firefox 26\\firefox.exe",
            "firefox_profile": "Firefox_26",
            "platform": "WINDOWS",
            "maxInstances": 1
        },
...

if i setup my protractor configuration file like this:

exports.config = {
    baseUrl: 'http://10.1.8.157:2000',
    seleniumAddress: 'http://10.1.8.157:4444/wd/hub',
    specs: ['frontendtests/*.js'],

    framework: 'jasmine',
    jasmineNodeOpts: {
        showColors: true,
        defaultTimeoutInterval: 30000
    },

    allScriptsTimeout: 20000,

    // Default capabilities to be passed to the webdriver instance.
    capabilities: {
        browserName: 'firefox',
        version: '26',
        platform: 'WINDOWS'
    }
};

the tests will be executed in the correct firefox version 26 browser on selenium-node.

If ill comment out the capabilities in my protractor configuration file and setup the Gruntfile.js like this:

 protractor: {

            options: {
                configFile: 'protractor.conf.js',
            },

            run: {},

            firefox25: {
                options: {
                    args: {
                        capabilities: {
                            browserName: 'firefox',
                            version: '25',
                            platform: 'WINDOWS'
                        }
                    }
                }
            }
            ...
        }

The selenium hub says:

INFO: Got a request to create a new session: Capabilities [{platform=WINDOWS, browserName=firefox, version=25}]

like if ill define the capabilities in protractor configuration file, but on the test-executing machine there is an exception:

UnknownError: Error forwarding the new session cannot find : Capabilities [{platform=WINDOWS, browserName=firefox, version=25}]

So it seems, the request to the selenium-hub does work, but whats the problem now?

Grunt return 0 even if a protractorjs test fail

According to gruntjs/grunt#1114
It is a problem in grunt-protractor-runner

I see

Running "protractor:run" (protractor) task
Using the selenium server at http://localhost:4444/wd/hub
[launcher] Running 1 instances of WebDriver[launcher] chrome passed
>> 
>> Test failed but keep the grunt process alive.

Done, without errors.

Can you confirm it is a problem in this project?

Got code 302 from http://selenium-release.storage.googleapis.com/2.41/ ....

Running this command:
./node_modules/grunt-protractor-runner/node_modules/.bin/webdriver-manager update --standalone --chrome

Backtrace:
Updating selenium standalone
downloading http://selenium-release.storage.googleapis.com/2.41/selenium-server-standalone-2.41.0.jar...
Updating chromedriver
downloading https://chromedriver.storage.googleapis.com/2.9/chromedriver_linux64.zip...

/workspace/client/node_modules/grunt-protractor-runner/node_modules/protractor/bin/webdriver-manager:123
throw new Error('Got code ' + res.statusCode + ' from ' + fileUrl);
^
Error: Got code 302 from http://selenium-release.storage.googleapis.com/2.41/selenium-server-standalone-2.41.0.jar
at ClientRequest. (/workspace/client/node_modules/grunt-protractor-runner/node_modules/protractor/bin/webdriver-manager:123:13)
at ClientRequest.g (events.js:175:14)
at ClientRequest.EventEmitter.emit (events.js:95:17)
at HTTPParser.parserOnIncomingClient as onIncoming
at HTTPParser.parserOnHeadersComplete as onHeadersComplete
at Socket.socketOnData as ondata
at TCP.onread (net.js:525:27)

Found a possible solution at this url:
http://stackoverflow.com/questions/7323932/how-do-you-follow-an-http-redirect-in-node-js

can't run

Here is my Gruntfile.js:

module.exports = function (grunt) {
  grunt.initConfig({
    protractor: {
      options: {
        configFile: 'protractor.conf.js'
      },
      all: {
      }
    }
  });
  grunt.loadNpmTasks('grunt-protractor-runner');
};

When I run "grunt protractor", I get this output and nothing else:

Running "protractor:all" (protractor) task

I tried adding a console.log call inside the task definition and that is not output.

keepAlive should default to false

Setting keepAlive by default to true is counter-intuitive. In the default configuration it causes the Grunt run to not fail even if tests fail. I know no other task that does this by default, there's a reason --force is not a default switch in Grunt.

Please, change the default to false.

Include support of selenium 'capabilities'

I would like to have support of capabilities, so I can have different tests run the same configuration file with different selenium capabilities

Such as (Gruntfile.js):

grunt.initConfig( {

    ...

    protractor: {
        options: { // Global options
            configFile: "test/protractorConf.js", // Default config file
            args: {
                seleniumServerJar: './test/e2e/selenium-server-standalone-2.37.0.jar',
                baseUrl: 'http://localhost',
            }
        },
        chrome: { // Chrome Specific options
            args: {
                capabilities: {
                    'browserName': 'chrome'
                }
            }
        },
        firefox: { // Firefox Specific options
            args: {
                capabilities: {
                    'browserName': 'firefox'
                }
            }
        },
        safari: { // Safari Specific options
            args: {
                capabilities: {
                    'browserName': 'safari'
                }
            }
        },
        ie: { // Internet Explorer Specific options
            args: {
                capabilities: {
                    'browserName': 'internet explorer'
                }
            }
        }
    },

    ...

});

Thanks!

Using with Protractor >= 1.0

Is it possible to use grunt-protractor-runner with latest Protractor? Currently the
package.json specifies that:

"dependencies": {
    "protractor": ">=0.14.0-0 <1.0.0"
}

Would it be possible to change this to just:

"dependencies": {
    "protractor": ">=0.14.0-0"
}

Paramerts are not working from grunt file

Hi,

I am trying to pass parameters from grunt file to jasmine test cases but unable to get the parameters in jasmine test cases or protractor config file.

i am using bellow code in grunt .

protractor: {
options: {
keepAlive: true,
configFile: "test/configfile.js",
args: {
params:{
username:'username1'

        }

  }
  },


  singlerun: {},
  auto: {
    keepAlive: true,
    options: {
      args: {
        seleniumPort: 4444,


                 }
    }
  }
    }

i am trying to retrieve the in test cases as browser.username

Regards
omPrakash

Debug option does not seem to work

Here is my current Grunt configuration:

protractor: {
      options: {
        configFile: 'protractor.conf.js', // Default config file
        keepAlive: true, // If false, the grunt process stops when the test fails.
        debug: false,
        args: {
          // Arguments passed to the command
        }
      },
      e2e: {
      }
}

and if I grunt using this config everything runs as expected. As soon as I change the debug to true, I get

< debugger listening on port 5858
connecting....

and it never connects, eventually timing out. Seems like the debug options does not function or I might be doing something wrong. Any help will be appreciated.

suite doesn't work

in the config file I have a suites defined

  suites: {
    createQuote: [
        'specs/EQ/createOppertunity.spec.js',
        'specs/EQ/CreateQuote.spec.js'
    ],
    config: [
        './specs/EQ/addE72.spec.js',
        './specs/EQ/addPremesisEquipment.spec.js',
        './specs/EQ/addXCVRSEquipment.spec.js',
        './specs/EQ/addSoftwareServiceVerify.spec.js'
    ],
    lineItemGrid: [
        './specs/line-item-grid/line-item-grid.spec.js',
        './specs/line-item-grid/changeDiscount.spec.js'
    ],
    output: [
        './specs/output/changeNodes.spec.js',
        './specs/output/EQOutput.spec.js',
    ]
  }

Running protractor straight from the command line gives me the correct results.
Running protractor from grunt tells me that no files match.

Update protractor

Lots of new commits in protractor. All the way up to version 1.3.1. Would be great to update this project to bring in all the new magic.

If you are amenable to this let me know and i will provide a PR.

Merge options.args and [target].options.args

Currently is seems that if I specify config like this:

protractor: {
    options: {
        args: {
            browser: grunt.option('browser') || 'firefox'
       }
    }
   functional: {
       options: {
            args: {
                baseUrl: 'http://something:' + (grunt.option('port') || '9999')
            }
       }
    }
}

Then I lose the protractor.options.args values (i.e. the browser). These only work if I remove the args from the target. The target option args should override the main options args rather than removing them completely.

ReferenceError: jasmine is not defined v0.2.3

Downgrading to 0.2.1 worked well for me in resolving this. I'm not sure if the use of minijasminenode is contributing to this issue, however, I was running into this while trying to run a remote test on a selenium grid.

Currently running Windows 7

Warning:
C:...\node_modules\jasmine-reporters\src\jasmine.console_reporter.js:2
if (! jasmine) {
^
ReferenceError: jasmine is not defined
at C:...\node_modules\jasmine-reporters\src\jasmine.console_reporter.js:2:11
at Object. (C:...\node_modules\jasmine-reporters\src\jasmine.console_reporter.js:1
42:3)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (C:...\node_modules\jasmine-reporters\src\load_reporters.js:1:63)
at Module._compile (module.js:456:26) Use --force to continue.

How to run a specific suite and all suites using your plugin

I want to run a specific suite that is specified in the protractor config, how can i run it.
other times i might want to run all the suites for regression, how can i do that as well.

Currently i have a task that i run, as a part of this task i want to mention a specific suite to be executed.

grunt protractor:e2eLocalSmoketest

Running multiple protractor tests via Grunt??

Hello,
I would like to run multiple protractor tests via Grunt. Here is how my setup is:
I have test dir with test1Spec.js, test2Spec.js, โ€ฆ., testnSpec.js

I have a configuration file protractorIntegrationTestsConf.js with specs listed like this:
specs: [
'../src/test/integration/test1Spec.js',
'../src/test/integration/test2Spec.js',
'../src/test/integration/test3Spec.js',
.
.
.
'../src/test/integration/testnSpec.js'
],

And, my Gruntfile.js has the following protractor task in it
protractor: {
options: {
configFile: "config/protractorIntegrationTestsConf.js",
keepAlive: false,
noColor: false,
singleRun: false,
},
run_chrome: {
options: {
args: {
browser: "chrome"
}
}
},
run_firefox: {
options: {
args: {
browser: "firefox"
}
}
},
run_phantomjs: {
options: {
args: {
browser: "phantomjs"
}
}
}
},

When I run my protractor config file with just protractor all the specs get run in sequence they are listed in config file, but when I try to run it via grunt, all the tests start running simultaneously and the grunt build fails. What is that I am doing wrong here in my setup? Can someone please help me?

Thanks,
Divya

Ability to export junit xml reports

In order to display results in gerrit, you need to export as junit xml reports. The junitreport and output flag exists within jasmineNode but it isn't in the jasmineNodeOpts. Could this be added?

Overriding args doesn't work

grunt.initConfig({
protractor:{
  options:{
    args:{
      baseUrl: 'http:\\www.github.com'
    }
  },
firefox:{
  options:{
    args:{
      browser: 'firefox',
      baseUrl: 'http:\\www.github.com'  // This is needed as the value from above is ignored.
    }
  },

Cannot find chrome Driver on grunt protractor

When I run protractor with
$protractor config/e2e.conf.js
It works without a problem but when I try to run it when grunt I get a chrome driver not found error

/Users/Alfred/Development/git/f1/Web/f1/test/node_modules/protractor/lib/driverProviders/local.dp.js:42
throw new Error('Could not find chromedriver at ' +
^
Error: Could not find chromedriver at /Users/Alfred/Development/git/f1/Web/f1/test/node_modules/protractor/selenium/chromedriver.exe
at LocalDriverProvider.addDefaultBinaryLocs_ (/Users/Alfred/Development/git/f1/Web/f1/test/node_modules/protractor/lib/driverProviders/local.dp.js:42:15)
at LocalDriverProvider.setupEnv (/Users/Alfred/Development/git/f1/Web/f1/test/node_modules/protractor/lib/driverProviders/local.dp.js:59:8)
at Runner.run (/Users/Alfred/Development/git/f1/Web/f1/test/node_modules/protractor/lib/runner.js:308:31)
at process. (/Users/Alfred/Development/git/f1/Web/f1/test/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

Fatal error: protractor exited with code: 1

Heres my config file:

    protractor: {
        options: {
            configFile: "config/e2etest.conf.js",
            keepAlive: false,
        },
        chrome: {
            options: {
                args: {
                    browser: "chrome"
                }
            }
        },
        firefox: {
            options: {
                args: {
                    browser: "firefox"
                }
            }
        },
        safari: {
            options: {
                args: {
                    browser: "safari"
                }
            }
        }
    }

How to pass complex params to protractor from command line?

Hi!

In the readme I can see

options.args

Type: Object Default value: {}

Arguments passed to the command. These arguments can also be supplied via command-line too.

But I can't figure out how I can pass complex params from command line, e.g. this

grunt protractor --params.someParam=someVal

doesn't work as expected.

Update global protractor install and configuration appendix.

The instructions for global protractor to work, the instructions talk about doing things with require() I did not have those problems.

I got it working with the following:

  1. npm install -g protractor
  2. webdriver-manger update
  3. webdriver-manager start
  4. Add the following in the protractor configuration
    seleniumAddress:'http://localhost:4444/wd/hub',

Note: webdriver-manager update is done to install down the chromedriver install.

I commented out the following in my protractor configuration for when I was using the internal protractor. They are no longer needed while using the global install.
// seleniumServerJar: PATH_TO_SERVER JAR,
// chromeDriver: DRIVER_PATH,

I did not have to delete the node_modules/protractor as the instructions show.

My solution requires 3 terminal windows though:

  1. grunt - serving the application.
  2. webdriver-manager start - running the selenium client.
  3. grunt protractor - grunt call to run the protractor tests

Is it possible to output the Jasmine test titles to the Grunt CLI?

When my Jasmine test starts with like

it('should select a default user', function () {

I would like to see the title output in the Grunt CLI, something like

Selenium standalone server started at http://192.168.xxx.xx:35848/wd/hub

- it should select a default user

Finished in 6.001 seconds

Is that possible?

SauceLabs support?

Hi! I installed grunt-protractor-runner.
Added the following to my gruntFile:
protractor: {
options: {
configFile: 'test/config/protractor.conf.js',
keepAlive: false
}
}

My protractor configuration specifies my sauce username and key and not a seleniumJar.
If I run protractor from terminal then my tests are executed fine in Sauce Labs .
When i try to run protractor using grunt my tests do not run. I just get a Done, without errors immediately.
I have protractor 0.12.1
and grunt-protractor-runner 0.1.8.
Can this be a configuration issue or is SauceLabs support not working yet?

Thank you

NPM install webdriver-manager update fails

After up updating to 0.2.2 npm install fails:

+ npm install
npm http GET https://registry.npmjs.org/grunt-protractor-runner
npm http 304 https://registry.npmjs.org/grunt-protractor-runner

> [email protected] install /var/lib/jenkins/jobs/DEPLOY-DEV-residential-microsite/workspace/node_modules/grunt-protractor-runner
> ./node_modules/protractor/bin/webdriver-manager update

sh: ./node_modules/protractor/bin/webdriver-manager: No such file or directory
npm ERR! [email protected] install: `./node_modules/protractor/bin/webdriver-manager update`
npm ERR! Exit status 127
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the grunt-protractor-runner package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ./node_modules/protractor/bin/webdriver-manager update
npm ERR! You can get their info via:
npm ERR!     npm owner ls grunt-protractor-runner
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.4.48-45.46.amzn1.x86_64
npm ERR! command "/opt/node/bin/node" "/opt/node/bin/npm" "install"
npm ERR! cwd /var/lib/jenkins/jobs/xxx/workspace
npm ERR! node -v v0.10.22
npm ERR! npm -v 1.3.14
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /var/lib/jenkins/jobs/xxx/workspace/npm-debug.log
npm ERR! not ok code 0
Build step 'Execute shell' marked build as failure
Finished: FAILURE

Warning: spawn ENOENT Use --force to continue

Hello,

I installed nodejs, grunt, bower and when I tried to run grunt e2e command, I'm getting the below error:

C:\workspace\iCORDS\iCORDS\iCORDS>grunt e2e
Running "shell:protractor" (shell) task
Warning: spawn ENOENT Use --force to continue.

Aborted due to warnings.

Can someone please help me with this issue.

Thanks in advance!
Madhu

Cannot find module 'protractor'

I'm getting this error when I run the task. I have protractor installed globally and it runs correctly using command line protractor. Not sure what the issue is...

Ignore null seleniumAddress argument values

I'm trying to make my build a bit more flexible by allowing some parameters to be set using grunt options rather than having multiple sets of config. I want to have my protractor tests run locally by default, or against a selenium grid if I use an option (using a default grid if I give no value, or the grid specified), so I tried some config like this:

protractor: {
    options: {
        seleniumAddress: grunt.option('grid') ? (grunt.option('grid') === true ? 'http://defaultGrid/wd/hub' : grunt.option('grid')) : null,
    }
}

However protractor ends up trying to use the null value rather than start up the local selenium server. I'd like it to treat having a null (or undefined, or whatever) value for seleniumAddress as no value.

(I'm currently working around this by having the options value require'd from another file which builds the args properly, but it would be much nicer to be able to do this inline in the grunt config - much clearer to see what is going on when you look at the grunt config)

I just noticed reading the code (and saw that it was in the docs too) that I can implement my original example config as protractor-runner will allow a seleniumAddress option by default, so I updated my example to what I am actually trying to do...

Grunt protractor process exits on any errors without reports

We have a setup of grunt protractor runner which runs suites.
Whenever there is an error on any one of the tests, it just quits the grunt process altogether.

 protractor: {
            options: {
                configFile: 'test/conf/protractor.conf.js',
                keepAlive: true
            },
            'e2e': {
                options: {
                    keepAlive: true,
                    noColor: false,
                    args: {
                        browser: 'chrome'
                    }
                }
            }
 }

Tried the keepAlive: true & false both and no difference.
It would be better if we can have some way to handle exceptions.

"grunt-protractor-runner": "^1.0.0",
"grunt-protractor-webdriver": "^0.1.8",

The keepAlive option doesn't work

This is how my config looks:

protractor: {
    e2e: {
        configFile: "protractor.conf.js",
        keepAlive: false
    }
}

But when my test fails the grunt process exits with a success.

Finished in 25.275 seconds
10 tests, 19 assertions, 8 failures

Done, without errors.

I use a pre-push hook in Git to run my tests. This hook should prevent me from pushing if the test fails. This now doesn't work because as far as git/the command knows everything is successful.

Cant npm install

From packages.json:

...
"protractor": "~0.11.0",
"grunt-protractor-runner": "~0.1.3",
...

Error on command line after running npm install:
npm ERR! peerinvalid The package protractor does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants protractor@~0.10.0

`npm test` doesn't work

$ npm i
...
$ npm test

> [email protected] test /Users/mgol/Documents/projects/public/grunt-protractor-runner
> grunt test

Running "clean:tests" (clean) task

Running "protractor:testTargetConfigFile" (protractor) task

/Users/mgol/Documents/projects/public/grunt-protractor-runner/node_modules/protractor/lib/driverProviders/local.js:42
        throw new Error('Could not find chromedriver at ' +
              ^
Error: Could not find chromedriver at /Users/mgol/Documents/projects/public/grunt-protractor-runner/node_modules/protractor/selenium/chromedriver.exe
    at LocalDriverProvider.addDefaultBinaryLocs_ (/Users/mgol/Documents/projects/public/grunt-protractor-runner/node_modules/protractor/lib/driverProviders/local.js:42:15)
    at LocalDriverProvider.setupEnv (/Users/mgol/Documents/projects/public/grunt-protractor-runner/node_modules/protractor/lib/driverProviders/local.js:59:8)
    at Runner.run (/Users/mgol/Documents/projects/public/grunt-protractor-runner/node_modules/protractor/lib/runner.js:206:31)
    at Object.init (/Users/mgol/Documents/projects/public/grunt-protractor-runner/node_modules/protractor/lib/launcher.js:135:12)
    at Object.<anonymous> (/Users/mgol/Documents/projects/public/grunt-protractor-runner/node_modules/protractor/lib/cli.js:129:23)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
>> 
Fatal error: protractor exited with code: 8
npm ERR! Test failed.  See above for more details.
npm ERR! not ok code 0

Example of watch/keepAlive

Hi,

Really new to frontend development and the protractor workflow. I sure would love to avoid the 10+s startup penalty of end to end tests. It seems like keepAlive is the way to go and your docs mention using watch (assuming grunt-watch?). Could you provide a doc with an example of how you'd configure this. I'd find it super helpful.

Thanks!

jasmineNodeOpts.onComplete callback not running

The following config isn't working as expected:

jasmineNodeOpts: {
    // onComplete will be called just before the driver quits.
    onComplete: function(runner, log) {
      console.log('DONE!');
    },
    // If true, display spec names.
    isVerbose: true,
    // If true, print colors to the terminal.
    showColors: true,
    // If true, include stack traces in failures.
    includeStackTrace: true,
    // Default time to wait in ms before a test fails.
    defaultTimeoutInterval: 30000
  }

Seems that onComplete is never called.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.