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

prevcheckout (#102) ❌ Not validated

Job

Difficulty

Hard

Spec (updated on Wed Mar 25 12:57:50 2026)

describe("circ/warnings/prevcheckout", 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.set_syspref("CheckPrevCheckout", "\"hardyes\"");
                cy.query("INSERT INTO old_issues(`issue_id`,`borrowernumber`,`itemnumber`,`date_due`,`branchcode`,`returndate`,`checkin_library`,`renewals_count`,`unseen_renewals`,`auto_renew`,`timestamp`,`issuedate`,`onsite_checkout`) VALUES (1,19,308,TIMESTAMP(CURDATE()),\"CPL\",TIMESTAMP(CURDATE()),\"CPL\",0,0,0,TIMESTAMP(CURDATE()),TIMESTAMP(CURDATE()),0)")
                cy.login();
                /* No specific padding defined */
                cy.set_cookie_lang(lang);
            });

            it("prevcheckout", function () {
                cy.visit("/cgi-bin/koha/circ/circulation.pl?borrowernumber=19");
                cy.waitForPageLoad();
                cy.get("#barcode").type("39999000006018");
                cy.get("button.btn:nth-child(4)").click();
                cy.wait_for_ajax();
                cy.get("#circ_needsconfirmation").should('be.visible').screenshot("prevcheckout");
            });
        });
    });
    afterEach(function () {
        cy.set_syspref("CheckPrevCheckout", "\"hardno\"");
        cy.query("DELETE FROM old_issues WHERE borrowernumber=19")
        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

circ/circulation.pl?borrowernumber=19

Interface

staff

Element selector

#circ_needsconfirmation

Missing selector

N

setup

set_syspref CheckPrevCheckout="hardyes"
sql INSERT INTO old_issues(`issue_id`,`borrowernumber`,`itemnumber`,`date_due`,`branchcode`,`returndate`,`checkin_library`,`renewals_count`,`unseen_renewals`,`auto_renew`,`timestamp`,`issuedate`,`onsite_checkout`) VALUES (1,19,308,TIMESTAMP(CURDATE()),"CPL",TIMESTAMP(CURDATE()),"CPL",0,0,0,TIMESTAMP(CURDATE()),TIMESTAMP(CURDATE()),0)

workflow

type #barcode=39999000006018
click button.btn:nth-child(4)
wait_for_ajax

teardown

set_syspref CheckPrevCheckout="hardno"
sql DELETE FROM old_issues WHERE borrowernumber=19

Notes

Will fail on second run, need to delete entries in old_issues for patron id=5

Additional KTD data

Test failure

CypressError: `cy.task('query')` failed with the following error:

> Field 'issue_id' doesn't have a default value

https://on.cypress.io/api/task

Because this error occurred during a `before each` hook we are skipping the remaining tests in the current suite: `in en`
    at <unknown> (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:135374:70)
    at tryCatcher (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:1807:23)
    at Promise._settlePromiseFromHandler (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:1519:31)
    at Promise._settlePromise (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:1576:18)
    at Promise._settlePromise0 (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:1621:10)
    at Promise._settlePromises (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:1697:18)
    at _drainQueueStep (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:2407:12)
    at _drainQueue (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:2400:9)
    at Async._drainQueues (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:2416:5)
    at Async.drainQueues (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:2286:14)
From Your Spec Code:
    at Context.query (webpack://koha/./node_modules/cypress-mysql/dist/index.js:69:0)

From Node.js Internals:
  Error: Field 'issue_id' doesn't have a default value
      at PromiseConnection.query (/e2e/node_modules/mysql2/promise.js:94:22)
      at <unknown> (/e2e/node_modules/cypress-mysql/dist/index.js:75:33)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)

Thumbnails


Current Thumbnail old

Current

Old screenshot