Commit 42f98160 authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent 8e54b046
Pipeline #82 canceled with stages
let utils=require('./../utils')
let step=0
async function run()
{
console.log('1->Wait for Windows Load')
console.log(stepGenerator('Wait for Windows Load'))
await utils.sleep(7000)
console.log('2->Click And Wait for ITunes Load')
await utils.leftClick(38,338,false)
await utils.sleep(15000)
console.log('3->Click Run ')
await utils.leftClick(1027,551,true)
await utils.sleep(5000)
console.log('4->Click Next ')
await utils.leftClick(1063,684,false)
await utils.sleep(60000)
await utils.leftClick(38,338,false,15000,stepGenerator('Wait for ITunes Load'))
await utils.leftClick(1027,551,true,5000,stepGenerator('Click Run'))
await utils.leftClick(1063,684,false,500,stepGenerator('Click Next'))
await utils.leftClick(1063,684,false,500,stepGenerator('Click Next'))
await utils.leftClick(1063,684,false,60000,stepGenerator('Start Install'))
await utils.leftClick(1063,684,false)
await utils.sleep(1500)
await utils.leftClick(1155,668,true)
......@@ -30,6 +26,13 @@ async function run()
}
function stepGenerator(message)
{
step++
return step+'->'+ message
}
......
......@@ -2,9 +2,16 @@ var robot = require("robotjs");
async function leftClick(x,y,double) {
async function leftClick(x,y,double,sleep,log) {
await robot.moveMouse(x,y)
await robot.mouseClick('left',double)
await sleep(sleep)
console.log(log)
}
function stepGenerator(step,message)
{
return step+'->'+ message
}
......@@ -16,7 +23,8 @@ async function sleep(millis) {
module.exports =
{
leftClick:leftClick,
sleep:sleep
sleep:sleep,
stepGenerator:stepGenerator
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment