cucumber-protractor
Version:
POM CukeTractor - Bootstrap your cucumber tests with cucumber, protractor and a structured way of creating page objects and component objects
11 lines (9 loc) • 385 B
JavaScript
module.exports = function checkClass(locatorKey, doesNotContain, className) {
const classNameToBeChecked = this.getCurrentPage().getElement(locatorKey)
.getAttribute('class');
return classNameToBeChecked
.then((actualClasses) =>
(doesNotContain ?
expect(actualClasses).to.not.include(className) :
expect(actualClasses).to.be.include(className)));
};