mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-03 22:08:49 +00:00
* cleanup typescript:S1128 * fix typescript:S1854 * clean up typescript:S6749 * fix names for typescript:S6754
59 lines
1.6 KiB
TypeScript
59 lines
1.6 KiB
TypeScript
import { expect, test } from './baseFixtures.js';
|
|
import { baseUrl, user } from './defaults.js';
|
|
import { doLogin, doQuickLogin } from './login.js';
|
|
|
|
test('PUI - Basic Login Test', async ({ page }) => {
|
|
await doLogin(page);
|
|
|
|
// Check that the username is provided
|
|
await page.getByText(user.username);
|
|
|
|
await expect(page).toHaveTitle(RegExp('^InvenTree'));
|
|
|
|
// Go to the dashboard
|
|
await page.goto(baseUrl);
|
|
await page.waitForURL('**/platform');
|
|
|
|
await page
|
|
.getByRole('heading', { name: `Welcome to your Dashboard, ${user.name}` })
|
|
.click();
|
|
|
|
// Check that the username is provided
|
|
await page.getByText(user.username);
|
|
|
|
await expect(page).toHaveTitle(RegExp('^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('PUI - Quick Login Test', async ({ page }) => {
|
|
await doQuickLogin(page);
|
|
|
|
// Check that the username is provided
|
|
await page.getByText(user.username);
|
|
|
|
await expect(page).toHaveTitle(RegExp('^InvenTree'));
|
|
|
|
// Go to the dashboard
|
|
await page.goto(baseUrl);
|
|
await page.waitForURL('**/platform');
|
|
|
|
await page
|
|
.getByRole('heading', { name: `Welcome to your Dashboard, ${user.name}` })
|
|
.click();
|
|
|
|
// Logout (via URL)
|
|
await page.goto(`${baseUrl}/logout/`);
|
|
await page.waitForURL('**/platform/login');
|
|
await page.getByLabel('username');
|
|
});
|