2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-04-28 13:54:25 +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
+41 -1
View File
@@ -1,8 +1,9 @@
import { test } from '../baseFixtures.js';
import { baseUrl } from '../defaults.js';
import { clickButtonIfVisible, openFilterDrawer } from '../helpers.js';
import { doQuickLogin } from '../login.js';
test('Stock', async ({ page }) => {
test('Stock - Basic Tests', async ({ page }) => {
await doQuickLogin(page);
await page.goto(`${baseUrl}/stock/location/index/`);
@@ -49,6 +50,45 @@ test('Stock - Location Tree', async ({ page }) => {
await page.getByRole('cell', { name: 'Factory' }).first().waitFor();
});
test('Stock - Filters', async ({ page }) => {
await doQuickLogin(page, 'steven', 'wizardstaff');
await page.goto(`${baseUrl}/stock/location/index/`);
await page.getByRole('tab', { name: 'Stock Items' }).click();
await openFilterDrawer(page);
await clickButtonIfVisible(page, 'Clear Filters');
// Filter by updated date
await page.getByRole('button', { name: 'Add Filter' }).click();
await page.getByPlaceholder('Select filter').fill('updated');
await page.getByText('Updated After').click();
await page.getByPlaceholder('Select date value').fill('2010-01-01');
await page.getByText('Show items updated after this date').waitFor();
// Filter by batch code
await page.getByRole('button', { name: 'Add Filter' }).click();
await page.getByPlaceholder('Select filter').fill('batch');
await page
.getByRole('option', { name: 'Batch Code', exact: true })
.locator('span')
.click();
await page.getByPlaceholder('Enter filter value').fill('TABLE-B02');
await page.getByLabel('apply-text-filter').click();
// Close dialog
await page.keyboard.press('Escape');
// Ensure correct result is displayed
await page
.getByRole('cell', { name: 'A round table - with blue paint' })
.waitFor();
// Clear filters (ready for next set of tests)
await openFilterDrawer(page);
await clickButtonIfVisible(page, 'Clear Filters');
});
test('Stock - Serial Numbers', async ({ page }) => {
await doQuickLogin(page);