Skip to content

Commit

Permalink
Upgrade to protractor 5
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanHotsiy committed Jan 28, 2017
1 parent ce9d9b5 commit 117d5bf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"ngc-webpack": "^1.1.0",
"node-sass": "^4.1.1",
"phantomjs-prebuilt": "^2.1.7",
"protractor": "^4.0.10",
"protractor": "^5.0.0",
"raw-loader": "^0.5.1",
"rimraf": "^2.5.4",
"rxjs": "^5.0.1",
Expand Down
7 changes: 6 additions & 1 deletion tests/e2e/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,15 @@ function eachNth(obj, n) {
return res;
}

function getInnerHtml(locator) {
return browser.executeScript("return arguments[0].innerHTML;", $(locator));
}

module.exports = {
loadJson: loadJson,
verifyNoBrowserErrors: verifyNoBrowserErrors,
scrollToEl: scrollToEl,
fixFFTest: fixFFTest,
eachNth: eachNth
eachNth: eachNth,
getInnerHtml: getInnerHtml
}
13 changes: 7 additions & 6 deletions tests/e2e/redoc.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const verifyNoBrowserErrors = require('./helpers').verifyNoBrowserErrors;
const scrollToEl = require('./helpers').scrollToEl;
const fixFFTest = require('./helpers').fixFFTest;
const eachNth = require('./helpers').eachNth;
const getInnerHtml = require('./helpers').getInnerHtml;

const URL = 'index.html';

Expand Down Expand Up @@ -56,17 +57,17 @@ describe('Scroll sync', () => {

it('should update active menu entries on page scroll forwards', () => {
scrollToEl('[section="tag/store"]').then(() => {
expect($('.menu-item.menu-item-depth-1.active > .menu-item-header').getInnerHtml()).toContain('store');
expect($('.selected-tag').getInnerHtml()).toContain('store');
expect(getInnerHtml('.menu-item.menu-item-depth-1.active > .menu-item-header')).toContain('store');
expect(getInnerHtml('.selected-tag')).toContain('store');
});
});

it('should update active menu entries on page scroll backwards', () => {
scrollToEl('[operation-id="getPetById"]').then(() => {
expect($('.menu-item.menu-item-depth-1.active .menu-item-header').getInnerHtml()).toContain('pet');
expect($('.selected-tag').getInnerHtml()).toContain('pet');
expect($('.menu-item.menu-item-depth-2.active .menu-item-header').getInnerHtml()).toContain('Find pet by ID');
expect($('.selected-endpoint').getInnerHtml()).toContain('Find pet by ID');
expect(getInnerHtml('.menu-item.menu-item-depth-1.active .menu-item-header')).toContain('pet');
expect(getInnerHtml('.selected-tag')).toContain('pet');
expect(getInnerHtml('.menu-item.menu-item-depth-2.active .menu-item-header')).toContain('Find pet by ID');
expect(getInnerHtml('.selected-endpoint')).toContain('Find pet by ID');
});
});
});
Expand Down

0 comments on commit 117d5bf

Please sign in to comment.