mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +00:00 
			
		
		
		
	Tweak playwright tests (#9027)
This commit is contained in:
		| @@ -81,3 +81,13 @@ export const navigate = async (page, url: string) => { | ||||
|  | ||||
|   await page.goto(url, { waitUntil: 'domcontentloaded' }); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * Perform a 'global search' on the provided page, for the provided query text | ||||
|  */ | ||||
| export const globalSearch = async (page, query) => { | ||||
|   await page.getByLabel('open-search').click(); | ||||
|   await page.getByLabel('global-search-input').clear(); | ||||
|   await page.getByPlaceholder('Enter search text').fill(query); | ||||
|   await page.waitForTimeout(300); | ||||
| }; | ||||
|   | ||||
| @@ -1,6 +1,7 @@ | ||||
| import { test } from '../baseFixtures.ts'; | ||||
| import { | ||||
|   clearTableFilters, | ||||
|   globalSearch, | ||||
|   navigate, | ||||
|   setTableChoiceFilter | ||||
| } from '../helpers.ts'; | ||||
| @@ -182,13 +183,7 @@ test('Sales Orders - Shipments', async ({ page }) => { | ||||
|   await page.getByRole('button', { name: 'Cancel' }).click(); | ||||
|  | ||||
|   // Search for shipment by tracking number | ||||
|   await page.getByLabel('open-search').click(); | ||||
|  | ||||
|   await page.getByLabel('global-search-input').clear(); | ||||
|  | ||||
|   await page.waitForTimeout(250); | ||||
|   await page.getByLabel('global-search-input').fill('TRK-002'); | ||||
|   await page.waitForTimeout(250); | ||||
|   await globalSearch(page, 'TRK-002'); | ||||
|  | ||||
|   await page | ||||
|     .getByText(/SO0009/) | ||||
| @@ -196,13 +191,7 @@ test('Sales Orders - Shipments', async ({ page }) => { | ||||
|     .click(); | ||||
|  | ||||
|   // Search for shipment by invoice number | ||||
|   await page.getByLabel('open-search').click(); | ||||
|  | ||||
|   await page.getByLabel('global-search-input').clear(); | ||||
|  | ||||
|   await page.waitForTimeout(250); | ||||
|   await page.getByLabel('global-search-input').fill('INV-123'); | ||||
|   await page.waitForTimeout(250); | ||||
|   await globalSearch(page, 'INV-123'); | ||||
|  | ||||
|   await page | ||||
|     .getByText(/SO0025/) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user