Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async fullScreenOnMac() {
await robot.setMouseDelay(100);
await robot.moveMouseSmooth(205, 10);
await robot.mouseClick();
await robot.setKeyboardDelay(100);
// Key tap 5 times as "Enter Full Screen" is in the
// 5th position under view menu item
for (let i = 0; i < 5; i++) {
await robot.keyTap('down');
}
await robot.keyTap('enter');
}
async fullScreenOnMac() {
await robot.setMouseDelay(100);
await robot.moveMouseSmooth(205, 10);
await robot.mouseClick();
await robot.setKeyboardDelay(100);
// Key tap 5 times as "Enter Full Screen" is in the
// 5th position under view menu item
for (let i = 0; i < 5; i++) {
await robot.keyTap('down');
}
await robot.keyTap('enter');
}
async mouseMoveNotification(x, y) {
await robot.setMouseDelay(500);
await robot.moveMouseSmooth(x, y);
await robot.moveMouse(x, y);
}
app.browserWindow.restore().then(() => {
let x = bounds.x + 95;
let y = bounds.y + 35;
robot.moveMouseSmooth(x, y);
robot.mouseClick();
robot.setKeyboardDelay(200);
for (let i = 0; i < 4
; i++) {
robot.keyTap('down');
}
robot.keyTap('enter');
expect(isOnTop).toBeTruthy();
done();
})
});
await this.app.browserWindow.getBounds().then(async (bounds) => {
await robot.setMouseDelay(500);
let x = bounds.x + 95;
let y = bounds.y + 35;
await robot.moveMouseSmooth(x, y);
await robot.moveMouse(x, y);
await robot.mouseClick();
await webAction.openApplicationMenuByClick();
await robot.setKeyboardDelay(200);
await robot.keyTap('enter');
for (var i = 0; i < arrMenu.length; i++) {
for (var s = 0; s < arrMenu[i].step; s++) {
await robot.keyTap('down');
}
if (arrMenu.length > 1 && i != arrMenu.length - 1) {
//handle right keygen
await robot.keyTap('right');
}
}
await robot.keyTap('enter');
});
await this.app.browserWindow.getBounds().then(async (bounds) => {
await robot.setMouseDelay(50);
let x = screen[0].bounds.width / 2;
let y = screen[0].bounds.height / 2;
await robot.moveMouseSmooth(x, y);
await robot.moveMouse(x, y);
});
}
app.browserWindow.getBounds().then((bounds) => {
robot.setMouseDelay(100);
let x = bounds.x + 200;
let y = bounds.y + 200;
robot.moveMouseSmooth(x, y);
robot.mouseClick();
robot.keyToggle('w', 'down', ['control']);
robot.keyToggle('w', 'up');
robot.keyToggle('control', 'up');
app.browserWindow.isMinimized().then(function (minimized) {
expect(minimized).toBeTruthy();
done();
}).catch((err) => {
done.fail(new Error(`minimize-on-close failed in isMinimized with error: ${err}`));
});
});
}
async actionForMenusOnMac(arrMenu) {
let webAction = await new WebActions(this.app);
await robot.setMouseDelay(2000);
let x = 5;
let y = 5;
await robot.moveMouseSmooth(x, y);
await robot.moveMouse(x, y);
await robot.mouseClick();
await robot.setKeyboardDelay(100);
for (var i = 0; i < arrMenu.length; i++) {
if (i == 0) {
for (var s = 0; s < arrMenu[i].step; s++) {
await robot.keyTap('right');
}
}
else {
for (var s = 0; s <= arrMenu[i].step; s++) {
await robot.keyTap('down');
}
}
async mouseMoveNotification(x, y) {
await robot.setMouseDelay(500);
await robot.moveMouseSmooth(x, y);
await robot.moveMouse(x, y);
}