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

Improvements to frameworks.md and added postinstall script #3674

Merged
merged 3 commits into from
Dec 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 35 additions & 11 deletions docs/frameworks.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ expect(myElement.getText()).to.eventually.equal('some text');

Finally, set the 'framework' property to 'mocha', either by adding `framework: 'mocha'` to the config file or by adding `--framework=mocha` to the command line.

Options for Mocha such as 'reporter' and 'slow' can be given in the [config file](../spec/mochaConf.js) with mochaOpts:
Options for Mocha such as 'reporter' and 'slow' can be given in the [config file](/spec/mochaConf.js) with mochaOpts:

```js
mochaOpts: {
Expand All @@ -68,28 +68,52 @@ npm install -g cucumber
npm install --save-dev protractor-cucumber-framework
```

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

Options for Cucumber such as 'format' can be given in the config file with cucumberOpts:
Options for Cucumber such as 'format' can be given in the config file with cucumberOpts, A basic cucumberConf.js file has been provided below:

```js
/*
Basic configuration to run your cucumber
feature files and step definitions with protractor.
**/
exports.config = {
// set to "custom" instead of cucumber.
framework: 'custom',

// path relative to the current config file
frameworkPath: require.resolve('protractor-cucumber-framework'),

// relevant cucumber command line options
seleniumAddress: 'http://localhost:4444/wd/hub',

baseUrl: 'https://angularjs.org/',

capabilities: {
browserName:'chrome'
},

framework: 'custom', // set to "custom" instead of cucumber.

frameworkPath: require.resolve('protractor-cucumber-framework'), // path relative to the current config file

specs: [
'./cucumber/*.feature' // Specs here are the cucumber feature files
],

// cucumber command line options
cucumberOpts: {
format: "summary"
require: ['./cucumber/*.js'], // require step definition files before executing features
tags: [], // <string[]> (expression) only execute the features or scenarios with tags matching the expression
strict: true, // <boolean> fail if there are any undefined or pending steps
format: ["pretty"], // <string[]> (type[:path]) specify the output format, optionally supply PATH to redirect formatter output (repeatable)
dryRun: false, // <boolean> invoke formatters without executing steps
compiler: [] // <string[]> ("extension:module") require files with the given EXTENSION after requiring MODULE (repeatable)
},

onPrepare: function () {
browser.manage().window().maximize(); // maximize the browser before executing the feature files
}
};
```

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

Check section [Framework Adapters for Protractor](../lib/frameworks/README.md) specifically [Custom Frameworks](../lib/frameworks/README.md#custom-frameworks)
Check section [Framework Adapters for Protractor](/lib/frameworks/README.md) specifically [Custom Frameworks](/lib/frameworks/README.md#custom-frameworks)


2 changes: 1 addition & 1 deletion spec/mochaConf.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var env = require('./environment.js');

// A small suite to make sure the mocha frameowork works.
// A small suite to make sure the mocha framework works.
exports.config = {
seleniumAddress: env.seleniumAddress,

Expand Down