|
1 | 1 | Choosing a Framework
|
2 | 2 | ====================
|
3 | 3 |
|
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. |
5 | 5 |
|
6 | 6 |
|
7 | 7 | Using Jasmine
|
@@ -58,28 +58,35 @@ For a full example, see Protractor’s own test: [/spec/mocha/lib_spec.js](/spec
|
58 | 58 | Using Cucumber
|
59 | 59 | --------------
|
60 | 60 |
|
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)._ |
62 | 62 |
|
63 | 63 |
|
64 | 64 | 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.
|
65 | 65 |
|
66 | 66 | ```
|
67 | 67 | npm install -g cucumber
|
| 68 | +npm install --save-dev protractor-cucumber-framework |
68 | 69 | ```
|
69 | 70 |
|
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) |
71 | 72 |
|
72 | 73 | Options for Cucumber such as 'format' can be given in the config file with cucumberOpts:
|
73 | 74 |
|
74 | 75 | ```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 | +}; |
78 | 88 | ```
|
79 | 89 |
|
80 |
| -For a full example, see Protractor’s own test: [/spec/cucumber/lib.feature](/spec/cucumber/lib.feature). |
81 |
| - |
82 |
| - |
83 | 90 | Using a Custom Framework
|
84 | 91 | ------------------------
|
85 | 92 |
|
|
0 commit comments