Skip to content

Commit

Permalink
fix: Try waiting for logout
Browse files Browse the repository at this point in the history
  • Loading branch information
surajshetty3416 committed Jun 16, 2023
1 parent 8008afa commit 821f75c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cypress/integration/kanban.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ context("Kanban Board", () => {
it("Checks if Kanban Board edits are blocked for non-System Manager and non-owner of the Board", () => {
cy.switch_to_user("Administrator");

const noSystemManager = "nosysmanager@example.com";
const not_system_manager = "nosysmanager@example.com";
cy.call("frappe.tests.ui_test_helpers.create_test_user", {
username: noSystemManager,
username: not_system_manager,
});
cy.remove_role(noSystemManager, "System Manager");
cy.remove_role(not_system_manager, "System Manager");
cy.call("frappe.tests.ui_test_helpers.create_todo", { description: "Frappe User ToDo" });
cy.call("frappe.tests.ui_test_helpers.create_admin_kanban");

cy.switch_to_user(noSystemManager);
cy.switch_to_user(not_system_manager);

cy.visit("/app/todo/view/kanban/Admin Kanban");

Expand All @@ -125,7 +125,7 @@ context("Kanban Board", () => {
cy.get(".kanban .column-options").should("have.length", 0);

cy.switch_to_user("Administrator");
cy.call("frappe.client.delete", { doctype: "User", name: noSystemManager });
cy.call("frappe.client.delete", { doctype: "User", name: not_system_manager });
});

after(() => {
Expand Down
1 change: 1 addition & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ Cypress.Commands.add("update_doc", (doctype, docname, args) => {

Cypress.Commands.add("switch_to_user", (user) => {
cy.call("logout");
cy.wait(200);
cy.login(user);
cy.reload();
});
Expand Down

0 comments on commit 821f75c

Please sign in to comment.