cucumber-protractor
Version:
POM CukeTractor - Bootstrap your cucumber tests with cucumber, protractor and a structured way of creating page objects and component objects
12 lines (10 loc) • 502 B
JavaScript
module.exports = function checkElementInsideElementInputValue(locatorKey2, locatorKey, isNot, expectedVal) {
const expectedValue = expectedVal === undefined ? '' : expectedVal;
return this.getCurrentPage().getElementWhenInDOM(locatorKey, locatorKey2)
.then((el) => {
const elValuePromise = el.getAttribute('value');
return isNot ?
expect(elValuePromise).to.not.eventually.equal(expectedValue) :
expect(elValuePromise).to.eventually.equal(expectedValue);
});
};