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:
parent
e2d2af4628
commit
1111d0257f
2 changed files with 3 additions and 2 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue