cypress-cucumber-steps
Version:
Cypress Cucumber step definitions
93 lines • 2.28 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.When_I_check = When_I_check;
exports.When_I_check_input = When_I_check_input;
var cypress_cucumber_preprocessor_1 = require("@badeball/cypress-cucumber-preprocessor");
var queries_1 = require("../queries");
var utils_1 = require("../utils");
/**
* When I check:
*
* ```gherkin
* When I check
* ```
*
* This element must be an `<input>` with type `checkbox` or `radio`.
*
* @example
*
* Check checkbox(es) or radio(s):
*
* ```gherkin
* When I check
* ```
*
* With [options](https://docs.cypress.io/api/commands/check#Arguments):
*
* ```gherkin
* When I check
* | animationDistanceThreshold | 5 |
* | log | true |
* | force | false |
* | scrollBehavior | top |
* | timeout | 4000 |
* | waitForAnimations | true |
* ```
*
* @remarks
*
* A preceding step like {@link When_I_find_input_by_label_text | "When I find input by label text"} is required. For example:
*
* ```gherkin
* When I find input by label text "Checkbox"
* And I check
* ```
*
* @see
*
* - {@link When_I_check_input | When I check input}
* - {@link When_I_uncheck | When I uncheck}
*/
function When_I_check(options) {
(0, utils_1.getCypressElement)().check((0, utils_1.getOptions)(options));
}
(0, cypress_cucumber_preprocessor_1.When)('I check', When_I_check);
/**
* When I check input:
*
* ```gherkin
* When I check input {string}
* ```
*
* Check checkbox or radio input by label text.
*
* @example
*
* ```gherkin
* When I check input "Text"
* ```
*
* With [options](https://docs.cypress.io/api/commands/check#Arguments):
*
* ```gherkin
* When I check input "Text"
* | animationDistanceThreshold | 5 |
* | log | true |
* | force | false |
* | scrollBehavior | top |
* | timeout | 4000 |
* | waitForAnimations | true |
* | pseudoSelector | visible |
* ```
*
* @see
*
* - {@link When_I_check | When I check}
* - {@link When_I_uncheck_input | When I uncheck input}
*/
function When_I_check_input(text, options) {
(0, queries_1.When_I_find_input_by_label_text)(text, options);
When_I_check(options);
}
(0, cypress_cucumber_preprocessor_1.When)('I check input {string}', When_I_check_input);
//# sourceMappingURL=check.js.map