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:
@@ -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' });
|
||||
};
|
||||
|
Reference in New Issue
Block a user