cucumber-protractor
Version:
POM CukeTractor - Bootstrap your cucumber tests with cucumber, protractor and a structured way of creating page objects and component objects
9 lines (8 loc) • 338 B
JavaScript
module.exports = function checkVisibility(locatorKey, visibleOrHidden) {
const currentPage = this.getCurrentPage();
return currentPage
.getElementWhenInDOM(locatorKey)
.then(() => (visibleOrHidden === 'hidden' ?
currentPage.getElementWhenInvisible(locatorKey) :
currentPage.getElementWhenVisible(locatorKey)));
};