2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-05-06 17:53:44 +00:00

[UI] BOM compare (#11853)

* Refactor existing components

* Select assembly for comparison

* Rough BOM comparison table

* Select  display mode

* Layout tweaks

* Reset secondary part when drawer is closed

* Responsive grids

* Documentation

* Update CHANGELOG.md

* Add playwright tests

* Update wording

* Allow specification of secondary part with URL search params

* Update URL params when value changes

* Clearer display using icons

* Improve diff  layout

* Adjust playwright tests
This commit is contained in:
Oliver
2026-05-03 12:18:44 +10:00
committed by GitHub
parent f0edb002d0
commit 24ce51c5ca
13 changed files with 764 additions and 219 deletions
+31
View File
@@ -268,6 +268,37 @@ test('Parts - BOM Validation', async ({ browser }) => {
await page.getByText('Validated By: allaccessAlly').waitFor();
});
test('Parts - BOM Comparison', async ({ browser }) => {
const page = await doCachedLogin(browser, { url: 'part/104/bom' });
await page
.getByRole('button', { name: 'action-button-compare-bill-of' })
.click();
await page.getByText('Select an assembly to view').waitFor();
await page
.getByRole('combobox', { name: 'related-field-assembly' })
.fill('blue round table');
await page.getByText('Blue Round TableA round table').click();
await page.getByRole('columnheader', { name: 'Quantity' }).first().waitFor();
await page.getByRole('columnheader', { name: 'Changes' }).first().waitFor();
await page.getByText('No changes').first().waitFor();
await page.getByText('Part added to BOM').first().waitFor();
await page.getByText('Removed from BOM').first().waitFor();
// Change display mode
await page.getByRole('textbox', { name: 'bom-compare-display-mode' }).click();
await page.getByRole('option', { name: 'Show different Parts' }).click();
// Use URL params to compare directly
await navigate(page, 'part/108/bom?compare=107');
await page.waitForLoadState('networkidle');
await page.getByText('0.125').nth(1).waitFor();
await page.getByText('Red Paint', { exact: true }).first().waitFor();
await page.getByText('Blue Paint', { exact: true }).first().waitFor();
});
test('Parts - Editing', async ({ browser }) => {
const page = await doCachedLogin(browser, { url: 'part/104/details' });