A Grunt plugin for running protractor runner.
Installations
npm install grunt-protractor-runner
Releases
Unable to fetch releases
Developer
teerapap
Developer Guide
Module System
CommonJS
Min. Node Version
>= 6.9.4
Typescript Support
No
Node Version
6.10.0
NPM Version
3.10.10
Statistics
149 Stars
240 Commits
123 Forks
12 Watching
3 Branches
38 Contributors
Updated on 12 Jan 2024
Bundle Size
1.32 kB
Minified
599.00 B
Minified + Gzipped
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
11,895,899
Last day
-5.6%
1,909
Compared to previous day
Last week
-6.2%
10,699
Compared to previous week
Last month
-5.2%
48,940
Compared to previous month
Last year
-9.8%
961,831
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
3
Peer Dependencies
1
Dev Dependencies
4
:rotating_light: Warning
This repository is DEPRECATED and no longer maintained.
Thank you for all your contributions
grunt-protractor-runner
A Grunt plugin for running Protractor runner.
Getting Started
This plugin requires Grunt >=0.4.1
.
For Protractor 5.x.x
, please use version v5.x.x
of this plugin.
For Protractor 4.x.x
, please use version v4.x.x
of this plugin.
For Protractor 3.x.x
, please use version v3.x.x
of this plugin.
For Protractor 2.x.x
, please use version v2.x.x
of this plugin.
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
1npm install grunt-protractor-runner --save-dev
This plugin will install protractor
module locally as a normal dependency.
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
1grunt.loadNpmTasks('grunt-protractor-runner');
Finally you need a Selenium server. If you don't have one set up already, you can install a local standalone version with this command:
1./node_modules/grunt-protractor-runner/scripts/webdriver-manager-update
The "protractor" task
Overview
In your project's Gruntfile, add a section named protractor
to the data object passed into grunt.initConfig()
.
1grunt.initConfig({
2 protractor: {
3 options: {
4 configFile: "node_modules/protractor/example/conf.js", // Default config file
5 keepAlive: true, // If false, the grunt process stops when the test fails.
6 noColor: false, // If true, protractor will not use colors in its output.
7 args: {
8 // Arguments passed to the command
9 }
10 },
11 your_target: { // Grunt requires at least one target to run so you can simply put 'all: {}' here too.
12 options: {
13 configFile: "e2e.conf.js", // Target-specific config file
14 args: {} // Target-specific arguments
15 }
16 },
17 },
18})
Options
options.configFile
Type: String
Default value: No default value
A protractor config file.
options.keepAlive
Type: Boolean
Default value: false
(true
before v1.0.0)
If true, grunt process continues even if the test fails. This option is useful when using with grunt watch. If false, grunt process stops when the test fails.
options.noColor
Type: Boolean
Default value: false
If true, protractor will not give colored output. If false, protractor will give colored output, as it does by default.
options.debug
Type: Boolean
Default value: false
If true, grunt will pass 'debug' as second argument to protractor CLI to enable node CLI debugging as described in Protractor Debugging documentation.
options.args
Type: Object
Default value: {}
Arguments passed to the command. These arguments can also be supplied via command-line too. Ex.grunt protractor --specs=specs/some-test.js
or for object options grunt protractor --cucumberOpts={\"tags\":\"@quick\"}
or --params='{ "location" : { "href" : "some url" } }'
Passing object argument with --params.xxx.yyy=zzz
is not supported at the moment. If you need this behaviour, please join the discussion in #148 .
Supported arguments are below.
- seleniumAddress
string
: A running selenium address to use - seleniumServerJar
string
: Location of the standalone selenium server .jar file - seleniumPort
string
: Optional port for the standalone selenium server - baseUrl
string
: URL to prepend to all relative paths - rootElement
string
: Element housing ng-app, if not html or body - specs
array
: Array of spec files to test. Ex.["spec1.js","spec2.js"]
- exclude
array
: Array of files to exclude from testing. Ex.["spec2.js"]
- suite
string
orarray
: Suite or Array of suites to run. Ex.["suite1", "suite2"]
- includeStackTrace
boolean
: Print stack trace on error - verbose
boolean
: Print full spec names - browser
string
: Browser name, e.g. chrome or firefox - params
object
: Param object to be passed to the test as browser.params - chromeDriver
string
: Location of chrome driver overridng the property in config file - directConnect
boolean
: To connect directly to the browser Drivers. This option is only available for Firefox and Chrome. - sauceUser
string
: Username for a SauceLabs account - sauceKey
string
: Access Key for a SauceLabs account - sauceSeleniumAddress
string
: Customize the URL Protractor uses to connect to sauce labs (for example, if you are tunneling selenium traffic through a sauce connect tunnel). Default isondemand.saucelabs.com:80/wd/hub
- capabilities
object
: Capabilities object to be passed to the test, e.g. browserName, platform and version - framework
string
: Limited support for using mocha as the test framework instead of jasmine. - frameworkPath
string
: Whenframework
is set tocustom
, set this path relative to the config file or absolute - cucumberOpts
object
: Cucumber framework options object to be passed to the test, e.g. require, tags and format - mochaOpts
object
: Mocha test framework options object to be passed - beforeLaunch
string
: You can specify a file containing code to run once configs are read but before any environment setup. This will only run once, and before onPrepare. - onPrepare
string
: You can specify a file containing code to run once protractor is ready and available, and before the specs are executed. If multiple capabilities are being run, this will run once per capability. - webDriverProxy
string
: WebDriver proxy configuration to run remote tests
options.output
Type: String
Default value: false
The file that the task should output the results to.
options.outputOptions
Type: Object
Default value: {}
Options for output file. For details see: fs.createWriteStream's options
options.nodeBin
Type: String
Default value: node
Path to the node binary file. Useful if node is not on the PATH.
options.webdriverManagerUpdate
Type: Boolean
Default value: false
If true, webdriver-manager update
will run and install/update selenium driver.
Tests
Run npm install
to install dependencies.
Then run grunt
or npm test
to test the module. You will encounter these.
- Runs unit and e2e tests
- It opens chrome a couple of times without warnings or errors.
- A test task fails but the test process keeps alive and continues to the next test tasks.
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
FAQ
Q: Want to global installed protractor?
This plugin installs protractor
module locally as a normal dependency.
In case you want to use the plugin with the global installed protractor command. You can do it with these steps below.
- Remove local install protractor by
rm -rf node_modules/protractor
- Install
protractor
globally withnpm install -g protractor
- Make sure that node can resolve the module with
require()
mechanism. See Module loading from the global folders for more information. - Run
webdriver-manager update
to install/update selenium driver for global install protractor.
Q: Error: Could not find chromedriver at....
You need to install/update selenium webdriver for protractor.
- Run
webdriver-manager update
ornode scripts/webdriver-manager-update
ornode ./node_modules/protractor/bin/webdriver-manager update
Release History
-
5.0.0
- Upgrade
protractor
to version 5 (#185)
- Upgrade
-
4.0.0
- Accept array for
suite
argument (#172) - Upgrade
protractor
to version 4 (#168)
- Accept array for
-
3.2.0
- Support --frameworkPath in options.args (#155, #156)
- Support
grunt
version>=0.4.0"
(#154)
-
3.1.0
- Add
options.outputOptions
(#143) - Support
webDriverProxy
inoptions.args
(#147) - Remove referenceConf.js as default value of options.configFile because it does not exist anymore
- Add
-
3.0.0
- Update protractor to version 3
- Update other dependencies including through2 and split to latest version
-
2.1.2
- Fix boolean parameters in object.args.params (#130)
- Modify unit tests to run nodeunit test faster and after protractor task
-
2.1.1
- Fix EINVAL error when run in git bash shell (#134)
-
2.1.0
- Add
options.webdriverManagerUpdate
option (#125) - Fix support for object option via command-line (#116)
- Add
-
2.0.0
- Upgrade
protractor
to^2.0.0
(#114) chromeOnly
inoptions.args
is deprecated. Replaced bydirectConnect
(#114)- Support
beforeLaunch
andonPrepare
inoptions.args
(#110) - When one of the tests fails, throw warning instead of fatal error so that grunt can still use --force to continue. (#103)
- Upgrade
-
1.2.1
- Move
split
andthrough2
from devDependencies to dependencies (#104)
- Move
-
1.2.0
- Add
options.nodeBin
to specify node binary (#96) - Support --directConnect and --sauceSeleniumAddress in options.args (#95, #101)
- Add options.output (#80)
- Merge README.md PRs (#89, #91)
- Fix plugin test for protractor>=v1.5.0
- Fix TravisCI test
- Add
-
1.1.4
- Move
webdriver-manager update
step from problematic postinstall to pretest
- Move
-
1.1.3
- Attempt to fix webdriver-manager postinstall problem with webdriver-manager script (#83)
-
1.1.2
- Attempt to fix webdriver-manager path in package.json postinstall
- Add Travis CI build configuration
-
1.1.1
- Run webdriver-manager update on postinstall (#41)
-
1.1.0
- Update protractor to version 1.x.x
-
1.0.1
- Pass specified command line params to the subprocess (#68)
- Make npm test to run and handle interactive debugger by itself (#66)
- Fixed argsTest
-
1.0.0
- Change default value of
options.keepAlive
to false (#50)
- Change default value of
-
0.2.5
- Support --mochaOpts, --suite and --exclude in options.args (#52, #53, #57)
-
0.2.4
- Support --cucumberOpts in options.args (#46)
-
0.2.3
- Temporarily remove automatically download/update webdriver-manager because it fails in some environment such as Windows (#41)
-
0.2.2
- Add
protractor
module as a normal dependency and automatically download/update webdriver withwebdriver-manager
after installed (#29, #39) - Support --framework in options.args (#36)
- Add
-
0.2.1
- Support --capabilities in options.args (#33)
-
0.2.0
- Able to use either local or global install protractor the same way as how
require()
function works (#29) - Move protractor from
peerDependencies
todevDependencies
. These changes might break some user modules. (See FAQ above for explanation) (#29)
- Able to use either local or global install protractor the same way as how
-
0.1.11 - Support SauceLabs account config in options.args (#27)
-
0.1.10
- Support --chromeOnly in options.args (#23)
- Support options.noColor to turn color off in protractor output (#24)
-
0.1.9
- Able to supply options.args via command-line arguments (#20)
- Fixed merging task-level and target-level options
-
0.1.8 - Support --chromeDriver in options.args (#17)
-
0.1.7 - Support --browser and --params arguments passed to the protractor command using config in options.args (#12)
-
0.1.6 - Change protractor(peerDependencies) to support version to 0.x (#8, #9, #10)
-
0.1.5 - Added
options.debug
(#7) -
0.1.4 - Change protractor(peerDependencies) to support version to 0.10.x - 0.11.x (#6)
-
0.1.3 - Fixed Windows command
-
0.1.2 - Added keepAlive option.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE-MIT:0
- Info: FSF or OSI recognized license: MIT License: LICENSE-MIT:0
Reason
Found 6/23 approved changesets -- score normalized to 2
Reason
project is archived
Details
- Warn: Repository is archived.
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 13 are checked with a SAST tool
Score
3.3
/10
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More