Permalink
Browse files

feat(serenity-protractor): Support for Protractor 5.1.x

This change adds support for using Serenity/JS with Protractor 5.0.0, 5.1.0 and 5.1.1:
- `ProtractorNotifier` deals with Protractor 5.1.0 requirement for test frameworks to invoke `runner.afterEach` after every test,
so that the browser is correctly restarted between the tests. See angular/protractor#4087
- `TestFrameworkDetector` registers `mochaOpts` and `cucumberOpts` as valid command line options,
benefiting from angular/protractor#3994 and dealing with a bug introduced in Protractor 5.0.0, which prevents command line arguments
from being passed on to custom test frameworks. See angular/protractor#3978
- Updated the examples and documentation to work with Protractor 5.1.x
- Enables #18

Related issues: angular/protractor#3978 angular/protractor#3994 angular/protractor#4087 #18
  • Loading branch information...
jan-molak committed Feb 11, 2017
1 parent 4ac4575 commit a6d9eab3363d2216a33cf4dae4019a217a27fe5b
View
@@ -32,7 +32,7 @@ To execute a specific scenario, configure an npm script called, for example,
```json
{
"scripts": {
"e2e-scenario": "protractor ./protractor.conf.js --disableChecks --cucumberOpts.name"
"e2e-scenario": "protractor ./protractor.conf.js --cucumberOpts.name"
},
"// other properties": "..."
}
@@ -44,8 +44,7 @@ Then issue the following terminal command:
$> npm run e2e-scenario "Name of the scenario you want to execute"
```
:warning: **CAUTION**: Protractor 5.0.0 has [a bug](https://github.com/angular/protractor/issues/3978)
that prevents `cucumberOpts.name` from being set using the command line if the `--disableChecks` switch is not provided.
{% include "../known-issues/protractor-5.0.0-cucumberOpts-disableChecks.html" %}
## Executing a group of scenarios using tags
@@ -93,7 +92,7 @@ To execute scenarios tagged with one specific tag using the command line, add th
```json
{
"scripts": {
"e2e-tag": "protractor ./protractor.conf.js --disableChecks --cucumberOpts.tags"
"e2e-tag": "protractor ./protractor.conf.js --cucumberOpts.tags"
},
"// other properties": "..."
}
@@ -110,7 +109,7 @@ Or, to specify multiple tags, add the below script to the `package.json`:
```json
{
"scripts": {
"e2e": "protractor ./protractor.conf.js --disableChecks"
"e2e": "protractor ./protractor.conf.js"
},
"// other properties": "..."
}
@@ -125,8 +124,7 @@ npm run e2e -- --cucumberOpts.tags=@smoketest --cucumberOpts.tags=@fast --cucumb
Tags can also be [logically joined](https://github.com/cucumber/cucumber/wiki/Tags) to cater for some of the more
sophisticated scenarios.
:warning: **CAUTION**: Protractor 5.0.0 has [a bug](https://github.com/angular/protractor/issues/3978)
that prevents `cucumberOpts.name` from being set using the command line if the `--disableChecks` switch is not provided.
{% include "../known-issues/protractor-5.0.0-cucumberOpts-disableChecks.html" %}
## Result
@@ -0,0 +1,15 @@
<div class="known-issue">
<p>
<strong>Caution</strong>: Protractor 5.0.0 has a bug
which prevents command line arguments, such as <code>--cucumberOpts</code>,
from being passed on to the test framework
(see <a href="https://github.com/angular/protractor/issues/3978" target="_blank">#3978</a>).
</p>
<p>
<strong>Workaround</strong>: Accompany the <code>--cucumberOpts</code> with <code>--disableChecks</code> when using the command line.
</p>
<p>
<strong>FIX</strong>: Upgrade Protractor to 5.1.0 or newer
(see <a href="https://github.com/angular/protractor/issues/3994" target="_blank">#3994</a>).
</p>
</div>
@@ -0,0 +1,11 @@
<div class="known-issue">
:disappointed: **CAUTION**: As of [Protractor 5.1.0](https://github.com/angular/protractor/blob/master/CHANGELOG.md#510),
[Webdriver-manager](https://github.com/angular/webdriver-manager) will always grab the latest versions of all binaries
(Selenium standalone, chromedriver, iedriver, gecko driver), which ensures that they're compatible with newly released
web browsers. However, Selenium standalone 3.0.1 has a bug which prevents it from working with any version of Firefox.
:smirk: **WORKAROUND**: To test with Firefox 51 use Selenium 3.0.0-beta4. You can instruct the `webdriver-manager`
to download this version by adding `--versions.standalone=3.0.0-beta4`
:relieved: **FIX**: The issue _should be_ fixed in Selenium 3.0.2.
</div>
View
@@ -15,30 +15,6 @@
margin: 2em auto 4em auto;
}
//.markdown-section h2 {
// padding-bottom: 0.3em;
// border-bottom: 1px solid #eee;
//}
//.markdown-section a {
// text-decoration: none;
// transition: border .5s;
// color: #3b3c3e;
//}
//
//.markdown-section a:link,
//.markdown-section a:visited {
// text-decoration: none;
// padding-bottom: 1px;
// border-bottom: 1px solid gold;
//}
//.markdown-section a:active,
//.markdown-section a:hover {
// padding-bottom: 1px;
// border-bottom: 1px solid #3b3c3e;
// transition: border .2s;
//}
@import "mixins";
.markdown-section {
@@ -112,21 +88,60 @@
font-size: 1.5em;
border: none;
&:before, &:after {
&:before {
position: absolute;
top: 0;
left: -60px;
width: 60px;
height: 60px;
font-size: 120px;
line-height: 1;
}
&:before {
top: 0;
left: -60px;
color: #e3e3e3;
content: "\201C";
}
}
.known-issue,
.pro-tip {
position: relative;
margin: 2em 0 1.5em 0;
padding: 10px 15px 0 15px;
text-align: left;
&:before {
position: absolute;
top: 10px;
left: -48px;
width: 32px;
height: 32px;
line-height: 1;
background-size: 32px 32px;
content: '';
}
code {
white-space: nowrap;
}
}
.known-issue {
border: 2px solid #e8ba0b;
background-color: #fffce9;
&:before {
background-image: url('/gitbook/gitbook-plugin-advanced-emoji/emojis/warning.png');
}
}
.pro-tip {
border: 2px solid #e8ba0b;
background-color: #fffce9;
&:before {
background-image: url('/gitbook/gitbook-plugin-advanced-emoji/emojis/bulb.png');
}
}
ul.books {
text-align: center;
list-style-type: none;
@@ -21,6 +21,7 @@
"@types/node": "6.0.53",
"chai": "3.5.0",
"chai-as-promised": "5.3.0",
"protractor": "5.1.1",
"rimraf": "2.5.4",
"serenity-js": "file:../../",
"typescript": "2.1.4"
@@ -6,7 +6,7 @@
"scripts": {
"clean": "rimraf target",
"pretest": "serenity update",
"pree2e": "npm run webdriver:update -- --standalone",
"pree2e": "npm run webdriver:update -- --standalone --versions.standalone=2.53.1",
"e2e": "protractor ./protractor.conf.js",
"e2e-single": "protractor ./protractor.conf.js --cucumberOpts.name",
"report": "serenity run",
@@ -23,7 +23,7 @@
"chai-smoothie": "^0.2.0",
"cucumber": "1.2.2",
"npm-failsafe": "^0.1.0",
"protractor": "5.0.0",
"protractor": "5.1.1",
"protractor-cucumber-framework": "0.6.0",
"rimraf": "2.5.4",
"serenity-cli": "^0.1.4",
@@ -7,7 +7,7 @@
"clean": "rimraf target",
"lint": "tslint --config ../../tslint.json --project ./tsconfig.json --format stylish",
"pretest": "serenity update",
"pree2e": "npm run lint && npm run webdriver:update -- --standalone",
"pree2e": "npm run lint && npm run webdriver:update -- --standalone --versions.standalone=2.53.1",
"e2e": "protractor ./protractor.conf.js",
"e2e-single": "protractor ./protractor.conf.js --disableChecks --cucumberOpts.name",
"report": "serenity run",
@@ -27,7 +27,7 @@
"chai-smoothie": "^0.2.0",
"cucumber": "1.3.1",
"npm-failsafe": "^0.1.0",
"protractor": "5.0.0",
"protractor": "5.1.1",
"rimraf": "2.5.4",
"serenity-cli": "^0.1.4",
"serenity-js": "file:../../",
@@ -7,7 +7,7 @@
"clean": "rimraf target",
"lint": "tslint --config ../../tslint.json --project ./tsconfig.json --format stylish",
"pretest": "serenity update",
"pree2e": "npm run lint && npm run webdriver:update -- --standalone",
"pree2e": "npm run lint && npm run webdriver:update -- --standalone --versions.standalone=2.53.1",
"e2e": "protractor ./protractor.conf.js",
"e2e-single": "protractor ./protractor.conf.js --mochaOpts.grep",
"report": "serenity run",
@@ -30,7 +30,7 @@
"chai-smoothie": "^0.2.0",
"mocha": "3.2.0",
"npm-failsafe": "^0.1.0",
"protractor": "5.0.0",
"protractor": "5.1.1",
"rimraf": "2.5.4",
"serenity-cli": "^0.1.4",
"serenity-js": "file:../../",
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit a6d9eab

Please sign in to comment.