Job
No job planned.
Difficulty
Medium
Easy
Medium
Hard
Impossible with Cypress Studio
Cancel
Spec (updated on Thu Dec 4 15:47:56 2025)
describe("tools/additionalcontent/opacuserjsexample", 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("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);
// 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
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
Cancel
Additional KTD data
Cancel