cypress-cucumber-steps
Version:
Cypress Cucumber step definitions
78 lines • 2.12 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Then_I_see_role = Then_I_see_role;
exports.Then_I_do_not_see_role = Then_I_do_not_see_role;
var cypress_cucumber_preprocessor_1 = require("@badeball/cypress-cucumber-preprocessor");
var constants_1 = require("../constants");
var utils_1 = require("../utils");
/**
* Then I see role:
*
* ```gherkin
* Then I see role {string}
* ```
*
* Assert role **_exists_** and is **_visible_** in the screen.
*
* @example
*
* ```gherkin
* Then I see role "progressbar"
* ```
*
* With [options](https://docs.cypress.io/api/commands/get#Arguments):
*
* ```gherkin
* Then I see role "progressbar"
* | log | true |
* | timeout | 4000 |
* | withinSubject | null |
* | includeShadowDom | false |
* ```
*
* Inspired by Testing Library's [ByRole](https://testing-library.com/docs/queries/byrole/).
*
* @see
*
* - {@link Then_I_do_not_see_role | Then I do not see role}
*/
function Then_I_see_role(role, options) {
(0, utils_1.getRoleElements)(role, constants_1.PseudoSelector.visible, options).should('exist');
}
(0, cypress_cucumber_preprocessor_1.Then)('I see role {string}', Then_I_see_role);
/**
* Then I do not see role:
*
* ```gherkin
* Then I do not see role {string}
* ```
*
* Assert role **_does not exist_** in the screen.
*
* @example
*
* ```gherkin
* Then I do not see role "progressbar"
* ```
*
* With [options](https://docs.cypress.io/api/commands/get#Arguments):
*
* ```gherkin
* Then I do not see role "progressbar"
* | log | true |
* | timeout | 4000 |
* | withinSubject | null |
* | includeShadowDom | false |
* ```
*
* Inspired by Testing Library's [ByRole](https://testing-library.com/docs/queries/byrole/).
*
* @see
*
* - {@link Then_I_see_role | Then I see role}
*/
function Then_I_do_not_see_role(role, options) {
(0, utils_1.getRoleElements)(role, constants_1.PseudoSelector.visible, options).should('not.exist');
}
(0, cypress_cucumber_preprocessor_1.Then)('I do not see role {string}', Then_I_do_not_see_role);
//# sourceMappingURL=role.js.map