cypress-cucumber-steps
Version:
Cypress Cucumber step definitions
63 lines • 1.48 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.When_I_select = When_I_select;
exports.When_I_select_option = When_I_select_option;
var cypress_cucumber_preprocessor_1 = require("@badeball/cypress-cucumber-preprocessor");
var utils_1 = require("../utils");
/**
* When I select:
*
* ```gherkin
* When I select {string}
* ```
*
* @example
*
* ```gherkin
* When I select "Option"
* ```
*
* @remarks
*
* A preceding step like {@link When_I_get_element_by_selector | "When I get element by selector"} is required. For example:
*
* ```gherkin
* When I get element by selector "select"
* And I select "Option"
* ```
*
* @see
*
* - {@link When_I_select_option | When I select option}
*/
function When_I_select(displayValue) {
(0, utils_1.getCypressElement)().select(displayValue);
}
(0, cypress_cucumber_preprocessor_1.When)('I select {string}', When_I_select);
/**
* When I select option:
*
* ```gherkin
* When I select option {string}
* ```
*
* Select the first option by display value.
*
* @example
*
* ```gherkin
* When I select option "Option"
* ```
*
* @see
*
* - {@link When_I_select | When I select}
*/
function When_I_select_option(displayValue) {
cy.get('option')
.contains(displayValue)
.closest('select')
.select(displayValue);
}
(0, cypress_cucumber_preprocessor_1.When)('I select option {string}', When_I_select_option);
//# sourceMappingURL=select.js.map