Job
No job planned.
Difficulty
Medium
Easy
Medium
Hard
Impossible with Cypress Studio
Cancel
Spec (updated on Wed Jul 23 15:04:18 2025)
describe("tools/additionalcontent/opacuserjsexample", function () {
const languages = ['en', 'es-ES', 'fr-FR', 'de-DE', 'el-GR', 'zh-Hant-TW'];
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
Cancel
Additional KTD data
Cancel