From 77711895569a42426a422d679496661c0ee9d25b Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Tue, 9 Apr 2024 23:17:45 +0200 Subject: [PATCH] use texts instead --- src/frontend/tests/pui_command.spec.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/frontend/tests/pui_command.spec.ts b/src/frontend/tests/pui_command.spec.ts index 3084daf82f..7570863003 100644 --- a/src/frontend/tests/pui_command.spec.ts +++ b/src/frontend/tests/pui_command.spec.ts @@ -17,9 +17,7 @@ test('PUI - Quick Command', async ({ page }) => { // Open Spotlight with Keyboard Shortcut await page.keyboard.press('Meta+K'); - await page - .getByRole('button', { name: 'Dashboard Go to the InvenTree dashboard' }) - .click(); + await page.getByText('Go to the InvenTree dashboard').click(); await page .locator('div') .filter({ hasText: /^Dashboard$/ }) @@ -28,7 +26,7 @@ test('PUI - Quick Command', async ({ page }) => { // Open Spotlight with Button await page.getByRole('button', { name: 'Open spotlight' }).click(); - await page.getByRole('button', { name: 'Home Go to the home page' }).click(); + await page.getByText('Go to the home page').click(); await page .getByRole('heading', { name: 'Welcome to your Dashboard,' }) .click(); @@ -46,9 +44,7 @@ test('PUI - Quick Command', async ({ page }) => { // Use navigation menu await page.getByRole('button', { name: 'Open spotlight' }).click(); - await page - .getByRole('button', { name: 'Open Navigation Open the main' }) - .click(); + await page.getByText('Open Navigation').click(); // assert the nav headers are visible await page.getByRole('heading', { name: 'Navigation' }).click(); await page.getByRole('heading', { name: 'Pages' }).click();