2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-09-13 22:21:37 +00:00

Import fix 2 (#9992)

* Fix return types

* Add getStatusCodeLabel func

* Fix logic for import session drawer

- Properly re-fetch session data
- Rendering improvements

* Fix icon

* API permission fixes

* Enhanced playwright testing

* Fix playwright tests

* Tweak playwright tests

* Remove unused var

* Tweak playwright tests
This commit is contained in:
Oliver
2025-07-09 23:32:00 +10:00
committed by GitHub
parent 7ff2ca914a
commit c6166d7c4a
10 changed files with 153 additions and 90 deletions

View File

@@ -1,6 +1,7 @@
import { test } from '../baseFixtures';
import {
clearTableFilters,
clickOnRowMenu,
getRowFromCell,
loadTab,
navigate
@@ -89,17 +90,15 @@ test('Parts - BOM', async ({ browser }) => {
name: 'Small plastic enclosure, black',
exact: true
});
await cell.click({ button: 'right' });
await clickOnRowMenu(cell);
// 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('menuitem', { name: 'Edit', exact: true }).waitFor();
await page.getByRole('menuitem', { name: 'Delete', exact: true }).waitFor();
await page
.getByRole('button', { name: 'Edit Substitutes', exact: true })
.getByRole('menuitem', { name: 'Edit Substitutes', exact: true })
.click();
await page.getByText('Edit BOM Substitutes').waitFor();
await page.getByText('1551ACLR').first().waitFor();

View File

@@ -50,13 +50,55 @@ test('Importing - BOM', async ({ browser }) => {
await page.getByText('Mapping data columns to database fields').waitFor();
await page.getByRole('button', { name: 'Accept Column Mapping' }).click();
await page.waitForTimeout(500);
await page.getByText('Processing Data').waitFor();
await page.getByText('Importing Data').waitFor();
await page.getByText('0 / 4').waitFor();
await page.getByText('Torx head screw, M3 thread, 10.0mm').first().waitFor();
await page.getByText('Small plastic enclosure, black').first().waitFor();
// Select some rows
await page
.getByLabel('Importing DataUpload FileMap')
.getByText('002.01-PCBA | Widget Board')
.waitFor();
.getByRole('row', { name: 'Select record 1 0 Thumbnail' })
.getByLabel('Select record')
.click();
await page
.getByRole('row', { name: 'Select record 2 1 Thumbnail' })
.getByLabel('Select record')
.click();
// Delete selected rows
await page
.getByRole('dialog', { name: 'Importing Data Upload File 2' })
.getByLabel('action-button-delete-selected')
.click();
await page.getByRole('button', { name: 'Delete', exact: true }).click();
await page.getByText('Success', { exact: true }).waitFor();
await page.getByText('Items deleted', { exact: true }).waitFor();
// Edit a row
await page
.getByRole('row', { name: 'Select record 1 2 Thumbnail' })
.getByLabel('row-action-menu-')
.click();
await page.getByRole('menuitem', { name: 'Edit' }).click();
await page.getByRole('textbox', { name: 'number-field-quantity' }).fill('12');
await page.waitForTimeout(250);
await page.getByRole('button', { name: 'Submit' }).click();
await page.waitForTimeout(250);
await page.getByText('0 / 2', { exact: true }).waitFor();
// Submit a row
await page
.getByRole('row', { name: 'Select record 1 2 Thumbnail' })
.getByLabel('row-action-menu-')
.click();
await page.getByRole('menuitem', { name: 'Accept' }).click();
await page.getByText('1 / 2', { exact: true }).waitFor();
});
test('Importing - Purchase Order', async ({ browser }) => {