change 'run test' shortcut to 'enter with shift'
This commit is contained in:
parent
7ccb006b01
commit
922a6868b5
|
|
@ -179,7 +179,7 @@ export const UIModeView: React.FC<{}> = ({
|
|||
|
||||
React.useEffect(() => {
|
||||
const onShortcutEvent = (e: KeyboardEvent) => {
|
||||
if (e.code === 'KeyR' && (e.metaKey || e.ctrlKey)){
|
||||
if (e.key === 'Enter' && e.shiftKey) {
|
||||
e.preventDefault();
|
||||
runTests('bounce-if-busy', visibleTestIds);
|
||||
} else if (e.code === 'KeyS' && (e.metaKey || e.ctrlKey)) {
|
||||
|
|
|
|||
|
|
@ -28,24 +28,13 @@ const basicTestTree = {
|
|||
`
|
||||
};
|
||||
|
||||
test('should run on Meta(command) with R', async ({ runUITest }) => {
|
||||
test('should run on Enter with Shift', async ({ runUITest }) => {
|
||||
const { page } = await runUITest(basicTestTree);
|
||||
|
||||
await expect(page.getByTitle('Run all')).toBeEnabled();
|
||||
await expect(page.getByTitle('Stop')).toBeDisabled();
|
||||
|
||||
await page.keyboard.press('Meta+r');
|
||||
|
||||
await expect(page.getByTestId('status-line')).toHaveText('Running 1/4 passed (25%)');
|
||||
});
|
||||
|
||||
test('should run on Control with R', async ({ runUITest }) => {
|
||||
const { page } = await runUITest(basicTestTree);
|
||||
|
||||
await expect(page.getByTitle('Run all')).toBeEnabled();
|
||||
await expect(page.getByTitle('Stop')).toBeDisabled();
|
||||
|
||||
await page.keyboard.press('Control+r');
|
||||
await page.keyboard.press('Enter+Shift');
|
||||
|
||||
await expect(page.getByTestId('status-line')).toHaveText('Running 1/4 passed (25%)');
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue