@nice-digital/wdio-cucumber-steps
Version:
Shared step definitions for Cucumber JS BDD tests in WebdriverIO
23 lines • 924 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.checkOffset = void 0;
/**
* Check the offset of the given element
* @param {String} selector Element selector
* @param {String} falseCase Whether to check if the offset matches or not
* @param {String} expectedPosition The position to check against
* @param {String} axis The axis to check on (x or y)
*/
async function checkOffset(selector, falseCase, expectedPosition, axis) {
const element = await $(selector);
const location = await element.getLocation(axis);
const intExpectedPosition = parseFloat(expectedPosition);
if (falseCase) {
expect(location).not.toEqual(intExpectedPosition);
}
else {
expect(location).toEqual(intExpectedPosition);
}
}
exports.checkOffset = checkOffset;
//# sourceMappingURL=checkOffset.js.map