VRT's for Help menu (#5371)

* add some tests for help menu

* updating tests

* release notes

* fix lint

* Update VRT

* unneeded focus

* good wabbit

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Michael Clark
2025-07-23 08:06:28 +00:00
committed by GitHub
parent 31b31f2edb
commit 8cea059834
14 changed files with 71 additions and 0 deletions

View File

@@ -0,0 +1,65 @@
import { type Page } from '@playwright/test';
import { expect, test } from './fixtures';
import { ConfigurationPage } from './page-models/configuration-page';
test.describe('Help menu', () => {
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);
});
test.afterAll(async () => {
await page.close();
});
test('Check the help menu visuals', async () => {
await page.getByRole('button', { name: 'Help' }).click();
expect(page.getByText('Keyboard shortcuts')).toBeVisible();
await expect(page).toMatchThemeScreenshots();
});
test('Check the keyboard shortcuts modal visuals', async () => {
await page.getByRole('button', { name: 'Help' }).click();
await page.getByText('Keyboard shortcuts').click();
const keyboardShortcutsModal = page.getByRole('dialog', {
name: 'Modal dialog',
});
await expect(keyboardShortcutsModal).toBeVisible();
await expect(page).toMatchThemeScreenshots();
const searchBox =
keyboardShortcutsModal.getByPlaceholder('Search shortcuts');
await expect(searchBox).toHaveValue('');
await searchBox.fill('command');
await expect(
keyboardShortcutsModal.getByText('Open the Command Palette'),
).toBeVisible();
await expect(page).toMatchThemeScreenshots();
const backButton = keyboardShortcutsModal.getByRole('button', {
name: 'Back',
});
await backButton.click();
await expect(searchBox).toHaveValue('');
await keyboardShortcutsModal.getByText('General').click();
await expect(
keyboardShortcutsModal.getByText('Open the help menu'),
).toBeVisible();
await expect(page).toMatchThemeScreenshots();
});
});