Bug 42666: Add a Cypress test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2026-05-25 07:48:02 +02:00 committed by Lucas Gass
parent 63611e5b58
commit a10ad06a93
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 43 additions and 0 deletions

View File

@ -589,3 +589,46 @@ describe("ERM ", () => {
});
});
});
describe("Itemtypes", () => {
beforeEach(() => {
cy.login();
cy.title().should("eq", "Koha staff interface");
cy.task("buildSampleObjects", {
object: "item_type",
count: RESTdefaultPageSize,
}).then(itemtypes => {
itemtypes.forEach(itemtype => {
cy.task("insertObject", {
type: "item_type",
object: itemtype,
});
});
cy.wrap(itemtypes).as("itemtypes");
});
});
afterEach(function () {
cy.task("deleteSampleObjects", [this.itemtypes]);
});
const table_id = "table_item_type";
it("Next && pageLength", function () {
cy.visit("/cgi-bin/koha/admin/itemtypes.pl");
cy.task("query", {
sql: "SELECT COUNT(*) as count FROM itemtypes",
}).then(result => {
cy.get(`#${table_id}_wrapper .dt-info`).contains(
`Showing 1 to 10 of ${result[0].count} entries`
);
cy.get(
`#${table_id}_wrapper .top.pager .dt-paging-button.next`
).click();
cy.get(`#${table_id}_wrapper .dt-info`).contains(
`Showing 11 to 20 of ${result[0].count} entries`
);
});
});
});