mirror of
https://github.com/inventree/InvenTree.git
synced 2025-10-22 00:47:38 +00:00
Table pagination fix (#10236)
* Correct pagination offset calculation * Add playwright tests * Enhanced playwright test * Add comment * Fix typo
This commit is contained in:
@@ -39,6 +39,38 @@ test('Tables - Filters', async ({ browser }) => {
|
||||
await clearTableFilters(page);
|
||||
});
|
||||
|
||||
test('Tables - Pagination', async ({ browser }) => {
|
||||
const page = await doCachedLogin(browser, {
|
||||
url: 'manufacturing/index/buildorders',
|
||||
username: 'steven',
|
||||
password: 'wizardstaff'
|
||||
});
|
||||
|
||||
await clearTableFilters(page);
|
||||
|
||||
// Expected pagination size is 25
|
||||
// Note: Due to other tests, there may be more than 25 items in the list
|
||||
await page.getByText(/1 - 25 \/ 2[2|8]/).waitFor();
|
||||
await page.getByRole('button', { name: 'Next page' }).click();
|
||||
await page.getByText(/26 - 2[7|8] \/ 2[7|8]/).waitFor();
|
||||
|
||||
// Set page size to 10
|
||||
await page.getByRole('button', { name: '25' }).click();
|
||||
await page.getByRole('menuitem', { name: '10', exact: true }).click();
|
||||
|
||||
await page.getByText(/1 - 10 \/ 2[7|8]/).waitFor();
|
||||
await page.getByRole('button', { name: '3' }).click();
|
||||
await page.getByText(/21 - 2[7|8] \/ 2[7|8]/).waitFor();
|
||||
await page.getByRole('button', { name: 'Previous page' }).click();
|
||||
await page.getByText(/11 - 20 \/ 2[7|8]/).waitFor();
|
||||
|
||||
// Set page size back to 25
|
||||
await page.getByRole('button', { name: '10' }).click();
|
||||
await page.getByRole('menuitem', { name: '25', exact: true }).click();
|
||||
|
||||
await page.getByText(/1 - 25 \/ 2[7|8]/).waitFor();
|
||||
});
|
||||
|
||||
test('Tables - Columns', async ({ browser }) => {
|
||||
// Go to the "stock list" page
|
||||
const page = await doCachedLogin(browser, {
|
||||
|
||||
Reference in New Issue
Block a user