2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-19 05:25:42 +00:00

[PUI] Add quick login via url (#7022)

* add login with URL params

* use login function for faster tests

* reduce timeout possiblities in job

* remove unused imports

* remove debug
This commit is contained in:
Matthias Mair
2024-04-17 08:21:19 +02:00
committed by GitHub
parent 9435a4c3fd
commit 500f63d2c0
5 changed files with 75 additions and 94 deletions

View File

@ -2,13 +2,10 @@ 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(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/login/?login=${user.username}&password=${user.password}`
);
await page.waitForURL('**/platform/*');
await page.goto('./platform/');
await expect(page).toHaveTitle('InvenTree');
@ -48,18 +45,14 @@ test('PUI - Quick Command', async ({ page }) => {
});
test('PUI - Quick Command - no keys', async ({ page }) => {
await page.goto(
`./platform/login/?login=${user.username}&password=${user.password}`
);
await page.waitForURL('**/platform/*');
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 expect(page).toHaveTitle('InvenTree');
await page.waitForURL('**/platform');
// wait for the page to load - 0.5s
await page.waitForTimeout(500);
// wait for the page to load
await page.waitForTimeout(200);
// Open Spotlight with Button
await page.getByRole('button', { name: 'Open spotlight' }).click();