2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-09-14 22:51:30 +00:00

API date filter updates (#8544)

* Add 'stocktake_before' and 'stocktake_after' filters for StockItem API

* Enable new filters for StockItemTable

* Update CUI table filters

* Add more date filter options for orders

* Add date filters to BuildList

* Update BuildOrderTable filters

* Add more order date filters

* Cleanup PurchaseOrderFilter code

* Implement more PUI table filters

* Add "Completion Date" column to PurchaseOrderTable

* Update ReturnOrderTable

* Add 'text' option for TableFilter

* filter state management

* Bump API version

* Sorting for table filters

* Add playwright tests for stock table filtering

* Playwright updates

- Add some helper functions for common operations

* Refactoring for Playwright tests
This commit is contained in:
Oliver
2024-11-25 21:36:31 +11:00
committed by GitHub
parent 5e762bc7f7
commit 809a978f7d
22 changed files with 586 additions and 124 deletions

View File

@@ -0,0 +1,46 @@
/**
* Open the filter drawer for the currently visible table
* @param page - The page object
*/
export const openFilterDrawer = async (page) => {
await page.getByLabel('table-select-filters').click();
};
/**
* Close the filter drawer for the currently visible table
* @param page - The page object
*/
export const closeFilterDrawer = async (page) => {
await page.getByLabel('filter-drawer-close').click();
};
/**
* Click the specified button (if it is visible)
* @param page - The page object
* @param name - The name of the button to click
*/
export const clickButtonIfVisible = async (page, name, timeout = 500) => {
await page.waitForTimeout(timeout);
if (await page.getByRole('button', { name }).isVisible()) {
await page.getByRole('button', { name }).click();
}
};
/**
* Clear all filters from the currently visible table
* @param page - The page object
*/
export const clearTableFilters = async (page) => {
await openFilterDrawer(page);
await clickButtonIfVisible(page, 'Clear Filters');
await page.getByLabel('filter-drawer-close').click();
};
/**
* Return the parent 'row' element for a given 'cell' element
* @param cell - The cell element
*/
export const getRowFromCell = async (cell) => {
return cell.locator('xpath=ancestor::tr').first();
};