describe("admin/basicparams/addsubgroup", 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("INSERT INTO library_groups (title) VALUES (\"myGroup\");")
cy.login();
/* No specific padding defined */
cy.set_cookie_lang(lang);
});
it("addsubgroup", function () {
cy.visit("/cgi-bin/koha/admin/library_groups.pl");
cy.waitForPageLoad();
cy.get("table.library-groups tr.expanded td:nth-child(4) div:nth-child(1) button").click();
cy.get("table.library-groups tr.expanded td:nth-child(4) div:nth-child(1) ul li:nth-child(1) a").click();
cy.get("#add-group-modal .modal-content").should('be.visible').screenshot("addsubgroup");
});
});
});
afterEach(function () {
cy.query("DELETE FROM library_groups WHERE title=\"myGroup\";")
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/library_groups.pl
Interface
staff
Element selector
#add-group-modal .modal-content
Missing selector
setup
sql INSERT INTO library_groups (title) VALUES ("myGroup");
workflow
click table.library-groups tr.expanded td:nth-child(4) div:nth-child(1) button
click table.library-groups tr.expanded td:nth-child(4) div:nth-child(1) ul li:nth-child(1) a
teardown
sql DELETE FROM library_groups WHERE title="myGroup";
Notes
Prerequisite: existing library group
Page: library_groups.pl
Element selector: add-group-form
workflow
Go to Administration > Library groups > click New group > add 'Central libraries and select last 4 options > Save > click Actions > click Add sub-group