describe("admin/cataloging/samplematchrule", 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.login();
/* No specific padding defined */
cy.set_cookie_lang(lang);
});
it("samplematchrule", function () {
cy.visit("/cgi-bin/koha/admin/matching-rules.pl?op=add_matching_rule");
cy.waitForPageLoad();
cy.get("#code").type("CN");
cy.get("#description").type("Contrôle number (biblio)");
cy.get("#threshold").type("100");
cy.get("#mp_1_search_index").type("control-number");
cy.get("#mp_1_score").type("100");
cy.get("#mp_1_c_1_tag").type("001");
cy.get("#mc_1 > fieldset:nth-child(1) > p > a:nth-child(2)").click();
cy.get("main").should('be.visible').screenshot("samplematchrule");
});
});
});
afterEach(function () {
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/matching-rules.pl?op=add_matching_rule
Interface
staff
Element selector
main
Missing selector
Y
setup
workflow
type #code=CN
type #description=Contrôle number (biblio)
type #threshold=100
type #mp_1_search_index=control-number
type #mp_1_score=100
type #mp_1_c_1_tag=001
click #mc_1 > fieldset:nth-child(1) > p > a:nth-child(2)