Login

Screenshots for the Koha manual

New screenshots | All screenshots | Full test results | Manuals (wip)
en ar cs de el es fr fr_CA hi it pt pt_BR sk sv tr zh_Hant

Image details

opacuserjsexample (#166)

Job

No job planned.

Difficulty

Medium

Spec (updated on Fri Jun 13 07:37:14 2025)

describe("tools/additionalcontent/opacuserjsexample", function () {
    const languages = ['en', 'es-ES', 'fr-FR'];
    languages.forEach((lang) => {
        describe(`in ${lang}`, () => {
            beforeEach(function(){
                // If previous test failed, skip this one
                if (Cypress.env("TEST_FAILED")) {
                    this.skip();
                }
                cy.query("UPDATE systempreferences set value=\"$(document).ready(function(){$('#more-search').hide();});\" where variable=\"OPACUserJS\"")
                cy.login();
                /* No specific padding defined */
                cy.set_cookie_lang(lang);
            });

            it("opacuserjsexample", function () {
                cy.visit("/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=opacuserjs&ok=Search");
                cy.waitForPageLoad();
                cy.get("#expand_OPACUserJS").click();
                cy.get("main").should('be.visible').screenshot("opacuserjsexample");
            });
        });
    });
    afterEach(function () {
        cy.query("UPDATE systempreferences set value=\"\" where variable=\"OPACUserJS\"")
        Cypress.env('PADDING_BEFORE_SCREENSHOT', undefined);
        if (this.currentTest.state === 'failed') {
            Cypress.env("TEST_FAILED", true);
        }
    });
});

Spec data

Page

admin/preferences.pl?op=search&searchfield=opacuserjs&ok=Search

Interface

staff

Element selector

main

Missing selector

Y

setup

sql UPDATE systempreferences set value="$(document).ready(function(){$('#more-search').hide();});" where variable="OPACUserJS"

workflow

click #expand_OPACUserJS

teardown

sql UPDATE systempreferences set value="" where variable="OPACUserJS"

Notes

We want to add content to the syspref before

Got to Administration
Search for OpacUserJS in system preferences search box
Click on Click to edit, to expand system preference content

Additional KTD data

Old

New (updated on Fri Jun 13 07:38:40 2025)

New (es)

New (fr)