mirror of
https://github.com/inventree/InvenTree.git
synced 2025-09-13 22:21:37 +00:00
[UI] Build order visual enhancements (#9931)
* Adjust UI wording - Separation between "items" and "stock" * Add info panel if build order has no required items * Fixes for playwright testing - Ensure cookies are completely cleaned between sessions - Fix base URL based on vite command - Fix samesite cookie mode - Prevent /static/ files being served by web server on :8000 * Remove gunicorn option * Fix unit test * Readjust base URL * Simplify doCachedLogin * Adjust text * Ensure translations are extracted - Otherwise, playwright will not find the right strings... * Make admin test more reliable * Remove asynciness * Fix <AttachmentLink> - Allow null "attachment" value * Better implementation * Cleanup
This commit is contained in:
@@ -105,6 +105,8 @@ export const loadTab = async (page, tabName) => {
|
||||
.getByLabel(/panel-tabs-/)
|
||||
.getByRole('tab', { name: tabName })
|
||||
.click();
|
||||
|
||||
await page.waitForLoadState('networkidle');
|
||||
};
|
||||
|
||||
// Activate "table" view in certain contexts
|
||||
|
@@ -66,7 +66,7 @@ test('Build Order - Basic Tests', async ({ browser }) => {
|
||||
await loadTab(page, 'Attachments');
|
||||
await loadTab(page, 'Notes');
|
||||
await loadTab(page, 'Incomplete Outputs');
|
||||
await loadTab(page, 'Required Stock');
|
||||
await loadTab(page, 'Required Parts');
|
||||
await loadTab(page, 'Allocated Stock');
|
||||
|
||||
// Check for expected text in the table
|
||||
|
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
|
||||
import test from '@playwright/test';
|
||||
import { loadTab } from './helpers';
|
||||
import { clickOnRowMenu, loadTab } from './helpers';
|
||||
import { doCachedLogin } from './login';
|
||||
|
||||
/**
|
||||
@@ -29,10 +29,10 @@ test('Permissions - Admin', async ({ browser, request }) => {
|
||||
await page.getByRole('button', { name: 'Cancel' }).click();
|
||||
|
||||
// Change password
|
||||
await page.getByRole('cell', { name: 'Ian', exact: true }).click({
|
||||
button: 'right'
|
||||
});
|
||||
await page.getByRole('button', { name: 'Change Password' }).click();
|
||||
await clickOnRowMenu(
|
||||
await page.getByRole('cell', { name: 'Ian', exact: true })
|
||||
);
|
||||
await page.getByRole('menuitem', { name: 'Change Password' }).click();
|
||||
await page.getByLabel('text-field-password').fill('123');
|
||||
await page.getByRole('button', { name: 'Submit' }).click();
|
||||
await page.getByText("['This password is too short").waitFor();
|
||||
@@ -46,10 +46,10 @@ test('Permissions - Admin', async ({ browser, request }) => {
|
||||
await page.getByText('Password updated').click();
|
||||
|
||||
// Open profile
|
||||
await page.getByRole('cell', { name: 'Ian', exact: true }).click({
|
||||
button: 'right'
|
||||
});
|
||||
await page.getByRole('button', { name: 'Open Profile' }).click();
|
||||
await clickOnRowMenu(
|
||||
await page.getByRole('cell', { name: 'Ian', exact: true })
|
||||
);
|
||||
await page.getByRole('menuitem', { name: 'Open Profile' }).click();
|
||||
await page.getByText('User: ian', { exact: true }).click();
|
||||
});
|
||||
|
||||
|
@@ -197,17 +197,19 @@ test('Settings - Admin - Barcode History', async ({ browser, request }) => {
|
||||
// Scan some barcodes (via API calls)
|
||||
const barcodes = ['ABC1234', 'XYZ5678', 'QRS9012'];
|
||||
|
||||
barcodes.forEach(async (barcode) => {
|
||||
for (let i = 0; i < barcodes.length; i++) {
|
||||
const barcode = barcodes[i];
|
||||
const url = new URL('barcode/', apiUrl).toString();
|
||||
await request.post(url, {
|
||||
data: {
|
||||
barcode: barcode
|
||||
},
|
||||
timeout: 5000,
|
||||
headers: {
|
||||
Authorization: `Basic ${btoa('admin:inventree')}`
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
await page.getByRole('button', { name: 'admin' }).click();
|
||||
await page.getByRole('menuitem', { name: 'Admin Center' }).click();
|
||||
|
Reference in New Issue
Block a user