cypress-cucumber-steps
Version:
Cypress Cucumber step definitions
52 lines • 1.59 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.When_I_find_input_by_label_text = When_I_find_input_by_label_text;
var cypress_cucumber_preprocessor_1 = require("@badeball/cypress-cucumber-preprocessor");
var constants_1 = require("../constants");
var utils_1 = require("../utils");
/**
* When I find input by label text:
*
* ```gherkin
* When I find input by label text {string}
* ```
*
* Finds the first input element that matches the label text.
*
* @example
*
* ```gherkin
* When I find input by label text "Email"
* ```
*
* With [options](https://docs.cypress.io/api/commands/get#Arguments):
*
* ```gherkin
* When I find input by label text "Email"
* | log | true |
* | timeout | 4000 |
* | withinSubject | null |
* | includeShadowDom | false |
* | pseudoSelector | visible |
* ```
*
* @remarks
*
* This precedes steps like {@link Then_I_see_value | "Then I see value"}. For example:
*
* ```gherkin
* When I find input by label text "Email"
* Then I see value "user@example.com"
* ```
*
* Inspired by Testing Library's [ByLabelText](https://testing-library.com/docs/queries/bylabeltext).
*
* @see
*
* - {@link When_I_find_element_by_label_text | When I find element by label text }
*/
function When_I_find_input_by_label_text(text, options) {
(0, utils_1.setCypressElement)((0, utils_1.getByLabelText)(constants_1.Element.input, text, options));
}
(0, cypress_cucumber_preprocessor_1.When)('I find input by label text {string}', When_I_find_input_by_label_text);
//# sourceMappingURL=input.js.map