Skip to content

Option to not flush cookies between tests #959

@igorpavlov-zz

Description

@igorpavlov-zz
  • Operating System: OSX 10.12.6 (16G1036)
  • Cypress Version: 1.1.1
  • Browser Version: 62.0.3202.94

Is this a Feature or Bug?

Unexpected bahaviour.

Current behavior:

Cookies are automatically flushed between tests (as per the documentation).

image

Desired behavior:

Have an option to not flush cookies between tests for more control.

How to reproduce:

  1. Write a first test that sets a cookie to the domain;
  2. Write a second test that should utilise this cookie;
  3. The cookie from the first test is flushed and is not available in the second test.

Test code:

describe('Set cookie', function() {
  it('Sets cookie', function() {
    cy.setCookie('test', '1');
  });
});

describe('Get cookie', function() {
  it('Gets cookie', function() {
    cy.getCookie('test').should('have.property', 'value', '1')
  });
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions