use texts instead

This commit is contained in:
Matthias Mair 2024-04-09 23:17:45 +02:00
parent 26c5f5e8f2
commit 7771189556
No known key found for this signature in database
GPG Key ID: A593429DDA23B66A

View File

@ -17,9 +17,7 @@ test('PUI - Quick Command', async ({ page }) => {
// Open Spotlight with Keyboard Shortcut // Open Spotlight with Keyboard Shortcut
await page.keyboard.press('Meta+K'); await page.keyboard.press('Meta+K');
await page await page.getByText('Go to the InvenTree dashboard').click();
.getByRole('button', { name: 'Dashboard Go to the InvenTree dashboard' })
.click();
await page await page
.locator('div') .locator('div')
.filter({ hasText: /^Dashboard$/ }) .filter({ hasText: /^Dashboard$/ })
@ -28,7 +26,7 @@ test('PUI - Quick Command', async ({ page }) => {
// Open Spotlight with Button // Open Spotlight with Button
await page.getByRole('button', { name: 'Open spotlight' }).click(); 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 await page
.getByRole('heading', { name: 'Welcome to your Dashboard,' }) .getByRole('heading', { name: 'Welcome to your Dashboard,' })
.click(); .click();
@ -46,9 +44,7 @@ test('PUI - Quick Command', async ({ page }) => {
// Use navigation menu // Use navigation menu
await page.getByRole('button', { name: 'Open spotlight' }).click(); await page.getByRole('button', { name: 'Open spotlight' }).click();
await page await page.getByText('Open Navigation').click();
.getByRole('button', { name: 'Open Navigation Open the main' })
.click();
// assert the nav headers are visible // assert the nav headers are visible
await page.getByRole('heading', { name: 'Navigation' }).click(); await page.getByRole('heading', { name: 'Navigation' }).click();
await page.getByRole('heading', { name: 'Pages' }).click(); await page.getByRole('heading', { name: 'Pages' }).click();