diff --git a/cypress/integration/form_builder.js b/cypress/integration/form_builder.js index 4e191f907a..43cec97a39 100644 --- a/cypress/integration/form_builder.js +++ b/cypress/integration/form_builder.js @@ -243,13 +243,17 @@ context("Form Builder", () => { cy.get(".sidebar-container .frappe-control[data-fieldname='fieldname'] input") .click() .as("input"); - cy.get("@input").clear({ force: true }).type("data3"); + cy.get(".sidebar-container .frappe-control[data-fieldname='fieldname'] input") + .clear({ force: true }) + .type("data3"); cy.click_doc_primary_button("Save"); cy.get_open_dialog().find(".msgprint").should("contain", "appears multiple times"); cy.hide_dialog(); cy.get(first_field).click(); - cy.get("@input").clear({ force: true }); + cy.get(".sidebar-container .frappe-control[data-fieldname='fieldname'] input").clear({ + force: true, + }); // validate reqd + hidden without default cy.get(".sidebar-container .field label .label-area").contains("Mandatory").click(); diff --git a/cypress/integration/login.js b/cypress/integration/login.js index 0e56f9c119..36fd311197 100644 --- a/cypress/integration/login.js +++ b/cypress/integration/login.js @@ -36,7 +36,7 @@ context("Login", () => { cy.get("#login_password").type(Cypress.env("adminPassword")); cy.findByRole("button", { name: "Login" }).click(); - cy.location("pathname").should("eq", "/app"); + cy.location("pathname").should("eq", "/app/users"); cy.window().its("frappe.session.user").should("eq", "Administrator"); }); diff --git a/cypress/integration/sidebar.js b/cypress/integration/sidebar.js index 9e1cee5d9d..c8aa2a441b 100644 --- a/cypress/integration/sidebar.js +++ b/cypress/integration/sidebar.js @@ -36,9 +36,9 @@ const attach_file = (file, no_of_files = 1) => { context("Sidebar", () => { before(() => { - cy.visit("/login"); + cy.visit("/"); cy.login(); - + cy.visit("/app"); return cy .window() .its("frappe") diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 488f0e450c..26255b33bb 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -34,7 +34,7 @@ Cypress.Commands.add("login", (email, password) => { if (!password) { password = Cypress.env("adminPassword"); } - cy.session( + return cy.session( [email, password] || "", () => { return cy.request({ @@ -53,9 +53,6 @@ Cypress.Commands.add("login", (email, password) => { }); Cypress.Commands.add("call", (method, args) => { - if (method === "logout") { - cy.visit("/"); - } return cy .window() .its("frappe.csrf_token") @@ -173,6 +170,7 @@ Cypress.Commands.add("fill_field", (fieldname, value, fieldtype = "Data") => { } if (fieldtype === "Select") { + cy.log("Selecting value", value); cy.get("@input").select(value); } else { cy.get("@input").type(value, {