test: ignore missing param for cy.remove_doc (#34697)

This makes it easier to clean up db state before running a test.
This commit is contained in:
Raffael Meyer 2025-11-15 05:49:49 +01:00 committed by GitHub
parent e2d2af4628
commit 1111d0257f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -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",

View file

@ -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;
});
});