UNPKG

cypress-cucumber-steps

Version:
163 lines 4.45 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Then_I_see_URL = Then_I_see_URL; exports.Then_I_see_URL_contains = Then_I_see_URL_contains; exports.Then_I_do_not_see_URL = Then_I_do_not_see_URL; exports.Then_I_do_not_see_URL_contains = Then_I_do_not_see_URL_contains; var cypress_cucumber_preprocessor_1 = require("@badeball/cypress-cucumber-preprocessor"); var utils_1 = require("../utils"); /** * Then I see URL: * * ```gherkin * Then I see URL {string} * ``` * * @example * * With [`baseUrl`](https://docs.cypress.io/guides/references/best-practices#Setting-a-Global-baseUrl) set: * * ```gherkin * Then I see URL "/index.html" * ``` * * Without [`baseUrl`](https://docs.cypress.io/guides/references/best-practices#Setting-a-Global-baseUrl) set: * * ```gherkin * Then I see URL "http://localhost:8080/index.html" * ``` * * With [options](https://docs.cypress.io/api/commands/url#Arguments): * * ```gherkin * Then I see URL "/" * | decode | false | * | log | true | * | timeout | 4000 | * ``` * * @see * * - {@link Then_I_see_URL_contains | Then I see URL contains} */ function Then_I_see_URL(url, options) { url = (Cypress.config().baseUrl || '') + url; cy.url((0, utils_1.getOptions)(options)).should('equal', url); } (0, cypress_cucumber_preprocessor_1.Then)('I see URL {string}', Then_I_see_URL); /** * Then I see URL contains: * * ```gherkin * Then I see URL contains {string} * ``` * * @example * * With [`baseUrl`](https://docs.cypress.io/guides/references/best-practices#Setting-a-Global-baseUrl) set: * * ```gherkin * Then I see URL contains "/index.html" * ``` * * Without [`baseUrl`](https://docs.cypress.io/guides/references/best-practices#Setting-a-Global-baseUrl) set: * * ```gherkin * Then I see URL contains "http://localhost:8080/index.html" * ``` * * With [options](https://docs.cypress.io/api/commands/url#Arguments): * * ```gherkin * Then I see URL contains "/" * | decode | false | * | log | true | * | timeout | 4000 | * ``` * * @see * * - {@link Then_I_see_URL | Then I see URL} */ function Then_I_see_URL_contains(url, options) { cy.url((0, utils_1.getOptions)(options)).should('contain', url); } (0, cypress_cucumber_preprocessor_1.Then)('I see URL contains {string}', Then_I_see_URL_contains); /** * Then I do not see URL: * * ```gherkin * Then I do not see URL {string} * ``` * * @example * * With [`baseUrl`](https://docs.cypress.io/guides/references/best-practices#Setting-a-Global-baseUrl) set: * * ```gherkin * Then I do not see URL "/index.html" * ``` * * Without [`baseUrl`](https://docs.cypress.io/guides/references/best-practices#Setting-a-Global-baseUrl) set: * * ```gherkin * Then I do not see URL "http://localhost:8080/index.html" * ``` * * With [options](https://docs.cypress.io/api/commands/url#Arguments): * * ```gherkin * Then I do not see URL "/" * | decode | false | * | log | true | * | timeout | 4000 | * ``` * * @see * * - {@link Then_I_do_not_see_URL_contains | Then I do not see URL contains} */ function Then_I_do_not_see_URL(url, options) { url = (Cypress.config().baseUrl || '') + url; cy.url((0, utils_1.getOptions)(options)).should('not.equal', url); } (0, cypress_cucumber_preprocessor_1.Then)('I do not see URL {string}', Then_I_do_not_see_URL); /** * Then I do not see URL contains: * * ```gherkin * Then I do not see URL contains {string} * ``` * * @example * * With [`baseUrl`](https://docs.cypress.io/guides/references/best-practices#Setting-a-Global-baseUrl) set: * * ```gherkin * Then I do not see URL contains "/index.html" * ``` * * Without [`baseUrl`](https://docs.cypress.io/guides/references/best-practices#Setting-a-Global-baseUrl) set: * * ```gherkin * Then I do not see URL contains "http://localhost:8080/index.html" * ``` * * With [options](https://docs.cypress.io/api/commands/url#Arguments): * * ```gherkin * Then I do not see URL contains "/" * | decode | false | * | log | true | * | timeout | 4000 | * ``` * * @see * * - {@link Then_I_do_not_see_URL | Then I do not see URL} */ function Then_I_do_not_see_URL_contains(url, options) { cy.url((0, utils_1.getOptions)(options)).should('not.contain', url); } (0, cypress_cucumber_preprocessor_1.Then)('I do not see URL contains {string}', Then_I_do_not_see_URL_contains); //# sourceMappingURL=url.js.map