describe("serials/addsub2", 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("addsub2", function () {
cy.visit("/cgi-bin/koha/serials/subscription-add.pl");
cy.waitForPageLoad();
cy.get("#aqbooksellerid").type("1");
cy.get("#biblionumber").type("438");
cy.get("#subscription_add_next").click();
cy.get(".main.container-fluid").should('be.visible').screenshot("addsub2");
});
});
});
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
serials/subscription-add.pl
Interface
staff
Element selector
.main.container-fluid
Missing selector
setup
workflow
type #aqbooksellerid=1
type #biblionumber=438
click #subscription_add_next
teardown
Notes
Still lots more work to do for this one:
- Two-part form, need to get to the second part
- Need to create additional fields
- Area to capture needs to include the page title