mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-05 05:00:58 +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:
@ -1,6 +1,6 @@
|
||||
import { expect, test } from './baseFixtures.js';
|
||||
import { apiUrl } from './defaults.js';
|
||||
import { getRowFromCell, navigate } from './helpers.js';
|
||||
import { getRowFromCell, loadTab, navigate } from './helpers.js';
|
||||
import { doQuickLogin } from './login.js';
|
||||
import { setSettingState } from './settings.js';
|
||||
|
||||
@ -49,47 +49,47 @@ test('Settings - Admin', async ({ page }) => {
|
||||
// User settings
|
||||
await page.getByRole('button', { name: 'admin' }).click();
|
||||
await page.getByRole('menuitem', { name: 'Account settings' }).click();
|
||||
await page.getByRole('tab', { name: 'Security' }).click();
|
||||
await loadTab(page, 'Security');
|
||||
|
||||
await page.getByRole('tab', { name: 'Display Options' }).click();
|
||||
await loadTab(page, 'Display Options');
|
||||
await page.getByText('Date Format').waitFor();
|
||||
await page.getByRole('tab', { name: 'Search' }).click();
|
||||
await loadTab(page, 'Search');
|
||||
await page.getByText('Regex Search').waitFor();
|
||||
await page.getByRole('tab', { name: 'Notifications' }).click();
|
||||
await page.getByRole('tab', { name: 'Reporting' }).click();
|
||||
await loadTab(page, 'Notifications');
|
||||
await loadTab(page, 'Reporting');
|
||||
await page.getByText('Inline report display').waitFor();
|
||||
|
||||
// System Settings
|
||||
await page.locator('label').filter({ hasText: 'System Settings' }).click();
|
||||
await page.getByText('Base URL', { exact: true }).waitFor();
|
||||
await page.getByRole('tab', { name: 'Login' }).click();
|
||||
await page.getByRole('tab', { name: 'Barcodes' }).click();
|
||||
await page.getByRole('tab', { name: 'Notifications' }).click();
|
||||
await page.getByRole('tab', { name: 'Pricing' }).click();
|
||||
await page.getByRole('tab', { name: 'Labels' }).click();
|
||||
await page.getByRole('tab', { name: 'Reporting' }).click();
|
||||
await loadTab(page, 'Login');
|
||||
await loadTab(page, 'Barcodes');
|
||||
await loadTab(page, 'Notifications');
|
||||
await loadTab(page, 'Pricing');
|
||||
await loadTab(page, 'Labels');
|
||||
await loadTab(page, 'Reporting');
|
||||
|
||||
await page.getByRole('tab', { name: 'Build Orders' }).click();
|
||||
await page.getByRole('tab', { name: 'Purchase Orders' }).click();
|
||||
await page.getByRole('tab', { name: 'Sales Orders' }).click();
|
||||
await page.getByRole('tab', { name: 'Return Orders' }).click();
|
||||
await loadTab(page, 'Build Orders');
|
||||
await loadTab(page, 'Purchase Orders');
|
||||
await loadTab(page, 'Sales Orders');
|
||||
await loadTab(page, 'Return Orders');
|
||||
|
||||
// Admin Center
|
||||
await page.getByRole('button', { name: 'admin' }).click();
|
||||
await page.getByRole('menuitem', { name: 'Admin Center' }).click();
|
||||
await page.getByRole('tab', { name: 'Background Tasks' }).click();
|
||||
await page.getByRole('tab', { name: 'Error Reports' }).click();
|
||||
await page.getByRole('tab', { name: 'Currencies' }).click();
|
||||
await page.getByRole('tab', { name: 'Project Codes' }).click();
|
||||
await page.getByRole('tab', { name: 'Custom Units' }).click();
|
||||
await page.getByRole('tab', { name: 'Part Parameters' }).click();
|
||||
await page.getByRole('tab', { name: 'Category Parameters' }).click();
|
||||
await page.getByRole('tab', { name: 'Label Templates' }).click();
|
||||
await page.getByRole('tab', { name: 'Report Templates' }).click();
|
||||
await page.getByRole('tab', { name: 'Plugins' }).click();
|
||||
await loadTab(page, 'Background Tasks');
|
||||
await loadTab(page, 'Error Reports');
|
||||
await loadTab(page, 'Currencies');
|
||||
await loadTab(page, 'Project Codes');
|
||||
await loadTab(page, 'Custom Units');
|
||||
await loadTab(page, 'Part Parameters');
|
||||
await loadTab(page, 'Category Parameters');
|
||||
await loadTab(page, 'Label Templates');
|
||||
await loadTab(page, 'Report Templates');
|
||||
await loadTab(page, 'Plugins');
|
||||
|
||||
// Adjust some "location type" items
|
||||
await page.getByRole('tab', { name: 'Location Types' }).click();
|
||||
await loadTab(page, 'Location Types');
|
||||
|
||||
// Edit first item ('Room')
|
||||
const roomCell = await page.getByRole('cell', { name: 'Room', exact: true });
|
||||
@ -166,7 +166,7 @@ test('Settings - Admin - Barcode History', async ({ page, request }) => {
|
||||
|
||||
await page.getByRole('button', { name: 'admin' }).click();
|
||||
await page.getByRole('menuitem', { name: 'Admin Center' }).click();
|
||||
await page.getByRole('tab', { name: 'Barcode Scans' }).click();
|
||||
await loadTab(page, 'Barcode Scans');
|
||||
|
||||
await page.waitForTimeout(500);
|
||||
|
||||
@ -193,8 +193,8 @@ test('Settings - Admin - Unauthorized', async ({ page }) => {
|
||||
await navigate(page, 'settings/user/');
|
||||
await page.waitForURL('**/settings/user/**');
|
||||
|
||||
await page.getByRole('tab', { name: 'Display Options' }).click();
|
||||
await page.getByRole('tab', { name: 'Account' }).click();
|
||||
await loadTab(page, 'Display Options');
|
||||
await loadTab(page, 'Account');
|
||||
|
||||
// Try to access global settings page
|
||||
await navigate(page, 'settings/system/');
|
||||
@ -205,3 +205,25 @@ test('Settings - Admin - Unauthorized', async ({ page }) => {
|
||||
.getByRole('button', { name: 'Return to the index page' })
|
||||
.waitFor();
|
||||
});
|
||||
|
||||
// Test for user auth configuration
|
||||
test('Settings - Auth - Email', async ({ page }) => {
|
||||
await doQuickLogin(page, 'allaccess', 'nolimits');
|
||||
await navigate(page, 'settings/user/');
|
||||
|
||||
await loadTab(page, 'Security');
|
||||
|
||||
await page.getByText('Currently no email addresses are registered').waitFor();
|
||||
await page.getByLabel('email-address-input').fill('test-email@domain.org');
|
||||
await page.getByLabel('email-address-submit').click();
|
||||
|
||||
await page.getByText('Unverified', { exact: true }).waitFor();
|
||||
await page.getByLabel('test-email@domain.').click();
|
||||
await page.getByRole('button', { name: 'Make Primary' }).click();
|
||||
await page.getByText('Primary', { exact: true }).waitFor();
|
||||
await page.getByRole('button', { name: 'Remove' }).click();
|
||||
|
||||
await page.getByText('Currently no email addresses are registered').waitFor();
|
||||
|
||||
await page.waitForTimeout(2500);
|
||||
});
|
||||
|
Reference in New Issue
Block a user