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>
65
packages/desktop-client/e2e/help-menu.test.ts
Normal 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();
|
||||
});
|
||||
});
|
||||
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 81 KiB |
|
After Width: | Height: | Size: 81 KiB |
|
After Width: | Height: | Size: 116 KiB |
|
After Width: | Height: | Size: 113 KiB |
|
After Width: | Height: | Size: 115 KiB |
|
After Width: | Height: | Size: 111 KiB |
|
After Width: | Height: | Size: 108 KiB |
|
After Width: | Height: | Size: 110 KiB |
|
After Width: | Height: | Size: 130 KiB |
|
After Width: | Height: | Size: 126 KiB |
|
After Width: | Height: | Size: 128 KiB |