diff --git a/packages/trace-viewer/src/ui/uiModeView.tsx b/packages/trace-viewer/src/ui/uiModeView.tsx index 5d689cc015..b46020658e 100644 --- a/packages/trace-viewer/src/ui/uiModeView.tsx +++ b/packages/trace-viewer/src/ui/uiModeView.tsx @@ -359,7 +359,7 @@ export const UIModeView: React.FC<{}> = ({ if (e.code === 'Backquote' && e.ctrlKey) { e.preventDefault(); setIsShowingOutput(!isShowingOutput); - } else if (e.code === 'F5' && e.shiftKey) { + } else if ((e.code === 'F5' && e.shiftKey) || (e.code === 'KeyS' && e.altKey)) { e.preventDefault(); testServerConnection?.stopTestsNoReply({}); } else if ((e.code === 'F5') || (e.code === 'KeyR' && e.altKey)) { diff --git a/tests/playwright-test/ui-mode-test-shortcut.spec.ts b/tests/playwright-test/ui-mode-test-shortcut.spec.ts index de2fb17194..35624805aa 100644 --- a/tests/playwright-test/ui-mode-test-shortcut.spec.ts +++ b/tests/playwright-test/ui-mode-test-shortcut.spec.ts @@ -29,7 +29,7 @@ const basicTestTree = { }; ["F5", "Alt+r"].forEach((keyboardShortcut) => { - test.only(`should run tests with "${keyboardShortcut}"`, async ({ + test(`should run tests with "${keyboardShortcut}"`, async ({ runUITest, }) => { const { page } = await runUITest(basicTestTree); @@ -56,15 +56,18 @@ const basicTestTree = { }); }); -test('should stop tests', async ({ runUITest }) => { - const { page } = await runUITest(basicTestTree); +["Shift+F5", "Alt+s"].forEach((keyboardShortcut) => { + test(`should stop tests with "${keyboardShortcut}"`, async ({ + runUITest, + }) => { + const { page } = await runUITest(basicTestTree); - await expect(page.getByTitle('Run all')).toBeEnabled(); - await expect(page.getByTitle('Stop')).toBeDisabled(); + await expect(page.getByTitle("Run all")).toBeEnabled(); + await expect(page.getByTitle("Stop")).toBeDisabled(); - await page.getByTitle('Run all').click(); + await page.getByTitle("Run all").click(); - await expect.poll(dumpTestTree(page)).toBe(` + await expect.poll(dumpTestTree(page)).toBe(` ▼ ↻ a.test.ts ⊘ test 0 ✅ test 1 @@ -72,12 +75,12 @@ test('should stop tests', async ({ runUITest }) => { 🕦 test 3 `); - await expect(page.getByTitle('Run all')).toBeDisabled(); - await expect(page.getByTitle('Stop')).toBeEnabled(); + await expect(page.getByTitle("Run all")).toBeDisabled(); + await expect(page.getByTitle("Stop")).toBeEnabled(); - await page.keyboard.press('Shift+F5'); + await page.keyboard.press(keyboardShortcut); - await expect.poll(dumpTestTree(page)).toBe(` + await expect.poll(dumpTestTree(page)).toBe(` ▼ ◯ a.test.ts ⊘ test 0 ✅ test 1