mirror of
https://github.com/inventree/InvenTree.git
synced 2025-10-22 00:47:38 +00:00
Supplier Mixin (#9761)
* commit initial draft for supplier import * complete import wizard * allow importing only mp and sp * improved sample supplier plugin * add docs * add tests * bump api version * fix schema docu * fix issues from code review * commit unstaged changes * fix test * refactor part parameter bulk creation * try to fix test * fix tests * fix test for mysql * fix test * support multiple suppliers by a single plugin * hide import button if there is no supplier import plugin * make form submitable via enter * add pui test * try to prevent race condition * refactor api calls in pui tests * try to fix tests again? * fix tests * trigger: ci * update changelog * fix api_version * fix style * Update CHANGELOG.md Co-authored-by: Matthias Mair <code@mjmair.com> * add user docs --------- Co-authored-by: Matthias Mair <code@mjmair.com>
This commit is contained in:
@@ -2,12 +2,14 @@ import { test } from '../baseFixtures';
|
||||
import {
|
||||
clearTableFilters,
|
||||
clickOnRowMenu,
|
||||
deletePart,
|
||||
getRowFromCell,
|
||||
loadTab,
|
||||
navigate,
|
||||
setTableChoiceFilter
|
||||
} from '../helpers';
|
||||
import { doCachedLogin } from '../login';
|
||||
import { setPluginState, setSettingState } from '../settings';
|
||||
|
||||
/**
|
||||
* CHeck each panel tab for the "Parts" page
|
||||
@@ -645,3 +647,62 @@ test('Parts - Duplicate', async ({ browser }) => {
|
||||
await page.getByText('Copy Parameters', { exact: true }).waitFor();
|
||||
await page.getByText('Copy Tests', { exact: true }).waitFor();
|
||||
});
|
||||
|
||||
test('Parts - Import supplier part', async ({ browser }) => {
|
||||
const page = await doCachedLogin(browser, {
|
||||
url: 'part/category/1/parts'
|
||||
});
|
||||
|
||||
// Ensure that the sample supplier plugin is enabled
|
||||
await setPluginState({
|
||||
plugin: 'samplesupplier',
|
||||
state: true
|
||||
});
|
||||
|
||||
await setSettingState({
|
||||
setting: 'SUPPLIER',
|
||||
value: 3,
|
||||
type: 'plugin',
|
||||
plugin: 'samplesupplier'
|
||||
});
|
||||
|
||||
// cleanup old imported part if it exists
|
||||
await deletePart('BOLT-Steel-M5-5');
|
||||
await deletePart('BOLT-M5-5');
|
||||
|
||||
await page.reload();
|
||||
await page.waitForLoadState('networkidle');
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByRole('button', { name: 'action-button-import-part' }).click();
|
||||
await page
|
||||
.getByRole('textbox', { name: 'textbox-search-for-part' })
|
||||
.fill('M5');
|
||||
await page.waitForTimeout(250);
|
||||
await page
|
||||
.getByRole('textbox', { name: 'textbox-search-for-part' })
|
||||
.press('Enter');
|
||||
|
||||
await page.getByText('Bolt M5x5mm Steel').waitFor();
|
||||
await page
|
||||
.getByRole('button', { name: 'action-button-import-part-BOLT-Steel-M5-5' })
|
||||
.click();
|
||||
await page.waitForTimeout(250);
|
||||
await page
|
||||
.getByRole('button', { name: 'action-button-import-part-now' })
|
||||
.click();
|
||||
|
||||
await page
|
||||
.getByRole('button', { name: 'action-button-import-create-parameters' })
|
||||
.dispatchEvent('click');
|
||||
await page
|
||||
.getByRole('button', { name: 'action-button-import-stock-next' })
|
||||
.dispatchEvent('click');
|
||||
await page
|
||||
.getByRole('button', { name: 'action-button-import-close' })
|
||||
.dispatchEvent('click');
|
||||
|
||||
// cleanup imported part if it exists
|
||||
await deletePart('BOLT-Steel-M5-5');
|
||||
await deletePart('BOLT-M5-5');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user