describe("patrons/cancelcharge", 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("INSERT INTO accountlines (`borrowernumber`,`itemnumber`,`date`,`amount`,`description`,`debit_type_code`,`amountoutstanding`,`manager_id`,`interface`,`branchcode`) VALUES ('5','630',date(CURDATE()),'5.950000','Lost item','LOST','5.950000','51','intranet','MPL');")
cy.query("INSERT INTO account_offsets (`debit_id`,`type`,`amount`) VALUES ((SELECT accountlines_id FROM accountlines WHERE borrowernumber = '5' AND itemnumber = '630' AND amount = '5.950000'),'CREATE','5.950000');")
cy.login();
/* No specific padding defined */
cy.set_cookie_lang(lang);
});
it("cancelcharge", function () {
cy.visit("/cgi-bin/koha/members/boraccount.pl?borrowernumber=5");
cy.waitForPageLoad();
cy.get("#table_account_fines").should('be.visible').screenshot("cancelcharge");
});
});
});
afterEach(function () {
cy.query("DELETE FROM accountlines;")
cy.query("DELETE FROM account_offsets;")
Cypress.env('PADDING_BEFORE_SCREENSHOT', undefined);
if (this.currentTest.state === 'failed') {
Cypress.env("TEST_FAILED", true);
}
});
});
Spec data
Page
boraccount.pl?borrowernumber=5
Interface
staff
Element selector
#table_account_fines
Missing selector
setup
sql INSERT INTO accountlines (`borrowernumber`,`itemnumber`,`date`,`amount`,`description`,`debit_type_code`,`amountoutstanding`,`manager_id`,`interface`,`branchcode`) VALUES ('5','630',date(CURDATE()),'5.950000','Lost item','LOST','5.950000','51','intranet','MPL');
sql INSERT INTO account_offsets (`debit_id`,`type`,`amount`) VALUES ((SELECT accountlines_id FROM accountlines WHERE borrowernumber = '5' AND itemnumber = '630' AND amount = '5.950000'),'CREATE','5.950000');
workflow
teardown
sql DELETE FROM accountlines;
sql DELETE FROM account_offsets;
Notes
Width problem https://gitlab.com/joubu/koha-manual-screenshots-wip/-/issues/31