describe("admin/acquisitions/planningbymonths", function () {
const languages = ['en', 'es-ES', 'fr-FR'];
languages.forEach((lang) => {
describe(`in ${lang}`, () => {
beforeEach(function(){
// If previous test failed, skip this one
if (Cypress.env("TEST_FAILED")) {
this.skip();
}
cy.query("UPDATE aqbudgetperiods set budget_period_startdate=\"2025-01-01\", budget_period_enddate=\"2025-12-01\" where budget_period_id=1")
cy.login();
/* No specific padding defined */
cy.set_cookie_lang(lang);
});
it("planningbymonths", function () {
cy.visit("/cgi-bin/koha/admin/aqplan.pl?budget_period_id=1&authcat=MONTHS");
cy.waitForPageLoad();
cy.get("main").should('be.visible').screenshot("planningbymonths");
});
});
});
afterEach(function () {
Cypress.env('PADDING_BEFORE_SCREENSHOT', undefined);
if (this.currentTest.state === 'failed') {
Cypress.env("TEST_FAILED", true);
}
});
});
Spec data
Page
aqplan.pl?budget_period_id=1&authcat=MONTHS
Interface
staff
Element selector
main
Missing selector
N
setup
sql UPDATE aqbudgetperiods set budget_period_startdate="2025-01-01", budget_period_enddate="2025-12-01" where budget_period_id=1
workflow
teardown
Notes
In the sample data, the budget period is very long and the monthly planning doesn't look good. We'd probably have to create another budget entirely...
An alternative is to update the displayed budget to setup a more fitting starting date.
We also need to add query parameters in the page section.
Go to Administration > Budgets > Click Main budget > Click Planning - Planning by months