Bug 41214: Add cypress test

cypress run --spec t/cypress/integration/SIP2/Accounts.ts --config video=false,screenshotOnRunFailure=false

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0c0f4cc360)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
This commit is contained in:
Pedro Amorim 2025-11-07 13:56:55 +00:00 committed by Jacob O'Mara
parent 80a304ab63
commit 6d4b9b3e4e
No known key found for this signature in database
1 changed files with 11 additions and 0 deletions

View File

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