You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
520 B

/// <reference types="cypress" />
/**
* @method abKeepLoggedIn
* @memberof module:cy
* @param {object} [options]
* @param {object} [options.cookie] session cookie name: default to Cypress.env('AB_COOKIE_NAME')
* @example
* before(() => {
* cy.abLogin()
* })
*
* beforeAll(() => {
* cy.abKeepLoggedIn({ cookie: 'my-session-cookie' })
* cy.visit('your/path')
* })
*/
Cypress.Commands.add('abKeepLoggedIn', ({ cookie }) => {
Cypress.Cookies.preserveOnce(cookie || Cypress.env('AB_COOKIE_NAME'))
})