cypress-cucumber-steps
Version:
Cypress Cucumber step definitions
79 lines • 2.48 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.When_I_clear_cookies = When_I_clear_cookies;
exports.When_I_clear_all_cookies = When_I_clear_all_cookies;
var cypress_cucumber_preprocessor_1 = require("@badeball/cypress-cucumber-preprocessor");
var utils_1 = require("../utils");
/**
* When I clear cookies:
*
* ```gherkin
* When I clear cookies
* ```
*
* Clear browser cookies for a domain.
*
* @example
*
* ```gherkin
* When I clear cookies
* ```
*
* With [options](https://docs.cypress.io/api/commands/clearcookies#Arguments):
*
* ```gherkin
* When I clear cookies
* | domain | example.com |
* | log | true |
* | timeout | 3000 |
* ```
*
* @remarks
*
* Cypress automatically clears all cookies _before_ each test to prevent state from being shared across tests when [test isolation](https://docs.cypress.io/guides/core-concepts/writing-and-organizing-tests#Test-Isolation) is enabled. You shouldn't need to use this command unless you're using it to clear a specific cookie inside a single test or test isolation is disabled.
*
* @see
*
* - {@link When_I_clear_cookie | When I clear cookie}
* - {@link When_I_clear_all_cookies | When I clear all cookies}
*/
function When_I_clear_cookies(options) {
cy.clearCookies((0, utils_1.getOptions)(options));
}
(0, cypress_cucumber_preprocessor_1.When)('I clear cookies', When_I_clear_cookies);
/**
* When I clear all cookies:
*
* ```gherkin
* When I clear all cookies
* ```
*
* Clear all browser cookies.
*
* @example
*
* ```gherkin
* When I clear all cookies
* ```
*
* With [options](https://docs.cypress.io/api/commands/clearallcookies#Arguments):
*
* ```gherkin
* When I clear all cookies
* | log | true |
* | timeout | 3000 |
* ```
*
* @remarks
*
* Cypress automatically clears all cookies _before_ each test to prevent state from being shared across tests when [test isolation](https://docs.cypress.io/guides/core-concepts/writing-and-organizing-tests#Test-Isolation) is enabled. You shouldn't need to use this command unless you're using it to clear a specific cookie inside a single test or test isolation is disabled.
*
* @see
*
* - {@link When_I_clear_cookies | When I clear cookies}
*/
function When_I_clear_all_cookies(options) {
cy.clearAllCookies((0, utils_1.getOptions)(options));
}
(0, cypress_cucumber_preprocessor_1.When)('I clear all cookies', When_I_clear_all_cookies);
//# sourceMappingURL=cookies.js.map