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

UI cleanup (#9140)

* Refactor SecurityContext page:

- Add Accordion to separate different groups
- Fix "make primary" button (requires PATCH)
- Responsive grid design

* Add splash screen background to more pages

* Adds playwright testing for email setup

* Refactoring

* Fix playwright tests
This commit is contained in:
Oliver
2025-02-22 17:13:12 +11:00
committed by GitHub
parent 44cca7ddf2
commit e447e4037b
16 changed files with 517 additions and 430 deletions

View File

@ -2,6 +2,7 @@ import { test } from '../baseFixtures.ts';
import {
clearTableFilters,
getRowFromCell,
loadTab,
navigate,
setTableChoiceFilter
} from '../helpers.ts';
@ -12,7 +13,7 @@ test('Build Order - Basic Tests', async ({ page }) => {
// Navigate to the correct build order
await page.getByRole('tab', { name: 'Manufacturing', exact: true }).click();
await page.getByRole('tab', { name: 'Build Orders', exact: true }).click();
await loadTab(page, 'Build Orders');
await clearTableFilters(page);
@ -57,11 +58,11 @@ test('Build Order - Basic Tests', async ({ page }) => {
await page.getByRole('button', { name: 'Cancel' }).click();
// Click on some tabs
await page.getByRole('tab', { name: 'Attachments' }).click();
await page.getByRole('tab', { name: 'Notes' }).click();
await page.getByRole('tab', { name: 'Incomplete Outputs' }).click();
await page.getByRole('tab', { name: 'Line Items' }).click();
await page.getByRole('tab', { name: 'Allocated Stock' }).click();
await loadTab(page, 'Attachments');
await loadTab(page, 'Notes');
await loadTab(page, 'Incomplete Outputs');
await loadTab(page, 'Line Items');
await loadTab(page, 'Allocated Stock');
// Check for expected text in the table
await page.getByText('R_10R_0402_1%').waitFor();
@ -70,7 +71,7 @@ test('Build Order - Basic Tests', async ({ page }) => {
.waitFor();
// Check "test results"
await page.getByRole('tab', { name: 'Test Results' }).click();
await loadTab(page, 'Test Results');
await page.getByText('Quantity: 25').waitFor();
await page.getByText('Continuity Checks').waitFor();
await page
@ -80,7 +81,7 @@ test('Build Order - Basic Tests', async ({ page }) => {
await page.getByText('Add Test Result').waitFor();
// Click through to the "parent" build
await page.getByRole('tab', { name: 'Build Details' }).click();
await loadTab(page, 'Build Details');
await page.getByRole('link', { name: 'BO0010' }).click();
await page
.getByLabel('Build Details')
@ -119,7 +120,7 @@ test('Build Order - Build Outputs', async ({ page }) => {
await doQuickLogin(page);
await navigate(page, 'manufacturing/index/');
await page.getByRole('tab', { name: 'Build Orders', exact: true }).click();
await loadTab(page, 'Build Orders');
await clearTableFilters(page);
@ -128,7 +129,7 @@ test('Build Order - Build Outputs', async ({ page }) => {
await page.getByText('Pending').first().waitFor();
await page.getByRole('cell', { name: 'BO0011' }).click();
await page.getByRole('tab', { name: 'Incomplete Outputs' }).click();
await loadTab(page, 'Incomplete Outputs');
// Create a new build output
await page.getByLabel('action-button-add-build-output').click();
@ -213,7 +214,7 @@ test('Build Order - Allocation', async ({ page }) => {
await page.getByRole('cell', { name: 'Reel Storage', exact: true }).waitFor();
// Navigate to the "Incomplete Outputs" tab
await page.getByRole('tab', { name: 'Incomplete Outputs' }).click();
await loadTab(page, 'Incomplete Outputs');
// Find output #7
const output7 = await page

View File

@ -1,5 +1,5 @@
import { test } from '../baseFixtures.js';
import { navigate } from '../helpers.js';
import { loadTab, navigate } from '../helpers.js';
import { doQuickLogin } from '../login.js';
test('Company', async ({ page }) => {
@ -8,23 +8,23 @@ test('Company', async ({ page }) => {
await navigate(page, 'company/1/details');
await page.getByLabel('Details').getByText('DigiKey Electronics').waitFor();
await page.getByRole('cell', { name: 'https://www.digikey.com/' }).waitFor();
await page.getByRole('tab', { name: 'Supplied Parts' }).click();
await loadTab(page, 'Supplied Parts');
await page
.getByRole('cell', { name: 'RR05P100KDTR-ND', exact: true })
.waitFor();
await page.getByRole('tab', { name: 'Purchase Orders' }).click();
await loadTab(page, 'Purchase Orders');
await page.getByRole('cell', { name: 'Molex connectors' }).first().waitFor();
await page.getByRole('tab', { name: 'Stock Items' }).click();
await loadTab(page, 'Stock Items');
await page
.getByRole('cell', { name: 'Blue plastic enclosure' })
.first()
.waitFor();
await page.getByRole('tab', { name: 'Contacts' }).click();
await loadTab(page, 'Contacts');
await page.getByRole('cell', { name: 'jimmy.mcleod@digikey.com' }).waitFor();
await page.getByRole('tab', { name: 'Addresses' }).click();
await loadTab(page, 'Addresses');
await page.getByRole('cell', { name: 'Carla Tunnel' }).waitFor();
await page.getByRole('tab', { name: 'Attachments' }).click();
await page.getByRole('tab', { name: 'Notes' }).click();
await loadTab(page, 'Attachments');
await loadTab(page, 'Notes');
// Let's edit the company details
await page.getByLabel('action-menu-company-actions').click();

View File

@ -1,5 +1,10 @@
import { test } from '../baseFixtures';
import { clearTableFilters, getRowFromCell, navigate } from '../helpers';
import {
clearTableFilters,
getRowFromCell,
loadTab,
navigate
} from '../helpers';
import { doQuickLogin } from '../login';
/**
@ -19,35 +24,35 @@ test('Parts - Tabs', async ({ page }) => {
await page.getByPlaceholder('Search').fill('1551');
await page.getByText('1551ABK').click();
await page.getByRole('tab', { name: 'Allocations' }).click();
await page.getByRole('tab', { name: 'Used In' }).click();
await page.getByRole('tab', { name: 'Pricing' }).click();
await page.getByRole('tab', { name: 'Suppliers' }).click();
await page.getByRole('tab', { name: 'Purchase Orders' }).click();
await page.getByRole('tab', { name: 'Scheduling' }).click();
await page.getByRole('tab', { name: 'Stock History' }).click();
await page.getByRole('tab', { name: 'Attachments' }).click();
await page.getByRole('tab', { name: 'Notes' }).click();
await page.getByRole('tab', { name: 'Related Parts' }).click();
await loadTab(page, 'Allocations');
await loadTab(page, 'Used In');
await loadTab(page, 'Pricing');
await loadTab(page, 'Suppliers');
await loadTab(page, 'Purchase Orders');
await loadTab(page, 'Scheduling');
await loadTab(page, 'Stock History');
await loadTab(page, 'Attachments');
await loadTab(page, 'Notes');
await loadTab(page, 'Related Parts');
// Related Parts
await page.getByText('1551ACLR').click();
await page.getByRole('tab', { name: 'Part Details' }).click();
await page.getByRole('tab', { name: 'Parameters' }).click();
await loadTab(page, 'Part Details');
await loadTab(page, 'Parameters');
await page
.getByLabel('panel-tabs-part')
.getByRole('tab', { name: 'Stock', exact: true })
.click();
await page.getByRole('tab', { name: 'Allocations' }).click();
await page.getByRole('tab', { name: 'Used In' }).click();
await page.getByRole('tab', { name: 'Pricing' }).click();
await loadTab(page, 'Allocations');
await loadTab(page, 'Used In');
await loadTab(page, 'Pricing');
await navigate(page, 'part/category/index/parts');
await page.getByText('Blue Chair').click();
await page.getByRole('tab', { name: 'Bill of Materials' }).click();
await page.getByRole('tab', { name: 'Build Orders' }).click();
await loadTab(page, 'Bill of Materials');
await loadTab(page, 'Build Orders');
});
test('Parts - Manufacturer Parts', async ({ page }) => {
@ -55,11 +60,11 @@ test('Parts - Manufacturer Parts', async ({ page }) => {
await navigate(page, 'part/84/suppliers');
await page.getByRole('tab', { name: 'Suppliers' }).click();
await loadTab(page, 'Suppliers');
await page.getByText('Hammond Manufacturing').click();
await page.getByRole('tab', { name: 'Parameters' }).click();
await page.getByRole('tab', { name: 'Suppliers' }).click();
await page.getByRole('tab', { name: 'Attachments' }).click();
await loadTab(page, 'Parameters');
await loadTab(page, 'Suppliers');
await loadTab(page, 'Attachments');
await page.getByText('1551ACLR - 1551ACLR').waitFor();
});
@ -68,11 +73,11 @@ test('Parts - Supplier Parts', async ({ page }) => {
await navigate(page, 'part/15/suppliers');
await page.getByRole('tab', { name: 'Suppliers' }).click();
await loadTab(page, 'Suppliers');
await page.getByRole('cell', { name: 'DIG-84670-SJI' }).click();
await page.getByRole('tab', { name: 'Received Stock' }).click(); //
await page.getByRole('tab', { name: 'Purchase Orders' }).click();
await page.getByRole('tab', { name: 'Pricing' }).click();
await loadTab(page, 'Received Stock'); //
await loadTab(page, 'Purchase Orders');
await loadTab(page, 'Pricing');
await page.getByText('DIG-84670-SJI - R_550R_0805_1%').waitFor();
});
@ -81,14 +86,14 @@ test('Parts - Locking', async ({ page }) => {
// Navigate to a known assembly which is *not* locked
await navigate(page, 'part/104/bom');
await page.getByRole('tab', { name: 'Bill of Materials' }).click();
await loadTab(page, 'Bill of Materials');
await page.getByLabel('action-button-add-bom-item').waitFor();
await page.getByRole('tab', { name: 'Parameters' }).click();
await loadTab(page, 'Parameters');
await page.getByLabel('action-button-add-parameter').waitFor();
// Navigate to a known assembly which *is* locked
await navigate(page, 'part/100/bom');
await page.getByRole('tab', { name: 'Bill of Materials' }).click();
await loadTab(page, 'Bill of Materials');
await page.getByLabel('part-lock-icon').waitFor();
await page.getByText('Part is Locked', { exact: true }).waitFor();
@ -98,7 +103,7 @@ test('Parts - Locking', async ({ page }) => {
await page.getByText('In Production: 50').waitFor();
// Check the "parameters" tab also
await page.getByRole('tab', { name: 'Parameters' }).click();
await loadTab(page, 'Parameters');
await page.getByText('Part parameters cannot be').waitFor();
});
@ -107,7 +112,7 @@ test('Parts - Allocations', async ({ page }) => {
// Let's look at the allocations for a single stock item
await navigate(page, 'stock/item/324/');
await page.getByRole('tab', { name: 'Allocations' }).click();
await loadTab(page, 'Allocations');
await page.getByRole('button', { name: 'Build Order Allocations' }).waitFor();
await page.getByRole('cell', { name: 'Making some blue chairs' }).waitFor();
@ -124,7 +129,7 @@ test('Parts - Allocations', async ({ page }) => {
await page.waitForTimeout(500);
await page.waitForLoadState('networkidle');
await page.getByRole('tab', { name: 'Allocations' }).click();
await loadTab(page, 'Allocations');
await page.getByRole('button', { name: 'Build Order Allocations' }).waitFor();
await page.getByRole('button', { name: 'Sales Order Allocations' }).waitFor();
@ -177,7 +182,7 @@ test('Parts - Pricing (Nothing, BOM)', async ({ page }) => {
await navigate(page, 'part/82/pricing');
await page.getByText('Small plastic enclosure, black').waitFor();
await page.getByRole('tab', { name: 'Part Pricing' }).click();
await loadTab(page, 'Part Pricing');
await page.getByLabel('Part Pricing').getByText('Part Pricing').waitFor();
await page.getByRole('button', { name: 'Pricing Overview' }).waitFor();
await page.getByText('Last Updated').waitFor();
@ -188,7 +193,7 @@ test('Parts - Pricing (Nothing, BOM)', async ({ page }) => {
// Part with history
await navigate(page, 'part/108/pricing');
await page.getByText('A chair - with blue paint').waitFor();
await page.getByRole('tab', { name: 'Part Pricing' }).click();
await loadTab(page, 'Part Pricing');
await page.getByLabel('Part Pricing').getByText('Part Pricing').waitFor();
await page.getByRole('button', { name: 'Pricing Overview' }).waitFor();
await page.getByText('Last Updated').waitFor();
@ -226,7 +231,7 @@ test('Parts - Pricing (Supplier)', async ({ page }) => {
// Part
await navigate(page, 'part/55/pricing');
await page.getByText('Ceramic capacitor, 100nF in').waitFor();
await page.getByRole('tab', { name: 'Part Pricing' }).click();
await loadTab(page, 'Part Pricing');
await page.getByLabel('Part Pricing').getByText('Part Pricing').waitFor();
await page.getByRole('button', { name: 'Pricing Overview' }).waitFor();
await page.getByText('Last Updated').waitFor();
@ -252,7 +257,7 @@ test('Parts - Pricing (Variant)', async ({ page }) => {
// Part
await navigate(page, 'part/106/pricing');
await page.getByText('A chair - available in multiple colors').waitFor();
await page.getByRole('tab', { name: 'Part Pricing' }).click();
await loadTab(page, 'Part Pricing');
await page.getByLabel('Part Pricing').getByText('Part Pricing').waitFor();
await page.getByRole('button', { name: 'Pricing Overview' }).waitFor();
await page.getByText('Last Updated').waitFor();
@ -278,7 +283,7 @@ test('Parts - Pricing (Internal)', async ({ page }) => {
// Part
await navigate(page, 'part/65/pricing');
await page.getByText('Socket head cap screw, M2').waitFor();
await page.getByRole('tab', { name: 'Part Pricing' }).click();
await loadTab(page, 'Part Pricing');
await page.getByLabel('Part Pricing').getByText('Part Pricing').waitFor();
await page.getByRole('button', { name: 'Pricing Overview' }).waitFor();
await page.getByText('Last Updated').waitFor();
@ -303,7 +308,7 @@ test('Parts - Pricing (Purchase)', async ({ page }) => {
// Part
await navigate(page, 'part/69/pricing');
await page.getByText('1.25mm Pitch, PicoBlade PCB').waitFor();
await page.getByRole('tab', { name: 'Part Pricing' }).click();
await loadTab(page, 'Part Pricing');
await page.getByLabel('Part Pricing').getByText('Part Pricing').waitFor();
await page.getByRole('button', { name: 'Pricing Overview' }).waitFor();
await page.getByText('Last Updated').waitFor();

View File

@ -3,6 +3,7 @@ import {
clearTableFilters,
clickButtonIfVisible,
clickOnRowMenu,
loadTab,
navigate,
openFilterDrawer,
setTableChoiceFilter
@ -13,7 +14,7 @@ test('Purchase Orders - List', async ({ page }) => {
await doQuickLogin(page);
await page.getByRole('tab', { name: 'Purchasing' }).click();
await page.getByRole('tab', { name: 'Purchase Orders' }).click();
await loadTab(page, 'Purchase Orders');
await clearTableFilters(page);
@ -101,29 +102,32 @@ test('Purchase Orders - General', async ({ page }) => {
await doQuickLogin(page);
await page.getByRole('tab', { name: 'Purchasing' }).click();
await page.getByRole('cell', { name: 'PO0012' }).click();
await page.waitForTimeout(200);
await page.getByRole('tab', { name: 'Line Items' }).click();
await page.getByRole('tab', { name: 'Received Stock' }).click();
await page.getByRole('tab', { name: 'Attachments' }).click();
await loadTab(page, 'Line Items');
await loadTab(page, 'Received Stock');
await loadTab(page, 'Attachments');
await page.getByRole('tab', { name: 'Purchasing' }).click();
await page.getByRole('tab', { name: 'Suppliers' }).click();
await loadTab(page, 'Suppliers');
await page.getByText('Arrow', { exact: true }).click();
await page.waitForTimeout(200);
await page.getByRole('tab', { name: 'Supplied Parts' }).click();
await page.getByRole('tab', { name: 'Purchase Orders' }).click();
await page.getByRole('tab', { name: 'Stock Items' }).click();
await page.getByRole('tab', { name: 'Contacts' }).click();
await page.getByRole('tab', { name: 'Addresses' }).click();
await page.getByRole('tab', { name: 'Attachments' }).click();
await loadTab(page, 'Supplied Parts');
await loadTab(page, 'Purchase Orders');
await loadTab(page, 'Stock Items');
await loadTab(page, 'Contacts');
await loadTab(page, 'Addresses');
await loadTab(page, 'Attachments');
await page.getByRole('tab', { name: 'Purchasing' }).click();
await page.getByRole('tab', { name: 'Manufacturers' }).click();
await loadTab(page, 'Manufacturers');
await page.getByText('AVX Corporation').click();
await page.waitForTimeout(200);
await page.getByRole('tab', { name: 'Addresses' }).click();
await loadTab(page, 'Addresses');
await page.getByRole('cell', { name: 'West Branch' }).click();
await page.locator('.mantine-ScrollArea-root').click();
await page
@ -151,7 +155,7 @@ test('Purchase Orders - Filters', async ({ page }) => {
await doQuickLogin(page, 'reader', 'readonly');
await page.getByRole('tab', { name: 'Purchasing' }).click();
await page.getByRole('tab', { name: 'Purchase Orders' }).click();
await loadTab(page, 'Purchase Orders');
// Open filters drawer
await openFilterDrawer(page);
@ -197,7 +201,7 @@ test('Purchase Orders - Order Parts', async ({ page }) => {
// Open "Order Parts" wizard from the "Stock Items" table
await page.getByRole('tab', { name: 'Stock' }).click();
await page.getByRole('tab', { name: 'Stock Items' }).click();
await loadTab(page, 'Stock Items');
// Select multiple stock items
for (let ii = 2; ii < 7; ii += 2) {
@ -257,10 +261,10 @@ test('Purchase Orders - Receive Items', async ({ page }) => {
await page.getByRole('tab', { name: 'Purchasing' }).click();
await page.getByRole('cell', { name: 'PO0014' }).click();
await page.getByRole('tab', { name: 'Order Details' }).click();
await loadTab(page, 'Order Details');
// Select all line items to receive
await page.getByRole('tab', { name: 'Line Items' }).click();
await loadTab(page, 'Line Items');
await page.getByLabel('Select all records').click();
await page.waitForTimeout(200);
@ -311,7 +315,7 @@ test('Purchase Orders - Receive Items', async ({ page }) => {
await page.getByRole('button', { name: 'Submit' }).click();
await page.getByText('Items received').waitFor();
await page.getByRole('tab', { name: 'Received Stock' }).click();
await loadTab(page, 'Received Stock');
await clearTableFilters(page);
await page.getByRole('cell', { name: 'my-batch-code' }).first().waitFor();

View File

@ -2,6 +2,7 @@ import { test } from '../baseFixtures.ts';
import {
clearTableFilters,
globalSearch,
loadTab,
navigate,
setTableChoiceFilter
} from '../helpers.ts';
@ -13,27 +14,27 @@ test('Sales Orders - Tabs', async ({ page }) => {
await navigate(page, 'sales/index/');
await page.waitForURL('**/platform/sales/**');
await page.getByRole('tab', { name: 'Sales Orders' }).click();
await loadTab(page, 'Sales Orders');
await page.waitForURL('**/platform/sales/index/salesorders');
await page.getByRole('tab', { name: 'Return Orders' }).click();
await loadTab(page, 'Return Orders');
// Customers
await page.getByRole('tab', { name: 'Customers' }).click();
await loadTab(page, 'Customers');
await page.getByText('Customer A').click();
await page.getByRole('tab', { name: 'Notes' }).click();
await page.getByRole('tab', { name: 'Attachments' }).click();
await page.getByRole('tab', { name: 'Contacts' }).click();
await page.getByRole('tab', { name: 'Assigned Stock' }).click();
await page.getByRole('tab', { name: 'Return Orders' }).click();
await page.getByRole('tab', { name: 'Sales Orders' }).click();
await page.getByRole('tab', { name: 'Contacts' }).click();
await loadTab(page, 'Notes');
await loadTab(page, 'Attachments');
await loadTab(page, 'Contacts');
await loadTab(page, 'Assigned Stock');
await loadTab(page, 'Return Orders');
await loadTab(page, 'Sales Orders');
await loadTab(page, 'Contacts');
await page.getByRole('cell', { name: 'Dorathy Gross' }).waitFor();
await page
.getByRole('row', { name: 'Dorathy Gross dorathy.gross@customer.com' })
.waitFor();
// Sales Order Details
await page.getByRole('tab', { name: 'Sales Orders' }).click();
await loadTab(page, 'Sales Orders');
await clearTableFilters(page);
@ -42,30 +43,30 @@ test('Sales Orders - Tabs', async ({ page }) => {
.getByLabel('Order Details')
.getByText('Selling some stuff')
.waitFor();
await page.getByRole('tab', { name: 'Line Items' }).click();
await page.getByRole('tab', { name: 'Shipments' }).click();
await page.getByRole('tab', { name: 'Build Orders' }).click();
await loadTab(page, 'Line Items');
await loadTab(page, 'Shipments');
await loadTab(page, 'Build Orders');
await page.getByText('No records found').first().waitFor();
await page.getByRole('tab', { name: 'Attachments' }).click();
await loadTab(page, 'Attachments');
await page.getByText('No attachments found').first().waitFor();
await page.getByRole('tab', { name: 'Notes' }).click();
await page.getByRole('tab', { name: 'Order Details' }).click();
await loadTab(page, 'Notes');
await loadTab(page, 'Order Details');
// Return Order Details
await page.getByRole('link', { name: 'Customer A' }).click();
await page.getByRole('tab', { name: 'Return Orders' }).click();
await loadTab(page, 'Return Orders');
await page.getByRole('cell', { name: 'RMA-' }).click();
await page.getByText('RMA-0001', { exact: true }).waitFor();
await page.getByRole('tab', { name: 'Line Items' }).click();
await page.getByRole('tab', { name: 'Attachments' }).click();
await page.getByRole('tab', { name: 'Notes' }).click();
await loadTab(page, 'Line Items');
await loadTab(page, 'Attachments');
await loadTab(page, 'Notes');
});
test('Sales Orders - Basic Tests', async ({ page }) => {
await doQuickLogin(page);
await page.getByRole('tab', { name: 'Sales' }).click();
await page.getByRole('tab', { name: 'Sales Orders' }).click();
await loadTab(page, 'Sales Orders');
await clearTableFilters(page);
@ -104,12 +105,12 @@ test('Sales Orders - Shipments', async ({ page }) => {
await doQuickLogin(page);
await page.getByRole('tab', { name: 'Sales' }).click();
await page.getByRole('tab', { name: 'Sales Orders' }).click();
await loadTab(page, 'Sales Orders');
await clearTableFilters(page);
// Click through to a particular sales order
await page.getByRole('cell', { name: 'SO0006' }).first().click();
await page.getByRole('tab', { name: 'Shipments' }).click();
await loadTab(page, 'Shipments');
// Create a new shipment
await page.getByLabel('action-button-add-shipment').click();
@ -155,14 +156,14 @@ test('Sales Orders - Shipments', async ({ page }) => {
await page.getByRole('menuitem', { name: 'View Shipment' }).click();
// Click through the various tabs
await page.getByRole('tab', { name: 'Attachments' }).click();
await page.getByRole('tab', { name: 'Notes' }).click();
await page.getByRole('tab', { name: 'Allocated Stock' }).click();
await loadTab(page, 'Attachments');
await loadTab(page, 'Notes');
await loadTab(page, 'Allocated Stock');
// Ensure assigned items table loads correctly
await page.getByRole('cell', { name: 'BATCH-001' }).first().waitFor();
await page.getByRole('tab', { name: 'Shipment Details' }).click();
await loadTab(page, 'Shipment Details');
// The "new" tracking number should be visible
await page.getByText(tracking_number).waitFor();
@ -171,7 +172,7 @@ test('Sales Orders - Shipments', async ({ page }) => {
await page.getByRole('link', { name: 'SO0006' }).click();
// Let's try to allocate some stock
await page.getByRole('tab', { name: 'Line Items' }).click();
await loadTab(page, 'Line Items');
await page.getByLabel('row-action-menu-1').click();
await page.getByRole('menuitem', { name: 'Allocate stock' }).click();
await page

View File

@ -2,6 +2,7 @@ import { test } from '../baseFixtures.js';
import {
clearTableFilters,
clickButtonIfVisible,
loadTab,
navigate,
openFilterDrawer,
setTableChoiceFilter
@ -14,28 +15,28 @@ test('Stock - Basic Tests', async ({ page }) => {
await navigate(page, 'stock/location/index/');
await page.waitForURL('**/platform/stock/location/**');
await page.getByRole('tab', { name: 'Location Details' }).click();
await loadTab(page, 'Location Details');
await page.waitForURL('**/platform/stock/location/index/details');
await page.getByRole('tab', { name: 'Stock Items' }).click();
await loadTab(page, 'Stock Items');
await page.getByText('1551ABK').first().click();
await page.getByRole('tab', { name: 'Stock', exact: true }).click();
await page.waitForURL('**/platform/stock/**');
await page.getByRole('tab', { name: 'Stock Locations' }).click();
await loadTab(page, 'Stock Locations');
await page.getByRole('cell', { name: 'Electronics Lab' }).first().click();
await page.getByRole('tab', { name: 'Default Parts' }).click();
await page.getByRole('tab', { name: 'Stock Locations' }).click();
await page.getByRole('tab', { name: 'Stock Items' }).click();
await page.getByRole('tab', { name: 'Location Details' }).click();
await loadTab(page, 'Default Parts');
await loadTab(page, 'Stock Locations');
await loadTab(page, 'Stock Items');
await loadTab(page, 'Location Details');
await navigate(page, 'stock/item/1194/details');
await page.getByText('D.123 | Doohickey').waitFor();
await page.getByText('Batch Code: BX-123-2024-2-7').waitFor();
await page.getByRole('tab', { name: 'Stock Tracking' }).click();
await page.getByRole('tab', { name: 'Test Data' }).click();
await loadTab(page, 'Stock Tracking');
await loadTab(page, 'Test Data');
await page.getByText('395c6d5586e5fb656901d047be27e1f7').waitFor();
await page.getByRole('tab', { name: 'Installed Items' }).click();
await loadTab(page, 'Installed Items');
});
test('Stock - Location Tree', async ({ page }) => {
@ -43,7 +44,7 @@ test('Stock - Location Tree', async ({ page }) => {
await navigate(page, 'stock/location/index/');
await page.waitForURL('**/platform/stock/location/**');
await page.getByRole('tab', { name: 'Location Details' }).click();
await loadTab(page, 'Location Details');
await page.getByLabel('nav-breadcrumb-action').click();
await page.getByLabel('nav-tree-toggle-1}').click();
@ -59,7 +60,7 @@ test('Stock - Filters', async ({ page }) => {
await doQuickLogin(page, 'steven', 'wizardstaff');
await navigate(page, 'stock/location/index/');
await page.getByRole('tab', { name: 'Stock Items' }).click();
await loadTab(page, 'Stock Items');
await openFilterDrawer(page);
await clickButtonIfVisible(page, 'Clear Filters');
@ -238,7 +239,7 @@ test('Stock - Tracking', async ({ page }) => {
await page.getByRole('link', { name: 'Widget Assembly # 2' }).waitFor();
// Navigate to the "stock tracking" tab
await page.getByRole('tab', { name: 'Stock Tracking' }).click();
await loadTab(page, 'Stock Tracking');
await page.getByText('- - Factory/Office Block/Room').first().waitFor();
await page.getByRole('link', { name: 'Widget Assembly' }).waitFor();
await page.getByRole('cell', { name: 'Installed into assembly' }).waitFor();