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

Commit ddb8584

Browse files
mattfritzsjelin
authored andcommitted
chore(cucumber): Remove cucumber from internal implementation
1 parent ac1e21e commit ddb8584

19 files changed

+29
-325
lines changed

docs/frameworks.md

+16-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Choosing a Framework
22
====================
33

4-
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.
4+
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.
55

66

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

61-
_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)._
61+
_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)._
6262

6363

6464
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.
6565

6666
```
6767
npm install -g cucumber
68+
npm install --save-dev protractor-cucumber-framework
6869
```
6970

70-
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.
71+
Set the 'framework' property to custom by adding `framework: 'custom'` and `frameworkPath: 'protractor-cucumber-framework'` to the [config file](../spec/cucumberConf.js)
7172

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

7475
```js
75-
cucumberOpts: {
76-
format: "summary"
77-
}
76+
exports.config = {
77+
// set to "custom" instead of cucumber.
78+
framework: 'custom',
79+
80+
// path relative to the current config file
81+
frameworkPath: 'protractor-cucumber-framework'
82+
83+
// relevant cucumber command line options
84+
cucumberOpts: {
85+
format: "summary"
86+
}
87+
};
7888
```
7989

80-
For a full example, see Protractor’s own test: [/spec/cucumber/lib.feature](/spec/cucumber/lib.feature).
81-
82-
8390
Using a Custom Framework
8491
------------------------
8592

docs/infrastructure.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ How It Works
22
============
33

44

5-
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.
5+
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.
66

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

docs/jasmine-upgrade.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Specify that you want to use jasmine2.x:
99

1010
```javascript
1111
exports.config = {
12-
// 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.
12+
// Specify you want to use jasmine 2.x as you would with mocha. Note, 'jasmine' by default will use the latest jasmine framework.
1313
framework: 'jasmine'
1414
};
1515

docs/referenceConf.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ exports.config = {
279279
// ---------------------------------------------------------------------------
280280

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

@@ -319,7 +319,7 @@ exports.config = {
319319
reporter: 'list'
320320
},
321321

322-
// Options to be passed to Cucumber.
322+
// Options to be passed to Cucumber (when set up as a custom framework).
323323
cucumberOpts: {
324324
// Require files before executing the features.
325325
require: 'cucumber/stepDefinitions.js',

lib/cli.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ var optimist = require('optimist').
4848
describe('verbose', 'Print full spec names').
4949
describe('stackTrace', 'Print stack trace on error').
5050
describe('params', 'Param object to be passed to the tests').
51-
describe('framework', 'Test framework to use: jasmine, cucumber or mocha').
51+
describe('framework', 'Test framework to use: jasmine, mocha, or custom').
5252
describe('resultJsonOutputFile', 'Path to save JSON test result').
5353
describe('troubleshoot', 'Turn on troubleshooting output').
5454
describe('elementExplorer', 'Interactively test Protractor commands').

lib/configParser.js

-13
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ var ConfigParser = function() {
3434
defaultTimeoutInterval: (30 * 1000)
3535
},
3636
seleniumArgs: [],
37-
cucumberOpts: {},
3837
mochaOpts: {
3938
ui: 'bdd',
4039
reporter: 'list'
@@ -95,26 +94,14 @@ ConfigParser.resolveFilePatterns =
9594

9695
if (patterns) {
9796
for (var i = 0; i < patterns.length; ++i) {
98-
// Cucumber allows running a spec given a line number. See
99-
// https://github.com/angular/protractor/issues/2413
100-
// TODO: when we deprecated node < v0.12 switch to using path.parse as in
101-
// d6aebbad6e9b191fef141472887637ee4318438e
10297
var fileName = patterns[i];
103-
var lineNumber = /:\d+$/.exec(fileName);
104-
if (lineNumber) {
105-
fileName = fileName.slice(0, lineNumber.index);
106-
lineNumber = lineNumber[0].slice(1);
107-
}
10898
var matches = glob.sync(fileName, {cwd: cwd});
10999

110100
if (!matches.length && !opt_omitWarnings) {
111101
log.warn('pattern ' + patterns[i] + ' did not match any files.');
112102
}
113103
for (var j = 0; j < matches.length; ++j) {
114104
var resolvedPath = path.resolve(cwd, matches[j]);
115-
if (lineNumber) {
116-
resolvedPath += ':' + lineNumber;
117-
}
118105
resolvedFiles.push(resolvedPath);
119106
}
120107
}

lib/frameworks/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ Requirements
2929

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

32-
- 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`
32+
- 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`
3333
object of the following structure:
3434
```
3535
specResults = [{
3636
description: string,
3737
assertions: [{
3838
passed: boolean,
3939
errorMsg: string,
40-
stackTrace: string
40+
stackTrace: string
4141
}],
4242
duration: integer
4343
}]
@@ -46,14 +46,14 @@ Requirements
4646
Custom Frameworks
4747
-----------------
4848

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

5454
```js
5555
exports.config = {
56-
// set to "custom" instead of jasmine/mocha/cucumber.
56+
// set to "custom" instead of jasmine/mocha
5757
framework: 'custom',
5858
// path relative to the current config file
5959
frameworkPath: './frameworks/my_custom_jasmine.js',

lib/frameworks/cucumber.js

-189
This file was deleted.

lib/runner.js

-2
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,6 @@ Runner.prototype.run = function() {
295295
frameworkPath = './frameworks/jasmine.js';
296296
} else if (self.config_.framework === 'mocha') {
297297
frameworkPath = './frameworks/mocha.js';
298-
} else if (self.config_.framework === 'cucumber') {
299-
frameworkPath = './frameworks/cucumber.js';
300298
} else if (self.config_.framework === 'debugprint') {
301299
// Private framework. Do not use.
302300
frameworkPath = './frameworks/debugprint.js';

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
"chai-as-promised": "~5.1.0",
3333
"jshint": "2.5.0",
3434
"mocha": "2.3.3",
35-
"cucumber": "~0.8.0",
3635
"express": "~3.3.4",
3736
"rimraf": "~2.2.6"
3837
},

0 commit comments

Comments
 (0)