From 866c1b52a14fa33948e350238b70c01586cb9eb9 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Tue, 9 Apr 2024 22:30:53 +0200 Subject: [PATCH] add text input testing --- .../tests/{pui_command.ts => pui_command.spec.ts} | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) rename src/frontend/tests/{pui_command.ts => pui_command.spec.ts} (73%) diff --git a/src/frontend/tests/pui_command.ts b/src/frontend/tests/pui_command.spec.ts similarity index 73% rename from src/frontend/tests/pui_command.ts rename to src/frontend/tests/pui_command.spec.ts index 47e69739a9..017a1cfea8 100644 --- a/src/frontend/tests/pui_command.ts +++ b/src/frontend/tests/pui_command.spec.ts @@ -1,6 +1,6 @@ -import { expect, test } from '@playwright/test'; +import { expect, test } from './baseFixtures.js'; -test('test', async ({ page }) => { +test('PUI - Quick Command', async ({ page }) => { await page.goto('./platform/'); await expect(page).toHaveTitle('InvenTree'); await page.waitForURL('**/platform/'); @@ -33,4 +33,11 @@ test('test', async ({ page }) => { .getByRole('heading', { name: 'Welcome to your Dashboard,' }) .click(); await page.waitForURL('**/platform'); + + // Open Spotlight with Keyboard Shortcut and Search + await page.keyboard.press('Meta+K'); + await page.getByPlaceholder('Search...').fill('Dashboard'); + await page.getByPlaceholder('Search...').press('Tab'); + await page.getByPlaceholder('Search...').press('Enter'); + await page.waitForURL('**/platform/dashboard'); });