cypress-cucumber-steps
Version:
Cypress Cucumber step definitions
39 lines • 1.11 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.When_I_find_element_by_text = When_I_find_element_by_text;
var cypress_cucumber_preprocessor_1 = require("@badeball/cypress-cucumber-preprocessor");
var utils_1 = require("../utils");
/**
* When I find element by text:
*
* ```gherkin
* When I find element by text {string}
* ```
*
* @example
*
* ```gherkin
* When I find element by text "Text"
* ```
*
* @remarks
*
* This precedes steps like {@link When_I_click | "When I click"}. For example:
*
* ```gherkin
* When I find element by text "Text"
* And I click
* ```
*
* Inspired by Testing Library's [ByText](https://testing-library.com/docs/queries/bytext).
*
* @see
*
* - {@link When_I_find_button_by_text | When I find button by text}
* - {@link When_I_find_link_by_text | When I find link by text}
*/
function When_I_find_element_by_text(text) {
(0, utils_1.setCypressElement)(cy.contains(text));
}
(0, cypress_cucumber_preprocessor_1.When)('I find element by text {string}', When_I_find_element_by_text);
//# sourceMappingURL=text.js.map