describe("acquisitions/basketgroupopen", function () {
const languages = ['en', 'es-ES', 'fr-FR', 'de-DE', 'el-GR', 'hi', '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 aqbasketgroups (id, name, closed, booksellerid, deliveryplace, billingplace) VALUES (1, \"My Basket Group\", 0, 1, \"CPL\", \"CPL\")")
cy.query("INSERT INTO aqbasket (basketno, basketname, booksellerid, basketgroupid, branch) VALUES (2, \"My basket\", 1, 1, \"CPL\")")
cy.login();
/* No specific padding defined */
cy.set_cookie_lang(lang);
});
it("basketgroupopen", function () {
cy.visit("/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=1");
cy.waitForPageLoad();
cy.get("main").should('be.visible').screenshot("basketgroupopen");
});
});
});
afterEach(function () {
cy.query("DELETE FROM aqbasket WHERE basketno=2")
cy.query("DELETE FROM aqbasketgroups WHERE id=1")
Cypress.env('PADDING_BEFORE_SCREENSHOT', undefined);
if (this.currentTest.state === 'failed') {
Cypress.env("TEST_FAILED", true);
}
});
});
Spec data
Page
acqui/basketgroup.pl?booksellerid=1
Interface
staff
Element selector
main
Missing selector
N
setup
sql INSERT INTO aqbasketgroups (id, name, closed, booksellerid, deliveryplace, billingplace) VALUES (1, "My Basket Group", 0, 1, "CPL", "CPL")
sql INSERT INTO aqbasket (basketno, basketname, booksellerid, basketgroupid, branch) VALUES (2, "My basket", 1, 1, "CPL")
workflow
teardown
sql DELETE FROM aqbasket WHERE basketno=2
sql DELETE FROM aqbasketgroups WHERE id=1
Notes
Should have a basket in the group (means adding a basket with sql to aqbaskets with foreign key to this aqbasketgroup.id)
same for the closed basket screenshot.