test(e2e): update command palette interaction for cross-platform compatibility

Entire-Checkpoint: c6e522b4276c
This commit is contained in:
4gray committed 2026-04-26 01:04:45 +02:00
1 parent f0df67b5b4
commit 16d5816913
2 files changed
+13 -6

No files matched your search

@@ -1536,7 +1536,9 @@ export async function resetMockServers(
}
async function openCommandPalette(page: Page): Promise<Locator> {
await page.locator('app-workspace-shell-header .command-trigger').click();
const modifier = process.platform === 'darwin' ? 'Meta' : 'Control';
await page.locator('body').focus();
await page.keyboard.press(`${modifier}+K`);
const dialog = page.locator(
'mat-dialog-container app-workspace-command-palette'
);
+10 -5
View File
@@ -61,14 +61,19 @@ test.describe('Electron App Smoke Test', () => {
const app = await launchElectronApp(dataDir);
try {
await expect(
app.mainWindow.getByRole('button', {
name: 'Open command palette',
})
).toBeVisible();
await expect(
app.mainWindow.getByRole('button', { name: 'Add playlist' })
).toBeVisible();
const modifier =
process.platform === 'darwin' ? 'Meta' : 'Control';
await app.mainWindow.locator('body').focus();
await app.mainWindow.keyboard.press(`${modifier}+K`);
await expect(
app.mainWindow.locator(
'mat-dialog-container app-workspace-command-palette'
)
).toBeVisible();
} finally {
await closeElectronApp(app);
}