cypress-cucumber-steps
Version:
Cypress Cucumber step definitions
50 lines • 1.32 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.When_I_select_file = When_I_select_file;
var cypress_cucumber_preprocessor_1 = require("@badeball/cypress-cucumber-preprocessor");
var utils_1 = require("../utils");
/**
* When I select file:
*
* ```gherkin
* When I select file {string}
* ```
*
* Selects a file in an HTML5 input element.
*
* @example
*
* Select file:
*
* ```gherkin
* When I select file "cypress/fixtures/example.json"
* ```
*
* Drag and drop file:
*
* ```gherkin
* When I select file "cypress/fixtures/example.json"
* | action | drag-drop |
* ```
*
* Force the action when input is not visible:
*
* ```gherkin
* When I select file "cypress/fixtures/example.json"
* | force | true |
* ```
*
* @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 "input[type=file]"
* And I select file "cypress/fixtures/example.json"
* ```
*/
function When_I_select_file(file, options) {
(0, utils_1.getCypressElement)().selectFile(file, (0, utils_1.getOptions)(options));
}
(0, cypress_cucumber_preprocessor_1.When)('I select file {string}', When_I_select_file);
//# sourceMappingURL=select-file.js.map