Socket
Socket
Sign inDemoInstall

protractor-cucumber-framework

Package Overview
Dependencies
36
Maintainers
2
Versions
96
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.3 to 0.2.0

.travis.yml

103

index.js
var q = require('q'),
glob = require('glob'),
assign = require('object-assign'),
path = require('path');

@@ -15,92 +15,25 @@

var Cucumber = require('cucumber'),
execOptions = ['node', 'node_modules/.bin/cucumber-js'],
cucumberResolvedRequire;
// Set up exec options for Cucumber
execOptions = execOptions.concat(specs);
if (runner.getConfig().cucumberOpts) {
var execOptions = assign({
format: [],
tags: [],
require: [],
compiler: []
}, runner.getConfig().cucumberOpts);
var configDir = runner.getConfig().configDir;
// Process Cucumber Require param
if (runner.getConfig().cucumberOpts.require) {
// TODO - this should move into the launcher.
var requirePatterns = runner.getConfig().cucumberOpts.require;
var configDir = runner.getConfig().configDir;
requirePatterns = (typeof requirePatterns === 'string') ?
[requirePatterns] : requirePatterns;
cucumberResolvedRequire = [];
if (requirePatterns) {
for (var i = 0; i < requirePatterns.length; ++i) {
// Cucumber allows running a spec given a line number.
// If you deprecated node < v0.12, switch to using path.parse
var fileName = requirePatterns[i];
var lineNumber = /:\d+$/.exec(fileName);
if (lineNumber) {
fileName = fileName.slice(0, lineNumber.index);
lineNumber = lineNumber[0].slice(1);
}
var matches = glob.sync(fileName, {cwd: configDir});
if (!matches.length) {
log.warn('pattern ' + requirePatterns[i] + ' did not match any files.');
}
for (var j = 0; j < matches.length; ++j) {
var resolvedPath = path.resolve(configDir, matches[j]);
if (lineNumber) {
resolvedPath += ':' + lineNumber;
}
cucumberResolvedRequire.push(resolvedPath);
}
}
}
if (cucumberResolvedRequire && cucumberResolvedRequire.length) {
execOptions = cucumberResolvedRequire.reduce(function(a, fn) {
return a.concat('-r', fn);
}, execOptions);
}
// Make sure that some option are array
['compiler', 'format', 'tags', 'require'].forEach(function (option) {
if (!Array.isArray(execOptions[option])) {
execOptions[option] = [ execOptions[option] ];
}
});
// Process Cucumber Tag param
if (Array.isArray(runner.getConfig().cucumberOpts.tags)) {
for (var i in runner.getConfig().cucumberOpts.tags) {
var tags = runner.getConfig().cucumberOpts.tags[i];
execOptions.push('-t');
execOptions.push(tags);
}
} else if (runner.getConfig().cucumberOpts.tags) {
execOptions.push('-t');
execOptions.push(runner.getConfig().cucumberOpts.tags);
}
// Resolve require absolute path
execOptions.require = execOptions.require.map(function (requirePath) {
return path.resolve(configDir, requirePath)
})
// Process Cucumber Format param
if (Array.isArray(runner.getConfig().cucumberOpts.format)) {
runner.getConfig().cucumberOpts.format.forEach(function (format) {
execOptions.push('-f');
execOptions.push(format);
});
} else if (runner.getConfig().cucumberOpts.format) {
execOptions.push('-f');
execOptions.push(runner.getConfig().cucumberOpts.format);
}
// Process Cucumber 'coffee' param
if (runner.getConfig().cucumberOpts.coffee) {
execOptions.push('--coffee');
}
// Process Cucumber 'no-snippets' param
if (runner.getConfig().cucumberOpts.noSnippets) {
execOptions.push('--no-snippets');
}
// Process Cucumber 'dry-run' param
if (runner.getConfig().cucumberOpts.dryRun) {
execOptions.push('-d');
}
}
global.cucumber = Cucumber.Cli(execOptions);

@@ -197,3 +130,3 @@

return q.promise(function(resolve, reject) {
var cucumberConf = Cucumber.Cli.Configuration(execOptions);
var cucumberConf = Cucumber.Cli.Configuration(execOptions, specs);
var runtime = Cucumber.Runtime(cucumberConf);

@@ -200,0 +133,0 @@ var formatters = cucumberConf.getFormatter ?

{
"name": "protractor-cucumber-framework",
"version": "0.1.3",
"version": "0.2.0",
"description": "Protractor framework for Cucumber.js",

@@ -35,7 +35,7 @@ "main": "index.js",

"dependencies": {
"glob": "^6.0.1",
"object-assign": "^4.0.1",
"q": "^1.4.1"
},
"peerDependencies": {
"cucumber": ">= 0.5 <= 0.8.1"
"cucumber": "^0.9.1"
},

@@ -45,3 +45,3 @@ "devDependencies": {

"chai-as-promised": "^5.1.0",
"cucumber": "^0.8.1",
"cucumber": "^0.9.1",
"httpster": "^1.0.1",

@@ -48,0 +48,0 @@ "protractor": "^2.5.1"

Protractor Cucumber Framework
=============================
[![Build Status](https://travis-ci.org/mattfritz/protractor-cucumber-framework.svg?branch=master)](https://travis-ci.org/mattfritz/protractor-cucumber-framework)
This framework was originally part of [angular/protractor](https://github.com/angular/protractor) and

@@ -18,4 +20,2 @@ is now a separate module to decouple [cucumber.js](https://github.com/cucumber/cucumber-js).

```js
var cucumberFrameworkPath = require('protractor-cucumber-framework').resolve();
exports.config = {

@@ -26,4 +26,4 @@ // set to "custom" instead of cucumber.

// path relative to the current config file
frameworkPath: cucumberFrameworkPath
frameworkPath: 'protractor-cucumber-framework'
};
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc