diff --git a/cypress/integration/workspace_blocks.js b/cypress/integration/workspace_blocks.js index 70159150e2..396e80d16b 100644 --- a/cypress/integration/workspace_blocks.js +++ b/cypress/integration/workspace_blocks.js @@ -11,6 +11,7 @@ context("Workspace Blocks", () => { }); it("Create Test Page", () => { + cy.remove_doc("Workspace", `Test Block Page-${Cypress.config("testUser")}`, true); cy.intercept({ method: "POST", url: "api/method/frappe.desk.doctype.workspace.workspace.new_page", diff --git a/cypress/support/commands.js b/cypress/support/commands.js index cf94335a74..5731a0050c 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -125,7 +125,7 @@ Cypress.Commands.add("get_doc", (doctype, name) => { }); }); -Cypress.Commands.add("remove_doc", (doctype, name) => { +Cypress.Commands.add("remove_doc", (doctype, name, ignore_missing) => { return cy .window() .its("frappe.csrf_token") @@ -138,9 +138,9 @@ Cypress.Commands.add("remove_doc", (doctype, name) => { Accept: "application/json", "X-Frappe-CSRF-Token": csrf_token, }, + failOnStatusCode: !ignore_missing, }) .then((res) => { - expect(res.status).eq(202); return res.body; }); });