mirror of
https://github.com/inventree/InvenTree.git
synced 2025-11-13 19:36:46 +00:00
[CI] Playwright improvements (#9395)
* Allow port 4173 (vite preview) * Change 'base' attr based on vite command * Allow api_host to be specified separately * Harden API host functionality * Adjust server selections * Cleanup vite.config.ts * Adjust playwright configuration - Allow to run in "production" mode - Builds the code first - Runs only the backend web server - Not suitable for coverage * Tweak github actions * Tweak QC file * Reduce number of steps * Tweak CI file * Fix typo * Ensure translation before build * Fix hard-coded test * Test tweaks * uncomment * Revert some changes * Run with gunicorn, single worker * Reduce log output in DEBUG mode * Update deps * Add global-setup func * Fix for .gitignore file * Cached auth state * Tweak login func * Updated tests * Enable parallel workers again * Simplify config * Try with a single worker again * Single retry mode * Run auth setup first - Prevent issues with parallel test doing login * Improve test setup process * Tweaks * Bump to 3 workers * Tweak playwright settings * Revert change * Revert change
This commit is contained in:
@@ -1,41 +1,7 @@
|
||||
import { expect, test } from './baseFixtures.js';
|
||||
import { logoutUrl, user } from './defaults.js';
|
||||
import { logoutUrl } from './defaults.js';
|
||||
import { navigate } from './helpers.js';
|
||||
import { doLogin, doQuickLogin } from './login.js';
|
||||
|
||||
test('Login - Basic Test', async ({ page }) => {
|
||||
await doLogin(page);
|
||||
|
||||
// Check that the username is provided
|
||||
await page.getByText(user.username);
|
||||
|
||||
// Logout (via menu)
|
||||
await page.getByRole('button', { name: 'Ally Access' }).click();
|
||||
await page.getByRole('menuitem', { name: 'Logout' }).click();
|
||||
|
||||
await page.waitForURL('**/web/login');
|
||||
await page.getByLabel('username');
|
||||
});
|
||||
|
||||
test('Login - Quick 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 navigate(page, '');
|
||||
await page.waitForURL('**/web');
|
||||
|
||||
await page.getByText('InvenTree Demo Server - ').waitFor();
|
||||
|
||||
// Logout (via URL)
|
||||
await navigate(page, 'logout');
|
||||
await page.waitForURL('**/web/login');
|
||||
await page.getByLabel('username');
|
||||
});
|
||||
import { doLogin } from './login.js';
|
||||
|
||||
/**
|
||||
* Test various types of login failure
|
||||
@@ -79,7 +45,7 @@ test('Login - Failures', async ({ page }) => {
|
||||
});
|
||||
|
||||
test('Login - Change Password', async ({ page }) => {
|
||||
await doQuickLogin(page, 'noaccess', 'youshallnotpass');
|
||||
await doLogin(page, 'noaccess', 'youshallnotpass');
|
||||
|
||||
// Navigate to the 'change password' page
|
||||
await navigate(page, 'settings/user/account');
|
||||
@@ -105,6 +71,4 @@ test('Login - Change Password', async ({ page }) => {
|
||||
|
||||
await page.getByText('Password Changed').waitFor();
|
||||
await page.getByText('The password was set successfully').waitFor();
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user