Add spectron test for zoom functionality (#948)

This commit is contained in:
Johan Kwarnmark
2020-03-27 07:40:09 +01:00
committed by GitHub
parent 86854315b3
commit e1bf469206
2 changed files with 69 additions and 0 deletions

View File

@@ -26,6 +26,33 @@ class RobotActions {
robot.keyToggle('f', 'up', [ 'command', 'control' ]);
}
/**
* Zoom in via keyboard Command/Ctrl +
*/
public zoomIn(): void {
const modifier = isMac ? [ 'command' ] : [ 'control' ];
robot.keyToggle('+', 'down', modifier);
robot.keyToggle('+', 'up', modifier);
}
/**
* Zoom out via keyboard
*/
public zoomOut(): void {
const modifier = isMac ? [ 'command' ] : [ 'control' ];
robot.keyToggle('-', 'down', modifier);
robot.keyToggle('-', 'up', modifier);
}
/**
* Zoom reset via keyboard
*/
public zoomReset(): void {
const modifier = isMac ? [ 'command' ] : [ 'control' ];
robot.keyToggle('0', 'down', modifier);
robot.keyToggle('0', 'up', modifier);
}
/**
* Click the App menu
*/