2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-09-14 22:51:30 +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,13 +1,16 @@
import { test } from './baseFixtures.js';
import { baseUrl } from './defaults.js';
import { clearTableFilters, setTableChoiceFilter } from './helpers.js';
import {
clearTableFilters,
navigate,
setTableChoiceFilter
} from './helpers.js';
import { doQuickLogin } from './login.js';
test('Tables - Filters', async ({ page }) => {
await doQuickLogin(page);
// Head to the "build order list" page
await page.goto(`${baseUrl}/manufacturing/index/`);
await navigate(page, 'manufacturing/index/');
await clearTableFilters(page);
@@ -18,14 +21,14 @@ test('Tables - Filters', async ({ page }) => {
await clearTableFilters(page);
// Head to the "part list" page
await page.goto(`${baseUrl}/part/category/index/parts/`);
await navigate(page, 'part/category/index/parts/');
await setTableChoiceFilter(page, 'Assembly', 'Yes');
await clearTableFilters(page);
// Head to the "purchase order list" page
await page.goto(`${baseUrl}/purchasing/index/purchaseorders/`);
await navigate(page, 'purchasing/index/purchaseorders/');
await clearTableFilters(page);
@@ -42,7 +45,7 @@ test('Tables - Columns', async ({ page }) => {
await doQuickLogin(page);
// Go to the "stock list" page
await page.goto(`${baseUrl}/stock/location/index/stock-items`);
await navigate(page, 'stock/location/index/stock-items');
// Open column selector
await page.getByLabel('table-select-columns').click();
@@ -52,7 +55,7 @@ test('Tables - Columns', async ({ page }) => {
await page.getByRole('menuitem', { name: 'Stocktake' }).click();
await page.keyboard.press('Escape');
await page.goto(`${baseUrl}/sales/index/salesorders`);
await navigate(page, '/sales/index/salesorders');
// Open column selector
await page.getByLabel('table-select-columns').click();