2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-07-10 09:00:57 +00:00
Files
InvenTree/src/frontend/tests/pui_basic.spec.ts
T
Oliver 7b50f3b1d3 [PUI] Page titles (#8467)
* Add <PageTitle /> component

* Use useEffect to override hard-coded value

* Ensure page titles are tracked across the site

* Adjust unit tests

* Playwright test updates

* Tweak tests

* Update InvenTreeTable.tsx

Revert unused change
2024-11-13 06:49:28 +11:00

55 lines
1.5 KiB
TypeScript

import { expect, test } from './baseFixtures.js';
import { baseUrl, user } from './defaults.js';
import { doLogin, doQuickLogin } from './login.js';
test('Basic Login Test', async ({ page }) => {
await doLogin(page);
// Check that the username is provided
await page.getByText(user.username);
await expect(page).toHaveTitle(/^InvenTree/);
// Go to the dashboard
await page.goto(baseUrl);
await page.waitForURL('**/platform');
await page.getByText('InvenTree Demo Server -').waitFor();
// Check that the username is provided
await page.getByText(user.username);
await expect(page).toHaveTitle(/^InvenTree/);
// Go to the dashboard
await page.goto(baseUrl);
await page.waitForURL('**/platform');
// Logout (via menu)
await page.getByRole('button', { name: 'Ally Access' }).click();
await page.getByRole('menuitem', { name: 'Logout' }).click();
await page.waitForURL('**/platform/login');
await page.getByLabel('username');
});
test('Quick Login Test', async ({ page }) => {
await doQuickLogin(page);
// Check that the username is provided
await page.getByText(user.username);
await expect(page).toHaveTitle(/^InvenTree/);
// Go to the dashboard
await page.goto(baseUrl);
await page.waitForURL('**/platform');
await page.getByText('InvenTree Demo Server - ').waitFor();
// Logout (via URL)
await page.goto(`${baseUrl}/logout/`);
await page.waitForURL('**/platform/login');
await page.getByLabel('username');
});