mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 05:05:42 +00:00 
			
		
		
		
	Fix glitch in <RelatedModelField /> (#10113)
* Fix glitch in <RelatedModelField /> - Prevent search reset until debounced value changes - * Robustify playwright tests * Further playwright tweaks * Further playwright tweaks
This commit is contained in:
		| @@ -331,6 +331,22 @@ test('Build Order - Tracked Outputs', async ({ browser }) => { | ||||
|     url: 'manufacturing/build-order/10/incomplete-outputs' | ||||
|   }); | ||||
|  | ||||
|   const cancelBuildOutput = async (cell) => { | ||||
|     await clickOnRowMenu(cell); | ||||
|     await page.getByRole('menuitem', { name: 'Cancel' }).click(); | ||||
|     await page.getByRole('button', { name: 'Submit' }).click(); | ||||
|     await page.getByText('Build outputs have been cancelled').waitFor(); | ||||
|   }; | ||||
|  | ||||
|   // Ensure table has loaded | ||||
|   await page.getByRole('cell', { name: '# 13' }).waitFor(); | ||||
|  | ||||
|   // Check if the build output "#15" exists. If so, remove it. | ||||
|   const existingCell = await page.getByRole('cell', { name: '# 15' }); | ||||
|   if (await existingCell.isVisible()) { | ||||
|     await cancelBuildOutput(existingCell); | ||||
|   } | ||||
|  | ||||
|   // Create a new build output, serial number 15 | ||||
|   await page | ||||
|     .getByRole('button', { name: 'action-button-add-build-output' }) | ||||
| @@ -362,9 +378,12 @@ test('Build Order - Tracked Outputs', async ({ browser }) => { | ||||
|     .waitFor(); | ||||
|  | ||||
|   // The stock item should be pre-filled based on serial number | ||||
|   await page.getByRole('cell', { name: 'Thumbnail 002.01-PCBA |' }).waitFor(); | ||||
|   await page.getByRole('button', { name: 'Submit' }).isEnabled(); | ||||
|   await page.getByRole('button', { name: 'Submit' }).click(); | ||||
|  | ||||
|   await page.getByText('Stock items allocated').waitFor(); | ||||
|  | ||||
|   await allocationRow.getByText('1 / 1').waitFor(); | ||||
|  | ||||
|   // Close the allocation wizard | ||||
| @@ -375,12 +394,15 @@ test('Build Order - Tracked Outputs', async ({ browser }) => { | ||||
|   await row.getByText('0 / 2').waitFor(); | ||||
|  | ||||
|   // Cancel the build output to return to the original state | ||||
|   await clickOnRowMenu(cell); | ||||
|   await page.getByRole('menuitem', { name: 'Cancel' }).click(); | ||||
|   await page.getByRole('button', { name: 'Submit' }).click(); | ||||
|   await page.getByText('Build outputs have been cancelled').waitFor(); | ||||
|   await cancelBuildOutput(cell); | ||||
|  | ||||
|   // Next, complete a new output and auto-allocate items based on serial number | ||||
|   // Cancel build output "#16" if it exists | ||||
|   const existingCell16 = await page.getByRole('cell', { name: '# 16' }); | ||||
|   if (await existingCell16.isVisible()) { | ||||
|     await cancelBuildOutput(existingCell16); | ||||
|   } | ||||
|  | ||||
|   await page | ||||
|     .getByRole('button', { name: 'action-button-add-build-output' }) | ||||
|     .click(); | ||||
| @@ -401,10 +423,7 @@ test('Build Order - Tracked Outputs', async ({ browser }) => { | ||||
|   await newRow.getByText('0 / 2').waitFor(); | ||||
|  | ||||
|   // Cancel this output too | ||||
|   await clickOnRowMenu(newCell); | ||||
|   await page.getByRole('menuitem', { name: 'Cancel' }).click(); | ||||
|   await page.getByRole('button', { name: 'Submit' }).click(); | ||||
|   await page.getByText('Build outputs have been cancelled').waitFor(); | ||||
|   await cancelBuildOutput(newCell); | ||||
| }); | ||||
|  | ||||
| test('Build Order - Filters', async ({ browser }) => { | ||||
|   | ||||
| @@ -199,12 +199,15 @@ test('Parts - Details', async ({ browser }) => { | ||||
|   await page.getByText('Can Build').waitFor(); | ||||
|  | ||||
|   await page.getByText('0 / 10').waitFor(); | ||||
|   await page.getByText('4 / 49').waitFor(); | ||||
|  | ||||
|   // Depending on the state of other tests, the "In Production" value may vary | ||||
|   // This could be either 4 / 49, or 5 / 49 | ||||
|   await page.getByText(/[4|5] \/ 49/).waitFor(); | ||||
|  | ||||
|   // Badges | ||||
|   await page.getByText('Required: 10').waitFor(); | ||||
|   await page.getByText('No Stock').waitFor(); | ||||
|   await page.getByText('In Production: 4').waitFor(); | ||||
|   await page.getByText(/In Production: [4|5]/).waitFor(); | ||||
|  | ||||
|   await page.getByText('Creation Date').waitFor(); | ||||
|   await page.getByText('2022-04-29').waitFor(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user