2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-13 08:21:26 +00:00

[Refactor] Serial generation (#8246)

* Refactor "update_serial_number" method

* Refactor serial number validation

- Query is much more efficient now
- Does not have to check each serial number individually
- Makes use of existing Part class method

* Refactor creation of multiple stock items

* Fix for singular item creation

* Refactor serializeStock method:

- Push "rebuild tree" to background worker
- Use bulk_create actions

* Refactor createion of serialized build outputs

* Prevent 1+N DB hits

* Cleanup

* Cleanup

* Reinstate serial number checks

* Add limit for serial number extraction

* Fix cache config

* Revert cache settings

* Fix for unit tests

* Playwright tests

* Bug fix

* Force False cookie mode in testing

* Revert aria-label for PanelGroup items

- No longer works as expected with playwright locators

* Fix playwright vtest

* Further updates

* Playwright test adjustments

* Remove duplicate locator
This commit is contained in:
Oliver
2024-10-12 10:08:57 +11:00
committed by GitHub
parent f77c8a5b5b
commit 7443d21854
21 changed files with 527 additions and 307 deletions

View File

@ -15,7 +15,7 @@ test('Quick Command', async ({ page }) => {
await page.waitForURL('**/platform/dashboard');
// Open Spotlight with Button
await page.getByRole('button', { name: 'Open spotlight' }).click();
await page.getByLabel('open-spotlight').click();
await page.getByRole('button', { name: 'Home Go to the home page' }).click();
await page
.getByRole('heading', { name: 'Welcome to your Dashboard,' })
@ -35,7 +35,7 @@ test('Quick Command - No Keys', async ({ page }) => {
await doQuickLogin(page);
// Open Spotlight with Button
await page.getByRole('button', { name: 'Open spotlight' }).click();
await page.getByLabel('open-spotlight').click();
await page.getByRole('button', { name: 'Home Go to the home page' }).click();
await page
.getByRole('heading', { name: 'Welcome to your Dashboard,' })
@ -43,7 +43,7 @@ test('Quick Command - No Keys', async ({ page }) => {
await page.waitForURL('**/platform');
// Use navigation menu
await page.getByRole('button', { name: 'Open spotlight' }).click();
await page.getByLabel('open-spotlight').click();
await page
.getByRole('button', { name: 'Open Navigation Open the main' })
.click();
@ -56,7 +56,7 @@ test('Quick Command - No Keys', async ({ page }) => {
await page.keyboard.press('Escape');
// use server info
await page.getByRole('button', { name: 'Open spotlight' }).click();
await page.getByLabel('open-spotlight').click();
await page
.getByRole('button', {
name: 'Server Information About this Inventree instance'
@ -68,7 +68,7 @@ test('Quick Command - No Keys', async ({ page }) => {
await page.waitForURL('**/platform');
// use license info
await page.getByRole('button', { name: 'Open spotlight' }).click();
await page.getByLabel('open-spotlight').click();
await page
.getByRole('button', {
name: 'License Information Licenses for dependencies of the service'
@ -80,7 +80,7 @@ test('Quick Command - No Keys', async ({ page }) => {
await page.getByLabel('License Information').getByRole('button').click();
// use about
await page.getByRole('button', { name: 'Open spotlight' }).click();
await page.getByLabel('open-spotlight').click();
await page
.getByRole('button', { name: 'About InvenTree About the InvenTree org' })
.click();
@ -89,7 +89,7 @@ test('Quick Command - No Keys', async ({ page }) => {
await page.getByLabel('About InvenTree').getByRole('button').click();
// use documentation
await page.getByRole('button', { name: 'Open spotlight' }).click();
await page.getByLabel('open-spotlight').click();
await page
.getByRole('button', {
name: 'Documentation Visit the documentation to learn more about InvenTree'
@ -105,7 +105,7 @@ test('Quick Command - No Keys', async ({ page }) => {
/*
await page.getByPlaceholder('Search...').fill('secret');
await page.getByRole('button', { name: 'Secret action It was' }).click();
await page.getByRole('button', { name: 'Open spotlight' }).click();
await page.getByLabel('open-spotlight').click();
await page.getByPlaceholder('Search...').fill('Another secret action');
await page
.getByRole('button', {
@ -113,7 +113,7 @@ test('Quick Command - No Keys', async ({ page }) => {
})
.click();
await page.getByRole('tab', { name: 'Home' }).click();
await page.getByRole('button', { name: 'Open spotlight' }).click();
await page.getByLabel('open-spotlight').click();
*/
await page.getByPlaceholder('Search...').fill('secret');
await page.getByText('Nothing found...').click();