diff --git a/.github/workflows/qc_checks.yaml b/.github/workflows/qc_checks.yaml index c55f1dde86..69125f4572 100644 --- a/.github/workflows/qc_checks.yaml +++ b/.github/workflows/qc_checks.yaml @@ -526,6 +526,8 @@ jobs: update: true - name: Set up test data run: invoke setup-test -i + - name: Rebuild thumbnails + run: invoke rebuild-thumbnails - name: Install dependencies run: inv frontend-compile - name: Install Playwright Browsers diff --git a/codecov.yml b/codecov.yml index dbcc2bf18c..2edad7bb46 100644 --- a/codecov.yml +++ b/codecov.yml @@ -20,7 +20,7 @@ flag_management: carryforward: true statuses: - type: project - target: 50% + target: 40% - name: pui carryforward: true statuses: diff --git a/src/frontend/src/pages/part/PartDetail.tsx b/src/frontend/src/pages/part/PartDetail.tsx index 7544e7174f..0834dd549b 100644 --- a/src/frontend/src/pages/part/PartDetail.tsx +++ b/src/frontend/src/pages/part/PartDetail.tsx @@ -453,7 +453,9 @@ export default function PartDetail() { - + + +
diff --git a/src/frontend/tests/baseFixtures.ts b/src/frontend/tests/baseFixtures.ts index 4ff985c33b..f22e0dd9ea 100644 --- a/src/frontend/tests/baseFixtures.ts +++ b/src/frontend/tests/baseFixtures.ts @@ -5,8 +5,6 @@ import os from 'os'; import * as path from 'path'; const istanbulCLIOutput = path.join(process.cwd(), '.nyc_output'); -export const classicUrl = 'http://127.0.0.1:8000'; - let platform = os.platform(); let systemKeyVar; if (platform === 'darwin') { diff --git a/src/frontend/tests/classic.spec.ts b/src/frontend/tests/cui.spec.ts similarity index 80% rename from src/frontend/tests/classic.spec.ts rename to src/frontend/tests/cui.spec.ts index f2418d60c7..f33ee66b0e 100644 --- a/src/frontend/tests/classic.spec.ts +++ b/src/frontend/tests/cui.spec.ts @@ -1,6 +1,6 @@ import { expect, test } from '@playwright/test'; -import { classicUrl } from './baseFixtures'; +import { classicUrl, user } from './defaults'; test('CUI - Index', async ({ page }) => { await page.goto(`${classicUrl}/api/`); @@ -10,14 +10,14 @@ test('CUI - Index', async ({ page }) => { page.getByRole('heading', { name: 'InvenTree Demo Server' }) ).toBeVisible(); - await page.getByLabel('username').fill('allaccess'); - await page.getByLabel('password').fill('nolimits'); + await page.getByLabel('username').fill(user.username); + await page.getByLabel('password').fill(user.password); await page.click('button', { text: 'Sign In' }); await page.waitForURL('**/index/'); await page.waitForLoadState('networkidle'); await expect(page).toHaveTitle('InvenTree Demo Server | Index'); - await expect(page.getByRole('button', { name: 'allaccess' })).toBeVisible(); + await expect(page.getByRole('button', { name: user.username })).toBeVisible(); await expect( page.getByRole('link', { name: 'Parts', exact: true }) ).toBeVisible(); diff --git a/src/frontend/tests/defaults.ts b/src/frontend/tests/defaults.ts new file mode 100644 index 0000000000..40a0b0a209 --- /dev/null +++ b/src/frontend/tests/defaults.ts @@ -0,0 +1,6 @@ +export const classicUrl = 'http://127.0.0.1:8000'; + +export const user = { + username: 'allaccess', + password: 'nolimits' +}; diff --git a/src/frontend/tests/ui_plattform.spec.ts b/src/frontend/tests/pui_basic.spec.ts similarity index 74% rename from src/frontend/tests/ui_plattform.spec.ts rename to src/frontend/tests/pui_basic.spec.ts index 85ea3d5381..9d2eb43cd1 100644 --- a/src/frontend/tests/ui_plattform.spec.ts +++ b/src/frontend/tests/pui_basic.spec.ts @@ -1,12 +1,12 @@ -import { classicUrl } from './baseFixtures'; import { expect, test } from './baseFixtures.js'; +import { classicUrl, user } from './defaults.js'; test('PUI - Basic test via django', async ({ page }) => { await page.goto(`${classicUrl}/platform/`); await expect(page).toHaveTitle('InvenTree Demo Server'); await page.waitForURL('**/platform/'); - await page.getByLabel('username').fill('allaccess'); - await page.getByLabel('password').fill('nolimits'); + await page.getByLabel('username').fill(user.username); + await page.getByLabel('password').fill(user.password); await page.getByRole('button', { name: 'Log in' }).click(); await page.waitForURL('**/platform/*'); await page.goto(`${classicUrl}/platform/`); @@ -18,8 +18,8 @@ test('PUI - Basic test', async ({ page }) => { await page.goto('./platform/'); await expect(page).toHaveTitle('InvenTree'); await page.waitForURL('**/platform/'); - await page.getByLabel('username').fill('allaccess'); - await page.getByLabel('password').fill('nolimits'); + await page.getByLabel('username').fill(user.username); + await page.getByLabel('password').fill(user.password); await page.getByRole('button', { name: 'Log in' }).click(); await page.waitForURL('**/platform'); await page.goto('./platform/'); diff --git a/src/frontend/tests/pui_command.spec.ts b/src/frontend/tests/pui_command.spec.ts index 893252f53e..a50aa96cc5 100644 --- a/src/frontend/tests/pui_command.spec.ts +++ b/src/frontend/tests/pui_command.spec.ts @@ -1,11 +1,12 @@ import { expect, systemKey, test } from './baseFixtures.js'; +import { user } from './defaults.js'; test('PUI - Quick Command', async ({ page }) => { await page.goto('./platform/'); await expect(page).toHaveTitle('InvenTree'); await page.waitForURL('**/platform/'); - await page.getByLabel('username').fill('allaccess'); - await page.getByLabel('password').fill('nolimits'); + await page.getByLabel('username').fill(user.username); + await page.getByLabel('password').fill(user.password); await page.getByRole('button', { name: 'Log in' }).click(); await page.waitForURL('**/platform'); await page.goto('./platform/'); @@ -50,8 +51,8 @@ test('PUI - Quick Command - no keys', async ({ page }) => { await page.goto('./platform/'); await expect(page).toHaveTitle('InvenTree'); await page.waitForURL('**/platform/'); - await page.getByLabel('username').fill('allaccess'); - await page.getByLabel('password').fill('nolimits'); + await page.getByLabel('username').fill(user.username); + await page.getByLabel('password').fill(user.password); await page.getByRole('button', { name: 'Log in' }).click(); await page.waitForURL('**/platform'); diff --git a/src/frontend/tests/pui_general.spec.ts b/src/frontend/tests/pui_general.spec.ts new file mode 100644 index 0000000000..75d9345690 --- /dev/null +++ b/src/frontend/tests/pui_general.spec.ts @@ -0,0 +1,284 @@ +import { expect, test } from './baseFixtures.js'; +import { user } from './defaults.js'; + +test('PUI - Parts', async ({ page }) => { + await page.goto('./platform/'); + await expect(page).toHaveTitle('InvenTree'); + await page.waitForURL('**/platform/'); + await page.getByLabel('username').fill(user.username); + await page.getByLabel('password').fill(user.password); + await page.getByRole('button', { name: 'Log in' }).click(); + await page.waitForURL('**/platform'); + await page.goto('./platform/home'); + + await page.getByRole('tab', { name: 'Parts' }).click(); + await page.goto('./platform/part/'); + await page.waitForURL('**/platform/part/category/index/details'); + await page.goto('./platform/part/category/index/parts'); + 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: 'Manufacturers' }).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: 'Stocktake' }).click(); + await page.getByRole('tab', { name: 'Attachments' }).click(); + await page.getByRole('tab', { name: 'Notes' }).click(); + await page.getByRole('tab', { name: 'Related Parts' }).click(); + + // Related Parts + await page.getByText('1551ACLR').click(); + await page.getByRole('tab', { name: 'Part Details' }).click(); + await page.getByRole('tab', { name: 'Parameters' }).click(); + // await page.getByRole('tab', { name: 'Stock' }).click(); + await page.getByRole('tab', { name: 'Allocations' }).click(); + await page.getByRole('tab', { name: 'Used In' }).click(); + await page.getByRole('tab', { name: 'Pricing' }).click(); +}); + +test('PUI - Parts - Manufacturer Parts', async ({ page }) => { + await page.goto('./platform/'); + await expect(page).toHaveTitle('InvenTree'); + await page.waitForURL('**/platform/'); + await page.getByLabel('username').fill(user.username); + await page.getByLabel('password').fill(user.password); + await page.getByRole('button', { name: 'Log in' }).click(); + await page.waitForURL('**/platform'); + + await page.goto('./platform/part/84/manufacturers'); + await page.getByRole('tab', { name: 'Manufacturers' }).click(); + 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 page.getByText('1551ACLR - 1551ACLR').waitFor(); +}); + +test('PUI - Parts - Supplier Parts', async ({ page }) => { + await page.goto('./platform/'); + await expect(page).toHaveTitle('InvenTree'); + await page.waitForURL('**/platform/'); + await page.getByLabel('username').fill(user.username); + await page.getByLabel('password').fill(user.password); + await page.getByRole('button', { name: 'Log in' }).click(); + await page.waitForURL('**/platform'); + + await page.goto('./platform/part/15/suppliers'); + await page.getByRole('tab', { name: 'Suppliers' }).click(); + 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 page.getByText('DIG-84670-SJI - R_550R_0805_1%').waitFor(); +}); + +test('PUI - Sales', async ({ page }) => { + await page.goto('./platform/'); + await expect(page).toHaveTitle('InvenTree'); + await page.waitForURL('**/platform/'); + await page.getByLabel('username').fill(user.username); + await page.getByLabel('password').fill(user.password); + await page.getByRole('button', { name: 'Log in' }).click(); + await page.waitForURL('**/platform'); + + await page.goto('./platform/sales/'); + await page.waitForURL('**/platform/sales/**'); + await page.waitForURL('**/platform/sales/index/salesorders'); + await page.getByRole('tab', { name: 'Return Orders' }).click(); + + // Customers + await page.getByRole('tab', { name: 'Customers' }).click(); + 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 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 page.getByRole('cell', { name: 'SO0001' }).click(); + await page + .getByLabel('Order Details') + .getByText('Selling some stuff') + .waitFor(); + await page.getByRole('tab', { name: 'Line Items' }).click(); + await page.getByRole('tab', { name: 'Pending Shipments' }).click(); + await page.getByRole('tab', { name: 'Completed Shipments' }).click(); + await page.getByRole('tab', { name: 'Build Orders' }).click(); + await page.getByText('No records found').first().waitFor(); + await page.getByRole('tab', { name: 'Attachments' }).click(); + await page.getByText('No attachments found').first().waitFor(); + await page.getByRole('tab', { name: 'Notes' }).click(); + await page.getByRole('tab', { name: 'Order Details' }).click(); + + // Return Order Details + await page.getByRole('link', { name: 'Customer A' }).click(); + await page.getByRole('tab', { name: 'Return Orders' }).click(); + 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(); +}); + +test('PUI - Scanning', async ({ page }) => { + await page.goto('./platform/'); + await expect(page).toHaveTitle('InvenTree'); + await page.waitForURL('**/platform/'); + await page.getByLabel('username').fill(user.username); + await page.getByLabel('password').fill(user.password); + await page.getByRole('button', { name: 'Log in' }).click(); + await page.waitForURL('**/platform'); + + await page.getByLabel('Homenav').click(); + await page.getByRole('button', { name: 'System Information' }).click(); + await page.locator('button').filter({ hasText: 'Dismiss' }).click(); + await page.getByRole('link', { name: 'Scanning' }).click(); + await page.waitForTimeout(200); + + await page.locator('.mantine-Overlay-root').click(); + await page.getByPlaceholder('Select input method').click(); + await page.getByRole('option', { name: 'Manual input' }).click(); + await page.getByPlaceholder('Enter item serial or data').click(); + await page.getByPlaceholder('Enter item serial or data').fill('123'); + await page.getByPlaceholder('Enter item serial or data').press('Enter'); + await page.getByRole('cell', { name: 'manually' }).click(); + await page.getByRole('button', { name: 'Lookup part' }).click(); + await page.getByPlaceholder('Select input method').click(); + await page.getByRole('option', { name: 'Manual input' }).click(); +}); + +test('PUI - Admin', async ({ page }) => { + await page.goto('./platform/'); + await expect(page).toHaveTitle('InvenTree'); + await page.waitForURL('**/platform/*'); + await page.getByLabel('username').fill('admin'); + await page.getByLabel('password').fill('inventree'); + await page.getByRole('button', { name: 'Log in' }).click(); + await page.waitForURL('**/platform'); + + // 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 page.getByRole('tab', { name: 'Dashboard' }).click(); + await page.getByRole('tab', { name: 'Display Options' }).click(); + await page.getByText('Date Format').waitFor(); + await page.getByRole('tab', { name: 'Search' }).click(); + await page.getByText('Regex Search').waitFor(); + await page.getByRole('tab', { name: 'Notifications' }).click(); + await page.getByRole('tab', { name: 'Reporting' }).click(); + await page.getByText('Inline report display').waitFor(); + + // System Settings + await page.getByRole('link', { name: 'Switch to System Setting' }).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 page.getByRole('tab', { name: 'Part Categories' }).click(); + //wait page.locator('#mantine-9hqbwrml8-tab-parts').click(); + //await page.locator('#mantine-9hqbwrml8-tab-stock').click(); + await page.getByRole('tab', { name: 'Stocktake' }).click(); + 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(); + + // 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: 'Templates' }).click(); + await page.getByRole('tab', { name: 'Plugins' }).click(); + await page.getByRole('tab', { name: 'Machines' }).click(); +}); + +test('PUI - Language / Color', async ({ page }) => { + await page.goto('./platform/'); + await expect(page).toHaveTitle('InvenTree'); + await page.waitForURL('**/platform/*'); + await page.getByLabel('username').fill(user.username); + await page.getByLabel('password').fill(user.password); + await page.getByRole('button', { name: 'Log in' }).click(); + await page.waitForURL('**/platform'); + + await page.getByRole('button', { name: 'Ally Access' }).click(); + await page.getByRole('menuitem', { name: 'Logout' }).click(); + await page.getByRole('button', { name: 'Send me an email' }).click(); + await page.getByRole('button').nth(3).click(); + await page.getByLabel('Select language').click(); + await page.getByRole('option', { name: 'German' }).click(); + await page.waitForTimeout(200); + + await page.getByRole('button', { name: 'Benutzername und Passwort' }).click(); + await page.getByPlaceholder('Ihr Benutzername').click(); + await page.getByPlaceholder('Ihr Benutzername').fill('admin'); + await page.getByPlaceholder('Ihr Benutzername').press('Tab'); + await page.getByPlaceholder('Dein Passwort').fill('inventree'); + await page.getByRole('button', { name: 'Anmelden' }).click(); + await page.waitForTimeout(200); + + await page + .locator('span') + .filter({ hasText: 'AnzeigeneinstellungenFarbmodusSprache' }) + .getByRole('button') + .click(); + await page + .locator('span') + .filter({ hasText: 'AnzeigeneinstellungenFarbmodusSprache' }) + .getByRole('button') + .click(); + await page.getByRole('button', { name: "InvenTree's Logo" }).first().click(); + await page.getByRole('tab', { name: 'Dashboard' }).click(); + await page.waitForURL('**/platform/dashboard'); +}); + +test('PUI - Company', async ({ page }) => { + await page.goto('./platform/'); + await expect(page).toHaveTitle('InvenTree'); + await page.waitForURL('**/platform/'); + await page.getByLabel('username').fill(user.username); + await page.getByLabel('password').fill(user.password); + await page.getByRole('button', { name: 'Log in' }).click(); + await page.waitForURL('**/platform'); + + await page.goto('./platform/company/1/details'); + await page + .locator('div') + .filter({ hasText: /^DigiKey Electronics$/ }) + .waitFor(); + await page.getByRole('cell', { name: 'https://www.digikey.com/' }).waitFor(); + await page.getByRole('tab', { name: 'Supplied Parts' }).click(); + await page + .getByRole('cell', { name: 'RR05P100KDTR-ND', exact: true }) + .waitFor(); + await page.getByRole('tab', { name: 'Purchase Orders' }).click(); + await page.getByRole('cell', { name: 'Molex connectors' }).first().waitFor(); + await page.getByRole('tab', { name: 'Stock Items' }).click(); + await page.getByRole('cell', { name: 'Blue plastic enclosure' }).waitFor(); + await page.getByRole('tab', { name: 'Contacts' }).click(); + await page.getByRole('cell', { name: 'jimmy.mcleod@digikey.com' }).waitFor(); + await page.getByRole('tab', { name: 'Addresses' }).click(); + await page.getByRole('cell', { name: 'Carla Tunnel' }).waitFor(); + await page.getByRole('tab', { name: 'Attachments' }).click(); + await page.getByRole('tab', { name: 'Notes' }).click(); +}); diff --git a/src/frontend/tests/pui_stock.spec.ts b/src/frontend/tests/pui_stock.spec.ts new file mode 100644 index 0000000000..b4f7e9ec14 --- /dev/null +++ b/src/frontend/tests/pui_stock.spec.ts @@ -0,0 +1,90 @@ +import { expect, test } from './baseFixtures.js'; +import { user } from './defaults.js'; + +test('PUI - Stock', async ({ page }) => { + await page.goto('./platform/'); + await expect(page).toHaveTitle('InvenTree'); + await page.waitForURL('**/platform/'); + await page.getByLabel('username').fill(user.username); + await page.getByLabel('password').fill(user.password); + await page.getByRole('button', { name: 'Log in' }).click(); + await page.waitForURL('**/platform'); + + await page.goto('./platform/stock'); + await page.waitForURL('**/platform/stock/location/index/details'); + await page.getByRole('tab', { name: 'Stock Items' }).click(); + await page.getByRole('cell', { name: '1551ABK' }).click(); + await page.getByRole('tab', { name: 'Stock', exact: true }).click(); + await page.getByRole('tab', { name: 'Stock Locations' }).click(); + 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(); +}); + +test('PUI - Build', async ({ page }) => { + await page.goto('./platform/'); + await expect(page).toHaveTitle('InvenTree'); + await page.waitForURL('**/platform/'); + await page.getByLabel('username').fill(user.username); + await page.getByLabel('password').fill(user.password); + await page.getByRole('button', { name: 'Log in' }).click(); + await page.waitForURL('**/platform'); + + await page.getByRole('tab', { name: 'Build' }).click(); + await page.getByText('Widget Assembly Variant').click(); + await page.getByRole('tab', { name: 'Allocate Stock' }).click(); + await page.getByRole('tab', { name: 'Incomplete Outputs' }).click(); + await page.getByRole('tab', { name: 'Completed Outputs' }).click(); + await page.getByRole('tab', { name: 'Consumed Stock' }).click(); + await page.getByRole('tab', { name: 'Child Build Orders' }).click(); + await page.getByRole('tab', { name: 'Attachments' }).click(); + await page.getByRole('tab', { name: 'Notes' }).click(); +}); + +test('PUI - Purchasing', async ({ page }) => { + await page.goto('./platform/'); + await expect(page).toHaveTitle('InvenTree'); + await page.waitForURL('**/platform/'); + await page.getByLabel('username').fill(user.username); + await page.getByLabel('password').fill(user.password); + await page.getByRole('button', { name: 'Log in' }).click(); + await page.waitForURL('**/platform'); + + 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 page.getByRole('tab', { name: 'Purchasing' }).click(); + await page.getByRole('tab', { name: 'Suppliers' }).click(); + 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 page.getByRole('tab', { name: 'Purchasing' }).click(); + await page.getByRole('tab', { name: 'Manufacturers' }).click(); + await page.getByText('AVX Corporation').click(); + await page.waitForTimeout(200); + + await page.getByRole('tab', { name: 'Addresses' }).click(); + await page.getByRole('cell', { name: 'West Branch' }).click(); + await page.locator('.mantine-ScrollArea-root').click(); + await page + .getByRole('row', { name: 'West Branch Yes Surf Avenue 9' }) + .getByRole('button') + .click(); + await page.getByRole('menuitem', { name: 'Edit' }).click(); + await page.getByLabel('Address title *').waitFor(); + await page.getByRole('button', { name: 'Submit' }).isEnabled(); + await page.getByRole('button', { name: 'Submit' }).click(); + await page.getByRole('tab', { name: 'Details' }).waitFor(); +}); diff --git a/tasks.py b/tasks.py index 37052e2014..013eba9e3e 100644 --- a/tasks.py +++ b/tasks.py @@ -907,6 +907,7 @@ def setup_test(c, ignore_update=False, dev=False, path='inventree-demo-dataset') src = Path(path).joinpath('media').resolve() dst = get_media_dir() + print(f'Copying media files - "{src}" to "{dst}"') shutil.copytree(src, dst, dirs_exist_ok=True) print('Done setting up test environment...')