mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +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:
		| @@ -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; | ||||
| }); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user