2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-05 05:00:58 +00:00

[PUI] Updates for AdminButton (#8434)

* [PUI] Updates for AdminButton

- Hide if django admin interface is disabled
- Use correct admin URL

* Adjust InfoView

* Add playwright tests
This commit is contained in:
Oliver
2024-11-06 09:27:43 +11:00
committed by GitHub
parent 93a8090e99
commit 245803b0d4
6 changed files with 32 additions and 6 deletions

View File

@ -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();
});