diff --git a/src/frontend/playwright.config.ts b/src/frontend/playwright.config.ts index f42af97995c..3bdc40fcd41 100644 --- a/src/frontend/playwright.config.ts +++ b/src/frontend/playwright.config.ts @@ -39,7 +39,8 @@ export default defineConfig({ command: 'invoke dev.server -a 127.0.0.1:8000', env: { INVENTREE_DEBUG: 'True', - INVENTREE_PLUGINS_ENABLED: 'True' + INVENTREE_PLUGINS_ENABLED: 'True', + INVENTREE_ADMIN_URL: 'test-admin' }, url: 'http://127.0.0.1:8000/api/', reuseExistingServer: !process.env.CI, diff --git a/src/frontend/tests/pui_general.spec.ts b/src/frontend/tests/pui_general.spec.ts index bd5e6a7e48f..37094701020 100644 --- a/src/frontend/tests/pui_general.spec.ts +++ b/src/frontend/tests/pui_general.spec.ts @@ -110,3 +110,18 @@ test('Company', async ({ page }) => { await page.getByText('Enter a valid URL.').waitFor(); await page.getByRole('button', { name: 'Cancel' }).click(); }); + +/** + * Test for integration of django admin button + */ +test('Admin Button', async ({ page }) => { + await doQuickLogin(page, 'admin', 'inventree'); + await page.goto(`${baseUrl}/company/1/details`); + + // Click on the admin button + await page.getByLabel(/action-button-open-in-admin/).click(); + + await page.waitForURL('**/test-admin/company/company/1/change/**'); + await page.getByRole('heading', { name: 'Change Company' }).waitFor(); + await page.getByRole('link', { name: 'View on site' }).waitFor(); +});