Command bar VRTs (#5591)

* command bar vrts

* release notes

* reduce flakiness

* oh

* add screenshots back in

* Update VRT

* trigger

* reducing screenshots

* Update VRT

* trigger

* jeez

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Michael Clark
2025-08-21 09:08:46 +01:00
committed by GitHub
parent 284fc13161
commit 96bfc69332
8 changed files with 83 additions and 0 deletions

View File

@@ -0,0 +1,77 @@
import { type Page } from '@playwright/test';
import { expect, test } from './fixtures';
import { ConfigurationPage } from './page-models/configuration-page';
test.describe('Command bar', () => {
let page: Page;
let configurationPage: ConfigurationPage;
test.beforeAll(async ({ browser }) => {
page = await browser.newPage();
configurationPage = new ConfigurationPage(page);
await page.goto('/');
await configurationPage.createTestFile();
// Move mouse to corner of the screen;
// sometimes the mouse hovers on a budget element thus rendering an input box
// and this breaks screenshot tests
await page.mouse.move(0, 0);
// ensure page is loaded
await expect(page.getByTestId('budget-table')).toBeVisible();
await expect(page.getByRole('button', { name: 'Add group' })).toBeVisible({
timeout: 10000,
});
});
test.afterAll(async () => {
await page.close();
});
test('Check the command bar visuals', async () => {
// Open the command bar
await page.keyboard.press('ControlOrMeta+k');
const commandBar = page.getByRole('combobox', {
name: 'Command Bar',
});
await expect(commandBar).toBeVisible();
await expect(page).toMatchThemeScreenshots();
// Close the command bar
await page.keyboard.press('Escape');
await expect(commandBar).not.toBeVisible();
});
test('Check the command bar search works correctly', async () => {
await page.keyboard.press('ControlOrMeta+k');
const commandBar = page.getByRole('combobox', {
name: 'Command Bar',
});
await expect(commandBar).toBeVisible();
await expect(commandBar).toHaveValue('');
// Search and navigate to reports
await commandBar.fill('reports');
await page.keyboard.press('Enter');
await expect(page.getByTestId('reports-page')).toBeVisible();
await expect(page.getByText('Loading reports...')).not.toBeVisible(); // wait for screen to load
// Navigate to schedule page
await page.keyboard.press('ControlOrMeta+k');
await page.keyboard.press('ArrowDown');
await page.keyboard.press('ArrowDown'); // Select second suggestion - Schedules
await expect(page).toMatchThemeScreenshots();
await page.keyboard.press('Enter');
await expect(
page.getByRole('button', {
name: 'Add new schedule',
}),
).toBeVisible();
});
});

View File

@@ -0,0 +1,6 @@
---
category: Maintenance
authors: [MikesGlitch]
---
Added Command bar VRT's