UNPKG

cypress-cucumber-steps

Version:
60 lines 1.66 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Then_I_see_location = Then_I_see_location; var cypress_cucumber_preprocessor_1 = require("@badeball/cypress-cucumber-preprocessor"); var utils_1 = require("../../utils"); /** * Then I see location: * * ```gherkin * Then I see location * | hash | {string} | * | host | {string} | * | hostname | {string} | * | href | {string} | * | origin | {string} | * | pathname | {string} | * | port | {string} | * | protocol | {string} | * | search | {string} | * ``` * * @example * * Make assertions about every location property: * * ```gherkin * Then I see location * | hash | #hash | * | host | localhost:8081 | * | hostname | localhost | * | href | http://localhost:8081/commands/querying?key=value#hash | * | origin | http://localhost:8081 | * | pathname | /commands/querying | * | port | 8081 | * | protocol | http: | * | search | ?key=value | * ``` * * Check location for query params and pathname: * * ```gherkin * Then I see location * | search | ?key=value | * | pathname | /commands/querying | * ``` * * @see * * - {@link Then_I_see_hash | Then I see hash} * - {@link Then_I_see_search | Then I see search} */ function Then_I_see_location(location) { var loc = (0, utils_1.getOptions)(location); if (typeof (loc === null || loc === void 0 ? void 0 : loc.port) === 'number') { loc.port = String(loc.port); } cy.location().should('include', loc); } (0, cypress_cucumber_preprocessor_1.Then)('I see location', Then_I_see_location); //# sourceMappingURL=location.js.map