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); } }); });
sql UPDATE systempreferences set value="$(document).ready(function(){$('#more-search').hide();});" where variable="OPACUserJS"
click #expand_OPACUserJS
sql UPDATE systempreferences set value="" where variable="OPACUserJS"
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