2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-11-13 19:36:46 +00:00

[CI] Playwright testing improvements (#8985)

* Run playwright tests in headless mode

* Add navigation helper

* Validate files

* test fix

* Remove 'headless'

* Fixes

* Fix for 'navigate' helper

* Further updates
This commit is contained in:
Oliver
2025-02-01 16:29:13 +11:00
committed by GitHub
parent 66496fb669
commit 821b311d73
16 changed files with 116 additions and 87 deletions

View File

@@ -1,5 +1,6 @@
import { expect, test } from './baseFixtures.js';
import { baseUrl, logoutUrl, user } from './defaults.js';
import { logoutUrl, user } from './defaults.js';
import { navigate } from './helpers.js';
import { doLogin, doQuickLogin } from './login.js';
test('Login - Basic Test', async ({ page }) => {
@@ -25,13 +26,13 @@ test('Login - Quick Test', async ({ page }) => {
await expect(page).toHaveTitle(/^InvenTree/);
// Go to the dashboard
await page.goto(baseUrl);
await navigate(page, '');
await page.waitForURL('**/platform');
await page.getByText('InvenTree Demo Server - ').waitFor();
// Logout (via URL)
await page.goto(`${baseUrl}/logout/`);
await navigate(page, 'logout');
await page.waitForURL('**/platform/login');
await page.getByLabel('username');
});
@@ -48,7 +49,7 @@ test('Login - Failures', async ({ page }) => {
};
// Navigate to the 'login' page
await page.goto(logoutUrl);
await navigate(page, logoutUrl);
await expect(page).toHaveTitle(/^InvenTree.*$/);
await page.waitForURL('**/platform/login');
@@ -81,7 +82,7 @@ test('Login - Change Password', async ({ page }) => {
await doQuickLogin(page, 'noaccess', 'youshallnotpass');
// Navigate to the 'change password' page
await page.goto(`${baseUrl}/settings/user/account`);
await navigate(page, 'settings/user/account');
await page.getByLabel('action-menu-user-actions').click();
await page.getByLabel('action-menu-user-actions-change-password').click();