Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
chore(cucumber): Remove cucumber from internal implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfritz authored and sjelin committed Nov 17, 2015
1 parent ac1e21e commit ddb8584
Show file tree
Hide file tree
Showing 19 changed files with 29 additions and 325 deletions.
25 changes: 16 additions & 9 deletions docs/frameworks.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Choosing a Framework
====================

Protractor supports three behavior driven development (BDD) test frameworks: Jasmine, Mocha, and Cucumber. These frameworks are based on JavaScript and Node.js and provide the syntax, scaffolding, and reporting tools you will use to write and manage your tests.
Protractor supports two behavior driven development (BDD) test frameworks out of the box: Jasmine and Mocha. These frameworks are based on JavaScript and Node.js and provide the syntax, scaffolding, and reporting tools you will use to write and manage your tests.


Using Jasmine
Expand Down Expand Up @@ -58,28 +58,35 @@ For a full example, see Protractor’s own test: [/spec/mocha/lib_spec.js](/spec
Using Cucumber
--------------

_Note: Limited support for Cucumber is available as of January 2015. Support for Cucumber in Protractor is maintained by the community, so bug fixes may be slow. For more information, see the [Cucumber GitHub site](https://github.com/cucumber/cucumber-js)._
_Note: Cucumber is no longer included by default as of version `3.0`. You can integrate Cucumber with Protractor with the `custom` framework option. For more information, see the [Protractor Cucumber Framework site](https://github.com/mattfritz/protractor-cucumber-framework) or the [Cucumber GitHub site](https://github.com/cucumber/cucumber-js)._


If you would like to use the Cucumber test framework, download the dependencies with npm. Cucumber should be installed in the same place as Protractor - so if protractor was installed globally, install Cucumber with -g.

```
npm install -g cucumber
npm install --save-dev protractor-cucumber-framework
```

Set the 'framework' property to cucumber, either by adding `framework: 'cucumber'` to the [config file](../spec/cucumberConf.js) or by adding `--framework=cucumber` to the command line.
Set the 'framework' property to custom by adding `framework: 'custom'` and `frameworkPath: 'protractor-cucumber-framework'` to the [config file](../spec/cucumberConf.js)

Options for Cucumber such as 'format' can be given in the config file with cucumberOpts:

```js
cucumberOpts: {
format: "summary"
}
exports.config = {
// set to "custom" instead of cucumber.
framework: 'custom',

// path relative to the current config file
frameworkPath: 'protractor-cucumber-framework'

// relevant cucumber command line options
cucumberOpts: {
format: "summary"
}
};
```

For a full example, see Protractor’s own test: [/spec/cucumber/lib.feature](/spec/cucumber/lib.feature).


Using a Custom Framework
------------------------

Expand Down
2 changes: 1 addition & 1 deletion docs/infrastructure.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ How It Works
============


Protractor is an end-to-end test framework for AngularJS applications. Protractor is a Node.js program that supports the Jasmine, Mocha, and Cucumber test frameworks.
Protractor is an end-to-end test framework for AngularJS applications. Protractor is a Node.js program that supports the Jasmine and Mocha test frameworks.

Selenium is a browser automation framework. Selenium includes the Selenium Server, the WebDriver APIs, and the WebDriver browser drivers.

Expand Down
2 changes: 1 addition & 1 deletion docs/jasmine-upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Specify that you want to use jasmine2.x:

```javascript
exports.config = {
// Specify you want to use jasmine 2.x as you would with mocha and cucumber. Note, 'jasmine' by default will use the latest jasmine framework.
// Specify you want to use jasmine 2.x as you would with mocha. Note, 'jasmine' by default will use the latest jasmine framework.
framework: 'jasmine'
};

Expand Down
6 changes: 3 additions & 3 deletions docs/referenceConf.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ exports.config = {
// ---------------------------------------------------------------------------

// Test framework to use. This may be one of:
// jasmine, cucumber, mocha or custom.
// jasmine, mocha or custom.
//
// When the framework is set to "custom" you'll need to additionally
// set frameworkPath with the path relative to the config file or absolute
Expand All @@ -289,7 +289,7 @@ exports.config = {
// to comply with the interface details of your custom implementation.
//
// Jasmine is fully supported as test and assertion frameworks.
// Mocha and Cucumber have limited support. You will need to include your
// Mocha has limited support. You will need to include your
// own assertion framework (such as Chai) if working with Mocha.
framework: 'jasmine',

Expand Down Expand Up @@ -319,7 +319,7 @@ exports.config = {
reporter: 'list'
},

// Options to be passed to Cucumber.
// Options to be passed to Cucumber (when set up as a custom framework).
cucumberOpts: {
// Require files before executing the features.
require: 'cucumber/stepDefinitions.js',
Expand Down
2 changes: 1 addition & 1 deletion lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var optimist = require('optimist').
describe('verbose', 'Print full spec names').
describe('stackTrace', 'Print stack trace on error').
describe('params', 'Param object to be passed to the tests').
describe('framework', 'Test framework to use: jasmine, cucumber or mocha').
describe('framework', 'Test framework to use: jasmine, mocha, or custom').
describe('resultJsonOutputFile', 'Path to save JSON test result').
describe('troubleshoot', 'Turn on troubleshooting output').
describe('elementExplorer', 'Interactively test Protractor commands').
Expand Down
13 changes: 0 additions & 13 deletions lib/configParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ var ConfigParser = function() {
defaultTimeoutInterval: (30 * 1000)
},
seleniumArgs: [],
cucumberOpts: {},
mochaOpts: {
ui: 'bdd',
reporter: 'list'
Expand Down Expand Up @@ -95,26 +94,14 @@ ConfigParser.resolveFilePatterns =

if (patterns) {
for (var i = 0; i < patterns.length; ++i) {
// Cucumber allows running a spec given a line number. See
// https://github.com/angular/protractor/issues/2413
// TODO: when we deprecated node < v0.12 switch to using path.parse as in
// d6aebbad6e9b191fef141472887637ee4318438e
var fileName = patterns[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: cwd});

if (!matches.length && !opt_omitWarnings) {
log.warn('pattern ' + patterns[i] + ' did not match any files.');
}
for (var j = 0; j < matches.length; ++j) {
var resolvedPath = path.resolve(cwd, matches[j]);
if (lineNumber) {
resolvedPath += ':' + lineNumber;
}
resolvedFiles.push(resolvedPath);
}
}
Expand Down
10 changes: 5 additions & 5 deletions lib/frameworks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ Requirements

- `runner.getConfig().onComplete` must be called when tests are finished.

- The returned promise must be resolved when tests are finished and it should return a results object. This object must have a `failedCount` property and optionally a `specResults`
- The returned promise must be resolved when tests are finished and it should return a results object. This object must have a `failedCount` property and optionally a `specResults`
object of the following structure:
```
specResults = [{
description: string,
assertions: [{
passed: boolean,
errorMsg: string,
stackTrace: string
stackTrace: string
}],
duration: integer
}]
Expand All @@ -46,14 +46,14 @@ Requirements
Custom Frameworks
-----------------

If you have created/adapted a custom framework and want it added to
Protractor core please send a PR so it can evaluated for addition as an
If you have created/adapted a custom framework and want it added to
Protractor core please send a PR so it can evaluated for addition as an
official supported framework. In the meantime you can instruct Protractor
to use your own framework via the config file:

```js
exports.config = {
// set to "custom" instead of jasmine/mocha/cucumber.
// set to "custom" instead of jasmine/mocha
framework: 'custom',
// path relative to the current config file
frameworkPath: './frameworks/my_custom_jasmine.js',
Expand Down
189 changes: 0 additions & 189 deletions lib/frameworks/cucumber.js

This file was deleted.

2 changes: 0 additions & 2 deletions lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,6 @@ Runner.prototype.run = function() {
frameworkPath = './frameworks/jasmine.js';
} else if (self.config_.framework === 'mocha') {
frameworkPath = './frameworks/mocha.js';
} else if (self.config_.framework === 'cucumber') {
frameworkPath = './frameworks/cucumber.js';
} else if (self.config_.framework === 'debugprint') {
// Private framework. Do not use.
frameworkPath = './frameworks/debugprint.js';
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"chai-as-promised": "~5.1.0",
"jshint": "2.5.0",
"mocha": "2.3.3",
"cucumber": "~0.8.0",
"express": "~3.3.4",
"rimraf": "~2.2.6"
},
Expand Down
Loading

0 comments on commit ddb8584

Please sign in to comment.