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

Edit BOM substitutes (#9521)

* Edit BOM substitutes

* Add playwright tests
This commit is contained in:
Oliver
2025-04-16 14:38:59 +10:00
committed by GitHub
parent 0707ebf59b
commit 204e2e6d46
5 changed files with 224 additions and 29 deletions

View File

@ -80,6 +80,39 @@ test('Parts - Supplier Parts', async ({ browser }) => {
await page.getByText('DIG-84670-SJI - R_550R_0805_1%').waitFor();
});
test('Parts - BOM', async ({ browser }) => {
const page = await doCachedLogin(browser, { url: 'part/87/bom' });
await loadTab(page, 'Bill of Materials');
await page.waitForLoadState('networkidle');
const cell = await page.getByRole('cell', {
name: 'Small plastic enclosure, black',
exact: true
});
await cell.click({ button: 'right' });
// Check for expected context menu actions
await page.getByRole('button', { name: 'Edit', exact: true }).waitFor();
await page.getByRole('button', { name: 'Delete', exact: true }).waitFor();
await page
.getByRole('button', { name: 'View details', exact: true })
.waitFor();
await page
.getByRole('button', { name: 'Edit Substitutes', exact: true })
.click();
await page.getByText('Edit BOM Substitutes').waitFor();
await page.getByText('1551ACLR').first().waitFor();
await page.getByText('1551AGY').first().waitFor();
await page.getByLabel('related-field-part').fill('enclosure');
await page.getByText('1591BTBU').click();
await page.getByRole('button', { name: 'Add Substitute' }).waitFor();
await page.getByRole('button', { name: 'Close' }).click();
});
test('Parts - Locking', async ({ browser }) => {
const page = await doCachedLogin(browser, { url: 'part/104/bom' });
await loadTab(page, 'Bill of Materials');