[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 authored and GitHub committed 2025-02-01 16:29:13 +11:00
1 parent 66496fb669
commit 821b311d73
16 files changed
+116 -87

No files matched your search

+19
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' });
};