From d8c94b9d09aa9ca382971069d1ce6ea7a514ede7 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 Signed-off-by: Pedro Amorim Signed-off-by: Matt Blenkinsop --- 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 27feac28cff..d2a7f9db7a2 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