UNPKG

cypress-cucumber-steps

Version:
114 lines 3.15 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Then_I_see_text = Then_I_see_text; exports.Then_I_do_not_see_text = Then_I_do_not_see_text; exports.Then_I_do_not_see_visible_text = Then_I_do_not_see_visible_text; var cypress_cucumber_preprocessor_1 = require("@badeball/cypress-cucumber-preprocessor"); var utils_1 = require("../utils"); /** * Then I see text: * * ```gherkin * Then I see text {string} * ``` * * Assert text **_exists_** and is **_visible_** in the screen. * * @example * * ```gherkin * Then I see text "Text" * ``` * * With [options](https://docs.cypress.io/api/commands/contains#Arguments): * * ```gherkin * Then I see text "Text" * | matchCase | true | * | log | true | * | timeout | 4000 | * | includeShadowDom | false | * ``` * * @see * * - {@link Then_I_see_button | Then I see button} * - {@link Then_I_see_heading | Then I see heading} * - {@link Then_I_see_label | Then I see label} * - {@link Then_I_see_link | Then I see link} */ function Then_I_see_text(text, options) { cy.contains(text, (0, utils_1.getOptions)(options)).filter(':visible').should('exist'); } (0, cypress_cucumber_preprocessor_1.Then)('I see text {string}', Then_I_see_text); /** * Then I do not see text: * * ```gherkin * Then I do not see text {string} * ``` * * Assert text **_does not exist_** in the screen. * * @example * * ```gherkin * Then I do not see text "Text" * ``` * * With [options](https://docs.cypress.io/api/commands/contains#Arguments): * * ```gherkin * Then I do not see text "Text" * | matchCase | true | * | log | true | * | timeout | 4000 | * | includeShadowDom | false | * ``` * * @see * * - {@link Then_I_do_not_see_visible_text | Then I do not see visible text} * - {@link Then_I_do_not_see_button | Then I do not see button} * - {@link Then_I_do_not_see_heading | Then I do not see heading} * - {@link Then_I_do_not_see_label | Then I do not see label} * - {@link Then_I_do_not_see_link | Then I do not see link} */ function Then_I_do_not_see_text(text, options) { cy.contains(text, (0, utils_1.getOptions)(options)).should('not.exist'); } (0, cypress_cucumber_preprocessor_1.Then)('I do not see text {string}', Then_I_do_not_see_text); /** * Then I do not see visible text: * * ```gherkin * Then I do not see visible text {string} * ``` * * Assert text **_exists_** in the screen but is **_hidden_**. * * @example * * ```gherkin * Then I do not see visible text "Text" * ``` * * With [options](https://docs.cypress.io/api/commands/contains#Arguments): * * ```gherkin * Then I do not see visible text "Text" * | matchCase | true | * | log | true | * | timeout | 4000 | * | includeShadowDom | false | * ``` * * @see * * - {@link Then_I_do_not_see_text | Then I do not see text} */ function Then_I_do_not_see_visible_text(text, options) { cy.contains(text, (0, utils_1.getOptions)(options)).should('not.be.visible'); } (0, cypress_cucumber_preprocessor_1.Then)('I do not see visible text {string}', Then_I_do_not_see_visible_text); //# sourceMappingURL=text.js.map