mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-25 10:03:45 +03:00
Upgrade to protractor 5
This commit is contained in:
parent
ce9d9b5ff0
commit
117d5bf9ec
|
@ -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",
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
@ -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');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user