cypress-cucumber-steps
Version:
Cypress Cucumber step definitions
21 lines • 802 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getHeadingElements = getHeadingElements;
var options_1 = require("./options");
/**
* Get heading elements.
*
* @param text - Heading text.
* @param selector - Pseudo selector.
* @returns - Cypress element.
* @private
*/
function getHeadingElements(text, selector, options) {
var selectors = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];
selectors = selectors.map(function (heading) { return "".concat(heading, ":contains(").concat(JSON.stringify(text), ")"); });
if (selector) {
selectors = selectors.map(function (heading) { return "".concat(heading, ":").concat(selector); });
}
return cy.get(selectors.join(','), (0, options_1.getOptions)(options));
}
//# sourceMappingURL=heading.js.map