Login

Screenshots for the Koha manual

New screenshots | All screenshots | Full test results | Manuals (wip)
en de el es fr hi zh_Hant

Image details

changetogive (#1158) ❌ Not validated

Job

No job planned.

Difficulty

Spec (updated on Thu Dec 4 15:48:27 2025)

describe("patrons/changetogive", function () {
    const languages = ['en', 'es-ES', 'fr-FR', 'de-DE', 'el-GR', 'hi', 'zh-Hant-TW'];
    languages.forEach((lang) => {
        describe(`in ${lang}`, () => {
            beforeEach(function(){
                // Skip if 'en' test failed
                if (Cypress.env("EN_TEST_FAILED")) {
                    this.skip();
                }
                cy.query("DELETE FROM accountlines;")
                cy.query("DELETE FROM account_offsets;")
                cy.query("INSERT INTO accountlines (`borrowernumber`,`itemnumber`,`date`,`amount`,`description`,`debit_type_code`,`amountoutstanding`,`manager_id`,`interface`,`branchcode`) VALUES ('5','630',date(CURDATE()),'2.500000','Lost item','LOST','2.500000','51','intranet','MPL');")
                cy.query("INSERT INTO account_offsets (`debit_id`,`type`,`amount`) VALUES ((SELECT accountlines_id FROM accountlines WHERE borrowernumber = '5' AND itemnumber = '630' AND amount = '2.500000'),'CREATE','2.500000');")
                cy.login();
                /* No specific padding defined */
                cy.set_cookie_lang(lang);
            });

            it("changetogive", function () {
                cy.visit("/cgi-bin/koha/members/pay.pl?borrowernumber=5 ");
                cy.waitForPageLoad();
                cy.get("button[value^='cud-pay_indiv']").click();
                cy.get("#collected").clear();
                cy.get("#collected").type("5.00");
                cy.get("input.btn-primary[type='submit']").click();
                cy.get("#confirm_change_form .modal-dialog").should('be.visible').screenshot("changetogive");
            });
        });
    });
    afterEach(function () {
        cy.query("DELETE FROM accountlines;")
        cy.query("DELETE FROM account_offsets;")
        Cypress.env('PADDING_BEFORE_SCREENSHOT', undefined);
        // Set EN_TEST_FAILED if the 'en' test failed
        if (this.currentTest.parent.title.includes('in en') && this.currentTest.state === 'failed') {
            Cypress.env("EN_TEST_FAILED", true);
        }
    });
});

Spec data

Page

pay.pl?borrowernumber=5

Interface

staff

Element selector

#confirm_change_form .modal-dialog

Missing selector

setup

sql DELETE FROM accountlines;
sql DELETE FROM account_offsets;
sql INSERT INTO accountlines (`borrowernumber`,`itemnumber`,`date`,`amount`,`description`,`debit_type_code`,`amountoutstanding`,`manager_id`,`interface`,`branchcode`) VALUES ('5','630',date(CURDATE()),'2.500000','Lost item','LOST','2.500000','51','intranet','MPL');
sql INSERT INTO account_offsets (`debit_id`,`type`,`amount`) VALUES ((SELECT accountlines_id FROM accountlines WHERE borrowernumber = '5' AND itemnumber = '630' AND amount = '2.500000'),'CREATE','2.500000');

workflow

click button[value^='cud-pay_indiv']
clear #collected
type #collected=5.00
click input.btn-primary[type='submit']

teardown

sql DELETE FROM accountlines;
sql DELETE FROM account_offsets;

Notes

Needs a "clear" command https://gitlab.com/joubu/koha-manual-screenshots-wip/-/issues/32

Additional KTD data

Test failure

AssertionError: Timed out retrying after 10000ms: Expected to find element: `#collected`, but never found it.
    at Context.eval (webpack://koha/./cypress/integration/patrons/changetogive.ts:23:19)

Thumbnails


Current Thumbnail old

Current

2025-12-01 12:15:14 +0000

2025-09-09 10:15:03 +0000

2025-07-31 18:30:03 +0000

2025-12-04 22:00:02 +0000

2025-12-01 12:15:14 +0000

Old screenshot