2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-09-14 06:31:27 +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,3 +1,5 @@
import { baseUrl } from './defaults';
/**
* Open the filter drawer for the currently visible table
* @param page - The page object
@@ -62,3 +64,20 @@ export const setTableChoiceFilter = async (page, filter, value) => {
export const getRowFromCell = async (cell) => {
return cell.locator('xpath=ancestor::tr').first();
};
/**
* Navigate to the provided page, and wait for loading to complete
* @param page
* @param url
*/
export const navigate = async (page, url: string) => {
if (!url.startsWith(baseUrl)) {
if (url.startsWith('/')) {
url = url.slice(1);
}
url = `${baseUrl}/${url}`;
}
await page.goto(url, { waitUntil: 'domcontentloaded' });
};