cypress-cucumber-steps
Version:
Cypress Cucumber step definitions
107 lines • 3.36 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Then_I_see_element_has_attribute = Then_I_see_element_has_attribute;
exports.Then_I_see_element_attribute_equals = Then_I_see_element_attribute_equals;
exports.Then_I_see_element_attribute_contains = Then_I_see_element_attribute_contains;
var cypress_cucumber_preprocessor_1 = require("@badeball/cypress-cucumber-preprocessor");
var utils_1 = require("../utils");
/**
* Then I see element has attribute:
*
* ```gherkin
* Then I see element has attribute {string}
* ```
*
* @example
*
* ```gherkin
* Then I see element has attribute "name"
* ```
*
* @remarks
*
* A preceding step like {@link When_I_find_element_by_text | "When I find element by text"} is required. For example:
*
* ```gherkin
* When I find link by text "Link"
* Then I see element has attribute "href"
* ```
*
* @see
*
* - {@link Then_I_see_element_attribute_equals | Then I see element attribute equals}
* - {@link Then_I_see_element_attribute_contains | Then I see element attribute contains}
*/
function Then_I_see_element_has_attribute(name) {
(0, utils_1.getCypressElement)().should(function ($element) {
expect($element).to.have.attr(name);
});
}
(0, cypress_cucumber_preprocessor_1.Then)('I see element has attribute {string}', Then_I_see_element_has_attribute);
/**
* Then I see element attribute equals:
*
* ```gherkin
* Then I see element attribute {string} equals {string}
* ```
*
* @example
*
* ```gherkin
* Then I see element attribute "name" equals "value"
* ```
*
* @remarks
*
* A preceding step like {@link When_I_find_element_by_text | "When I find element by text"} is required. For example:
*
* ```gherkin
* When I find link by text "Link"
* Then I see element attribute "href" equals "/"
* ```
*
* @see
*
* - {@link Then_I_see_element_has_attribute | Then I see element has attribute}
* - {@link Then_I_see_element_attribute_contains | Then I see element attribute contains}
*/
function Then_I_see_element_attribute_equals(name, value) {
(0, utils_1.getCypressElement)().should(function ($element) {
expect($element).to.have.attr(name, value);
});
}
(0, cypress_cucumber_preprocessor_1.Then)('I see element attribute {string} equals {string}', Then_I_see_element_attribute_equals);
/**
* Then I see element attribute contains:
*
* ```gherkin
* Then I see element attribute {string} contains {string}
* ```
*
* @example
*
* ```gherkin
* Then I see element attribute "name" contains "value"
* ```
*
* @remarks
*
* A preceding step like {@link When_I_find_element_by_text | "When I find element by text"} is required. For example:
*
* ```gherkin
* When I find link by text "Link"
* Then I see element attribute "href" contains "/"
* ```
*
* @see
*
* - {@link Then_I_see_element_has_attribute | Then I see element has attribute}
* - {@link Then_I_see_element_attribute_equals | Then I see element attribute equals}
*/
function Then_I_see_element_attribute_contains(name, value) {
(0, utils_1.getCypressElement)().should(function ($element) {
expect($element.attr(name)).to.contain(value);
});
}
(0, cypress_cucumber_preprocessor_1.Then)('I see element attribute {string} contains {string}', Then_I_see_element_attribute_contains);
//# sourceMappingURL=attribute.js.map