https://cypress.io logo
Hi there, Im trying to run the getCookie script a...
# best-practices
m
Hi there, Im trying to run the getCookie script and I was wondering if theres a way to validate the value as it always changes after each load. Also is it possible to check if the expiry date is checked from todays date to one month for instance? Thanks. describe('Cookie test', () => { beforeEach (() => { cy.visit('https://mydomain.com/smoketests/script/tracking/') }) it.only('Get cookies Demo', () => { cy.getCookies().should(cookies => { expect(cookies[0]).to.have.property('domain','mydomain.com') expect(cookies[0]).to.have.property('value','123456789') expect(cookies[0]).to.have.property('name','domainname') }); }); });