2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-16 12:05:53 +00:00

Fix for locate item plugins (#8473)

* A hook for caching active plugins

* Add LocateItemButton

* Implement "locate" button for location detail page too

* Fix for StockApiMixin.get_serializer

- Recent refactoring removed 'path_detail' attribute

* Fix offloading of 'locate'

* Remove debug msg

* Add custom message

* Remove force_async call

* Add playwright tests
This commit is contained in:
Oliver
2024-11-13 06:49:48 +11:00
committed by GitHub
parent 7b50f3b1d3
commit 246f17113f
22 changed files with 204 additions and 27 deletions

View File

@ -94,3 +94,35 @@ test('Plugins - Custom Admin', async ({ page, request }) => {
await page.getByText('foo: bar').waitFor();
await page.getByText('hello: world').waitFor();
});
test('Plugins - Locate Item', async ({ page, request }) => {
await doQuickLogin(page, 'admin', 'inventree');
// Ensure that the sample location plugin is enabled
await setPluginState({
request,
plugin: 'samplelocate',
state: true
});
await page.waitForTimeout(500);
// Navigate to the "stock item" page
await page.goto(`${baseUrl}/stock/item/287/`);
// "Locate" this item
await page.getByLabel('action-button-locate-item').click();
await page.getByRole('button', { name: 'Submit' }).click();
await page.getByText('Item location requested').waitFor();
// Show the location
await page.getByLabel('breadcrumb-1-factory').click();
await page.waitForTimeout(500);
await page.getByLabel('action-button-locate-item').click();
await page.getByRole('button', { name: 'Submit' }).click();
await page.getByText('Item location requested').waitFor();
await page.waitForTimeout(2500);
return;
});