From 360c4e1aaed61d2f417a1077ad77e9b9e938509e Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Fri, 7 Nov 2025 13:56:55 +0000 Subject: [PATCH] Bug 41214: Add cypress test cypress run --spec t/cypress/integration/SIP2/Accounts.ts --config video=false,screenshotOnRunFailure=false --- t/cypress/integration/SIP2/Accounts.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/t/cypress/integration/SIP2/Accounts.ts b/t/cypress/integration/SIP2/Accounts.ts index 25711ef768d..e56b723d67a 100644 --- a/t/cypress/integration/SIP2/Accounts.ts +++ b/t/cypress/integration/SIP2/Accounts.ts @@ -77,6 +77,7 @@ describe("Accounts", () => { beforeEach(() => { cy.login(); cy.title().should("eq", "Koha staff interface"); + cy.set_syspref("UseCashRegisters", 0); }); it("List accounts", () => { @@ -232,6 +233,8 @@ describe("Accounts", () => { cy.get("#login_id").should("not.be.visible"); + cy.get("#register_id").should("not.exist"); + // Submit the form, get 500 cy.intercept("POST", "/api/v1/sip2/accounts", { statusCode: 500, @@ -253,6 +256,13 @@ describe("Accounts", () => { ); }); + it("Should show/hide register_id based on syspref", () => { + cy.set_syspref("UseCashRegisters", 1).then(() => { + cy.visit("/cgi-bin/koha/sip2/accounts/add"); + cy.get("#register_id").should("exist"); + }); + }); + it("Edit account", () => { let account = get_account(); let accounts = [account]; @@ -282,6 +292,7 @@ describe("Accounts", () => { // Form has been correctly filled in cy.get("#login_id").should("have.value", accounts[0].login_id); + cy.get("#register_id").should("not.exist"); // cy.get("#checkin_yes").should("be.checked"); // cy.get("#checkout_yes").should("be.checked"); -- 2.39.5