chore: Fix cypress configuration to support cy13

This commit is contained in:
Suraj Shetty 2023-09-22 12:02:19 +05:30
parent a496f6b5e1
commit 66f8c0b37f
3 changed files with 17 additions and 12 deletions

View file

@ -20,6 +20,7 @@ module.exports = defineConfig({
setupNodeEvents(on, config) { setupNodeEvents(on, config) {
return require("./cypress/plugins/index.js")(on, config); return require("./cypress/plugins/index.js")(on, config);
}, },
testIsolation: false,
baseUrl: "http://test_site_ui:8000", baseUrl: "http://test_site_ui:8000",
specPattern: ["./cypress/integration/*.js", "**/ui_test_*.js"], specPattern: ["./cypress/integration/*.js", "**/ui_test_*.js"],
}, },

View file

@ -32,8 +32,11 @@ Cypress.Commands.add("login", (email, password) => {
email = Cypress.config("testUser") || "Administrator"; email = Cypress.config("testUser") || "Administrator";
} }
if (!password) { if (!password) {
password = Cypress.env("adminPassword"); password = Cypress.env("adminPassword") || "admin";
} }
cy.session(
[email, password] || "",
() => {
return cy.request({ return cy.request({
url: "/api/method/login", url: "/api/method/login",
method: "POST", method: "POST",
@ -42,6 +45,11 @@ Cypress.Commands.add("login", (email, password) => {
pwd: password, pwd: password,
}, },
}); });
},
{
cacheAcrossSpecs: true,
}
);
}); });
Cypress.Commands.add("call", (method, args) => { Cypress.Commands.add("call", (method, args) => {

View file

@ -23,7 +23,3 @@ Cypress.on("uncaught:exception", (err, runnable) => {
// Alternatively you can use CommonJS syntax: // Alternatively you can use CommonJS syntax:
// require('./commands') // require('./commands')
Cypress.Cookies.defaults({
preserve: "sid",
});