UNPKG

cypress-cucumber-steps

Version:
48 lines 1.15 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.When_I_visit_URL = When_I_visit_URL; var cypress_cucumber_preprocessor_1 = require("@badeball/cypress-cucumber-preprocessor"); var utils_1 = require("../utils"); /** * When I visit URL: * * ```gherkin * When I visit {string} * ``` * * @example * * With absolute URL: * * ```gherkin * When I visit "https://example.com/" * ``` * * With relative URL: * * ```gherkin * When I visit "/" * ``` * * Cypress [`baseUrl`](https://docs.cypress.io/guides/references/configuration#e2e) must be defined for relative URL to work. * * @remarks * * If the page does not respond with a `2xx` status code, then this step will fail: * * ```gherkin * When I visit "/404" # fail * ``` * * If you don't want status codes to cause failures, then pass the option: * * ```gherkin * When I visit "/404" * | failOnStatusCode | false | * ``` */ function When_I_visit_URL(url, options) { cy.visit(url, (0, utils_1.getOptions)(options)); } (0, cypress_cucumber_preprocessor_1.When)('I visit {string}', When_I_visit_URL); //# sourceMappingURL=visit.js.map