m3-academy-template-vtexio/tests/cypress/support/vtex.js

10 lines
307 B
JavaScript
Raw Normal View History

2022-08-11 13:06:07 +00:00
function setVtexIdCookie() {
const cookieOptions = {
domain: `.${new URL(Cypress.config().baseUrl).hostname}`,
};
const token = Cypress.env("authToken");
return cy.setCookie("VtexIdclientAutCookie", token, cookieOptions);
}
Cypress.Commands.add("setVtexIdCookie", setVtexIdCookie);