cypress-cucumber-steps
Version:
Cypress Cucumber step definitions
113 lines • 3.52 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Then_I_see_local_storage_item = Then_I_see_local_storage_item;
exports.Then_I_see_local_storage_item_equals = Then_I_see_local_storage_item_equals;
exports.Then_I_see_local_storage_item_contains = Then_I_see_local_storage_item_contains;
exports.Then_I_do_not_see_local_storage_item = Then_I_do_not_see_local_storage_item;
var cypress_cucumber_preprocessor_1 = require("@badeball/cypress-cucumber-preprocessor");
/**
* Then I see local storage item:
*
* ```gherkin
* Then I see local storage item {string}
* ```
*
* Assert local storage item **_exists_**.
*
* @example
*
* ```gherkin
* Then I see local storage item "key"
* ```
*
* @see
*
* - {@link Then_I_see_local_storage_item_equals | Then I see local storage item equals}
* - {@link Then_I_do_not_see_local_storage_item | Then I do not see local storage item}
*/
function Then_I_see_local_storage_item(key) {
cy.wrap({}).should(function () {
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
expect(localStorage.getItem(key)).to.exist;
});
}
(0, cypress_cucumber_preprocessor_1.Then)('I see local storage item {string}', Then_I_see_local_storage_item);
/**
* Then I see local storage item equals:
*
* ```gherkin
* Then I see local storage item {string} equals {string}
* ```
*
* Assert local storage item has exact value.
*
* @example
*
* ```gherkin
* Then I see local storage item "key" equals "value"
* ```
*
* @see
*
* - {@link Then_I_see_local_storage_item_contains | Then I see local storage item contains}
* - {@link Then_I_see_local_storage_item | Then I see local storage item}
*/
function Then_I_see_local_storage_item_equals(key, value) {
cy.wrap({}).should(function () {
expect(localStorage.getItem(key)).to.equal(value);
});
}
(0, cypress_cucumber_preprocessor_1.Then)('I see local storage item {string} equals {string}', Then_I_see_local_storage_item_equals);
/**
* Then I see local storage item contains:
*
* ```gherkin
* Then I see local storage item {string} contains {string}
* ```
*
* Assert local storage item has partial value.
*
* @example
*
* ```gherkin
* Then I see local storage item "key" contains "value"
* ```
*
* @see
*
* - {@link Then_I_see_local_storage_item_equals | Then I see local storage item equals}
* - {@link Then_I_see_local_storage_item | Then I see local storage item}
*/
function Then_I_see_local_storage_item_contains(key, value) {
cy.wrap({}).should(function () {
expect(localStorage.getItem(key)).to.contain(value);
});
}
(0, cypress_cucumber_preprocessor_1.Then)('I see local storage item {string} contains {string}', Then_I_see_local_storage_item_contains);
/**
* Then I do not see local storage item:
*
* ```gherkin
* Then I do not see local storage item {string}
* ```
*
* Assert local storage item **_does not exist_**.
*
* @example
*
* ```gherkin
* Then I do not see local storage item "key"
* ```
*
* @see
*
* - {@link Then_I_see_local_storage_item | Then I see local storage item}
*/
function Then_I_do_not_see_local_storage_item(key) {
cy.wrap({}).should(function () {
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
expect(localStorage.getItem(key)).to.not.exist;
});
}
(0, cypress_cucumber_preprocessor_1.Then)('I do not see local storage item {string}', Then_I_do_not_see_local_storage_item);
//# sourceMappingURL=local-storage.js.map