Added alt+r for running tests
This commit is contained in:
parent
c67a7335ab
commit
ffaa08e607
|
|
@ -362,7 +362,7 @@ export const UIModeView: React.FC<{}> = ({
|
||||||
} else if (e.code === 'F5' && e.shiftKey) {
|
} else if (e.code === 'F5' && e.shiftKey) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
testServerConnection?.stopTestsNoReply({});
|
testServerConnection?.stopTestsNoReply({});
|
||||||
} else if (e.code === 'F5') {
|
} else if ((e.code === 'F5') || (e.code === 'KeyR' && e.altKey)) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
runTests('bounce-if-busy', visibleTestIds);
|
runTests('bounce-if-busy', visibleTestIds);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,26 +28,32 @@ const basicTestTree = {
|
||||||
`
|
`
|
||||||
};
|
};
|
||||||
|
|
||||||
test('should run tests', async ({ runUITest }) => {
|
["F5", "Alt+r"].forEach((keyboardShortcut) => {
|
||||||
const { page } = await runUITest(basicTestTree);
|
test.only(`should run tests with "${keyboardShortcut}"`, async ({
|
||||||
|
runUITest,
|
||||||
|
}) => {
|
||||||
|
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.getByPlaceholder('Filter (e.g. text, @tag)').fill('test 3');
|
await page.getByPlaceholder("Filter (e.g. text, @tag)").fill("test 3");
|
||||||
await page.keyboard.press('F5');
|
await page.keyboard.press(keyboardShortcut);
|
||||||
|
|
||||||
await expect(page.getByTestId('status-line')).toHaveText('1/1 passed (100%)');
|
await expect(page.getByTestId("status-line")).toHaveText(
|
||||||
await page.getByPlaceholder('Filter (e.g. text, @tag)').fill('');
|
"1/1 passed (100%)",
|
||||||
|
);
|
||||||
|
await page.getByPlaceholder("Filter (e.g. text, @tag)").fill("");
|
||||||
|
|
||||||
// Only the filtered test was run.
|
// Only the filtered test was run.
|
||||||
await expect.poll(dumpTestTree(page)).toBe(`
|
await expect.poll(dumpTestTree(page)).toBe(`
|
||||||
▼ ◯ a.test.ts
|
▼ ◯ a.test.ts
|
||||||
◯ test 0
|
◯ test 0
|
||||||
◯ test 1
|
◯ test 1
|
||||||
◯ test 2
|
◯ test 2
|
||||||
✅ test 3
|
✅ test 3
|
||||||
`);
|
`);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should stop tests', async ({ runUITest }) => {
|
test('should stop tests', async ({ runUITest }) => {
|
||||||
|
|
@ -78,6 +84,7 @@ test('should stop tests', async ({ runUITest }) => {
|
||||||
◯ test 2
|
◯ test 2
|
||||||
◯ test 3
|
◯ test 3
|
||||||
`);
|
`);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should toggle Terminal', async ({ runUITest }) => {
|
test('should toggle Terminal', async ({ runUITest }) => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue