Added alt+s for stopping
This commit is contained in:
parent
ffaa08e607
commit
327a0cd25b
|
|
@ -359,7 +359,7 @@ export const UIModeView: React.FC<{}> = ({
|
||||||
if (e.code === 'Backquote' && e.ctrlKey) {
|
if (e.code === 'Backquote' && e.ctrlKey) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setIsShowingOutput(!isShowingOutput);
|
setIsShowingOutput(!isShowingOutput);
|
||||||
} else if (e.code === 'F5' && e.shiftKey) {
|
} else if ((e.code === 'F5' && e.shiftKey) || (e.code === 'KeyS' && e.altKey)) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
testServerConnection?.stopTestsNoReply({});
|
testServerConnection?.stopTestsNoReply({});
|
||||||
} else if ((e.code === 'F5') || (e.code === 'KeyR' && e.altKey)) {
|
} else if ((e.code === 'F5') || (e.code === 'KeyR' && e.altKey)) {
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ const basicTestTree = {
|
||||||
};
|
};
|
||||||
|
|
||||||
["F5", "Alt+r"].forEach((keyboardShortcut) => {
|
["F5", "Alt+r"].forEach((keyboardShortcut) => {
|
||||||
test.only(`should run tests with "${keyboardShortcut}"`, async ({
|
test(`should run tests with "${keyboardShortcut}"`, async ({
|
||||||
runUITest,
|
runUITest,
|
||||||
}) => {
|
}) => {
|
||||||
const { page } = await runUITest(basicTestTree);
|
const { page } = await runUITest(basicTestTree);
|
||||||
|
|
@ -56,13 +56,16 @@ const basicTestTree = {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should stop tests', async ({ runUITest }) => {
|
["Shift+F5", "Alt+s"].forEach((keyboardShortcut) => {
|
||||||
|
test(`should stop tests with "${keyboardShortcut}"`, async ({
|
||||||
|
runUITest,
|
||||||
|
}) => {
|
||||||
const { page } = await runUITest(basicTestTree);
|
const { page } = await runUITest(basicTestTree);
|
||||||
|
|
||||||
await expect(page.getByTitle('Run all')).toBeEnabled();
|
await expect(page.getByTitle("Run all")).toBeEnabled();
|
||||||
await expect(page.getByTitle('Stop')).toBeDisabled();
|
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
|
▼ ↻ a.test.ts
|
||||||
|
|
@ -72,10 +75,10 @@ test('should stop tests', async ({ runUITest }) => {
|
||||||
🕦 test 3
|
🕦 test 3
|
||||||
`);
|
`);
|
||||||
|
|
||||||
await expect(page.getByTitle('Run all')).toBeDisabled();
|
await expect(page.getByTitle("Run all")).toBeDisabled();
|
||||||
await expect(page.getByTitle('Stop')).toBeEnabled();
|
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
|
▼ ◯ a.test.ts
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue