mirror of
https://github.com/inventree/InvenTree.git
synced 2026-05-17 23:08:28 +00:00
[feature] Bulk replace (#11861)
* Allow bulk replace of BOM items * Add "locked" filter for UsedIn table * Add playwright tests * docs * Bump API version * Update CHANGELOG * Update api_version.py --------- Co-authored-by: Matthias Mair <code@mjmair.com>
This commit is contained in:
@@ -305,6 +305,34 @@ test('Parts - BOM Comparison', async ({ browser }) => {
|
||||
await page.getByText('Blue Paint', { exact: true }).first().waitFor();
|
||||
});
|
||||
|
||||
test('Parts - Used In', async ({ browser }) => {
|
||||
const page = await doCachedLogin(browser, { url: 'part/4/used_in' });
|
||||
|
||||
// Check for expected elements
|
||||
await page.getByRole('button', { name: 'Assembly Not sorted' }).waitFor();
|
||||
await page.getByText('R33, R34, R35, R36').waitFor();
|
||||
|
||||
// Edit row
|
||||
const cell = await page.getByRole('cell', { name: 'Thumbnail Test Board 1' });
|
||||
await cell.click({ button: 'right' });
|
||||
await page.getByRole('button', { name: 'Edit' }).first().click();
|
||||
await page.getByRole('textbox', { name: 'text-field-reference' }).waitFor();
|
||||
await page.getByRole('button', { name: 'Cancel' }).click();
|
||||
|
||||
// Attempt to replace this part in multiple assemblies
|
||||
await page.getByRole('checkbox', { name: 'Select all records' }).click();
|
||||
await page.getByRole('button', { name: 'action-button-replace-' }).click();
|
||||
await page.getByText('This action cannot be easily undone').waitFor();
|
||||
|
||||
// Submit the form - locked parts should throw an error
|
||||
await page.getByRole('button', { name: 'Replace', exact: true }).click();
|
||||
|
||||
await page.getByText('Form Error').waitFor();
|
||||
await page
|
||||
.getByText('BOM item cannot be modified - assembly is locked')
|
||||
.waitFor();
|
||||
});
|
||||
|
||||
test('Parts - Editing', async ({ browser }) => {
|
||||
const page = await doCachedLogin(browser, { url: 'part/104/details' });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user