Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypress.Cookies.debug(true) and setCookie doesn't work #1714

Closed
scrat98 opened this issue May 13, 2018 · 2 comments
Closed

Cypress.Cookies.debug(true) and setCookie doesn't work #1714

scrat98 opened this issue May 13, 2018 · 2 comments

Comments

@scrat98
Copy link

scrat98 commented May 13, 2018

Current behavior:

When I enable cookies debug in support/index.js or in any test it doesn't log out into my console. And when setCookie - nothing happen

Cypress.Cookies.debug(true)
describe('Test', () => {
    Cypress.Cookies.debug(true);
    beforeEach(() => {
        cy.visit('http://localhost:8080');
        cy.clearCookies();
        cy.getCookies().should('be.empty');
        const value = 'test_value';
        const options = {
            path: '/',
        };
        cy.setCookie('token', value, options);
        cy.getCookie('token').should('have.property', 'name', 'token');

        cy.setCookie('refresh_token', value, options);
        cy.getCookie('refresh_token').should('have.property', 'name', 'refresh_token');

        cy.setCookie('expires', value, options);
        cy.getCookie('expires').should('have.property', 'name', 'expires');
        cy.clearCookies();
    });

    it('Test', () => {
        cy.log('Nothing log out');
    });
});

image

Versions

Cypress: 2.1.0
OS: Windows 10
Browser: Chrome 66/Electron

@scrat98 scrat98 changed the title Cypress.Cookies.debug(true) doesn't work Cypress.Cookies.debug(true) and setCookie doesn't work May 14, 2018
@scrat98
Copy link
Author

scrat98 commented May 14, 2018

Here https://github.com/cypress-io/cypress/blob/2b2b6d99a9f1bf232d9c7396b25390913d5f2b18/packages/driver/src/cy/commands/cookies.coffee you use _.default - "This method mutates object.". So options was be mutate

@jennifer-shehane jennifer-shehane added the stage: needs investigating Someone from Cypress needs to look at this label May 15, 2018
@jennifer-shehane
Copy link
Member

Closing this as a duplicate of #2701

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants