How to use elementClick method in Webdriverio

Best JavaScript code snippet using webdriverio-monorepo

无人值守.js

Source:无人值守.js Github

copy

Full Screen

...52 await setLocations(xky);53 await xky.sleep(3 * 1000);54 //切换账号55 await xky.setAppSnapshot("com.tencent.mm", cCode);56 await elementClick(xky, "允许", 3);57 await elementClick(xky, "允许", 1);58 await elementClick(xky, "关闭应用", 3);59 await elementClick(xky, "返回", 1);60 //查看是否启动完毕,如果时间过长会报告信息61 let isError = await userError(xky, "com.tencent.mm:id/d7b")62 switch (isError) {63 case 1:64 //运行正常,打乱顺序65 var maincheck1 = await upsetArray(args.main_check)66 //执行模块67 await doModule(xky, args, xutil, maincheck1, qqq);68 break;69 case 2:70 //启动卡住71 xky.log("<<<<<<提示1,有20秒确认是否为未出现过的故障添加到异常处理库!!!>>>>>>>");72 xky.log("<<<<<<提示2,有20秒确认是否为未出现过的故障添加到异常处理库!!!>>>>>>>");73 xky.log(qqq)74 xky.log("<<<<<<提示3,有20秒确认是否为未出现过的故障添加到异常处理库!!!>>>>>>>");75 xky.log("<<<<<<提示4,有20秒确认是否为未出现过的故障添加到异常处理库!!!>>>>>>>");76 await xky.sleep(20 * 1000);77 await xky.toast("删除本地插槽结束微信");78 await xky.killApp('com.tencent.mm');//结束在运行的微信79 await xky.sleep(2 * 1000);80 await xky.delAppSnapshot("com.tencent.mm", "all");//删除0181 break;82 case 5:83 //其他设备登陆异常84 xky.log("<<<<<<正在处理异常账号>>>>>>>");85 xky.log(qqq);86 xky.log("<<<<<<正在处理异常账号>>>>>>>");87 await xky.sleep(5000);88 var isGood = await repairError(xky, args, xutil, qqq);89 if (isGood == 1) {90 //运行正常91 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");92 //打乱顺序93 var maincheck12 = await upsetArray(args.main_check)94 //执行模块95 await doModule(xky, args, xutil, maincheck12, qqq);96 }97 break;98 }99 }100}101102async function allDepot(xky, args, xutil) {103 //获取仓库104 let getPot = await getDepot(xky, xutil, 1);105 let depotArrObj = [];106 for (let i = 5; i < getPot.data.data.length; i++) {107 depotArrObj.push(getPot.data.data[i].id)108 }109 //仓库选择器110 let depotIndex = 0;111 while (1) {112 //初始化获取账号113 //app编号114 let appNum = 1;115 let qqq = "";116 //切换账号和仓库117 while (1) {118 await xky.sleep(2000);119 if (depotIndex >= depotArrObj.length) {120 xky.log("***************所有仓库活跃完成***************")121 await xky.toast('所有仓库活跃完成');122 await setChuDong(xky, args, xutil, 2, "绵阳");123 return;124 }125 await xky.toast(`开始执行${depotArrObj[depotIndex]}库`);126 //获取账号127 qqq = await getData(xky, xutil, appNum, depotArrObj[depotIndex]);128 //切换仓库129 if (qqq.data.msg == "该库活跃已完成") {130 await xky.toast('该库活跃完成,正在切换仓库');131 depotIndex++;132 //设置代理编号133 } else {134 await setChuDong(xky, args, xutil, 3, qqq.data.data.city);135 await setChuDong(xky, args, xutil, 2, qqq.data.data.city);136 break;137 }138 }139 //xky.log(qqq)140 //清空联系人141 await xky.toast("清空旧联系人,添加账号联系人");142 await xky.clearContacts();143 //获取extend144 let data = JSON.parse(qqq.data.data.extend);145 let cCode = data.cCode;146 //添加联系人147 await xky.insertContacts(data.addressbook);148 //下载还原插槽信息149 await donwlondWeFile(xky, "WeChat", "com.tencent.mm", cCode);150 //设置定位和VPN151 await xky.toast("设置定位和VPN");152 //切换代理(触动精灵)153 await setChuDong(xky, args, xutil, 1, qqq.data.data.city);154 //定位155 await setLocations(xky);156 await xky.sleep(3 * 1000);157 //切换账号158 await xky.setAppSnapshot("com.tencent.mm", cCode);159 await elementClick(xky, "允许", 3);160 await elementClick(xky, "允许", 1);161 await elementClick(xky, "关闭应用", 3);162 await elementClick(xky, "返回", 1);163164 //查看是否启动完毕,如果时间过长会报告信息165 let isError = await userError(xky, "com.tencent.mm:id/d7b")166167 switch (isError) {168 case 1:169 //运行正常,打乱顺序170 var maincheck1 = await upsetArray(args.main_check)171 //执行模块172 await doModule(xky, args, xutil, maincheck1, qqq);173 break;174 case 2:175 //启动卡住176 xky.log("<<<<<<提示1,有20秒确认是否为未出现过的故障添加到异常处理库!!!>>>>>>>");177 xky.log("<<<<<<提示2,有20秒确认是否为未出现过的故障添加到异常处理库!!!>>>>>>>");178 xky.log(qqq)179 xky.log("<<<<<<提示3,有20秒确认是否为未出现过的故障添加到异常处理库!!!>>>>>>>");180 xky.log("<<<<<<提示4,有20秒确认是否为未出现过的故障添加到异常处理库!!!>>>>>>>");181 await xky.sleep(20 * 1000);182 await xky.toast("删除本地插槽结束微信");183 await xky.killApp('com.tencent.mm');//结束在运行的微信184 await xky.sleep(2 * 1000);185 await xky.delAppSnapshot("com.tencent.mm", "all");//删除01186 break;187 case 5:188 //其他设备登陆异常189 xky.log("<<<<<<正在处理异常账号>>>>>>>");190 xky.log(qqq);191 xky.log("<<<<<<正在处理异常账号>>>>>>>");192 await xky.sleep(5000);193 var isGood = await repairError(xky, args, xutil, qqq);194 if (isGood == 1) {195 //运行正常196 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");197 //打乱顺序198 var maincheck12 = await upsetArray(args.main_check)199 //执行模块200 await doModule(xky, args, xutil, maincheck12, qqq);201 }202 break;203 }204 }205}206207//执行模块208async function doModule(xky, args, xutil, maincheck, qqq) {209 if (maincheck) {210 for (let i = 0; i < maincheck.length; i++) {211 await xky.sleep(1 * 1000);212 await xky.toast(`开始执行 ${maincheck[i]} 模块`);213 switch (maincheck[i]) {214 case "清除红点":215 await wxhdss(xky, xutil);216 break;217 case "加群拉人":218 await adCrowdAdPop(xky, args);219 break;220 case "抢红包":221 await redPacket(xky, args, xutil);222 break;223 case "实名昵称":224 await isAuthentiNick(xky, xutil, qqq);225 break;226 case "添加通讯录":227 await AddTxlFriend(xky, args, xutil, qqq);228 break;229 case "修改微信号":230 await setVXId(xky, xutil, qqq);231 break;232 case "添加内部好友":233 await addPetopFriend(xky, args, xutil, qqq);234 break;235 case "收藏":236 await collect(xky);237 break;238 case "关注公众号":239 await officialAccounts(xky, args, xutil);240 break;241 case "取消关注公众号":242 await delAccounts(xky, args, xutil);243 break;244 case "建群":245 await Jianqun(xky);246 break;247 case "发朋友圈":248 await friendCircle(xky, args, xutil);249 break;250 case "看一看阅读":251 await lookRead(xky);252 break;253 case "搜一搜搜索":254 await SearchHotspot(xky);255 break;256 case "换头像":257 await exchangeHeaderPic(xky);258 break;259 case "个性签名":260 await autograph(xky, xutil);261 break;262 case "下载表情":263 await LowerExpression(xky);264 break;265 case "随机朋友圈可见时间":266 await friendLookTome(xky);267 break;268 case "关闭手机加好友":269 await closePhoneAddFriend(xky, "close");//close/open270 break;271 case "打开手机加好友":272 await closePhoneAddFriend(xky, "open");//close/open273 break;274 case "关注小程序":275 await miniProgram(xky, args, xutil);276 break;277 case "绑定APP":278 await wechatLogin(xky, args, xutil);279 break;280 case "实名认证":281 await realNameAuthentication(xky, xutil);282 break;283 case "关闭新消息提醒":284 await closeTis(xky)285 break;286 }287 }288 } else {289 await xky.toast("没有选择执行模块");290 }291 await xky.sleep(5 * 1000);292 await xky.toast("正在上传插槽信息");293 await xky.killApp('com.tencent.mm');294 await setChuDong(xky, args, xutil, 2, "绵阳");295 //上传插槽信息296 let aa = await xky.getCurrentAppSnapshot("com.tencent.mm");297 await uplondWeFile(xky, "WeChat", "com.tencent.mm", aa.name);//服务器文件名,包名,插槽名298 await xky.sleep(2 * 1000);299 await xky.toast("删除本地插槽结束微信");300 await xky.delAppSnapshot("com.tencent.mm", "all");//删除01301 let finish = await upData(xky, xutil, qqq.data.data.id);302 xky.log(finish)303}304305//判断异常号306async function userError(xky, element) {307 let startTime = new Date();308 while (1) {309 let elementArr = await getElementMassage(xky, element, 1);310 if (elementArr) {311 return 1;312 }313 let endTime = new Date();314 let useTime = endTime - startTime;315 if (useTime > 18000) {316 if (useTime > 45000) {317 return 2;318 }319 //登陆状态异常320 let denglu = await getElementMassage(xky, "登录", 1);321 if (denglu) {322 return 5;323 }324 //账号异常325 let tisa = await xky.findUiObjects('帐号状态异常', { regex: true, timeout: 2000 });326 if (tisa.uiObjects != "") {327 await elementClick(xky, "确定");328 return 5;329 }330 let qq1 = await getElementMassage(xky, "请填写微信密码", 1);331 if (qq1) {332 return 5;333 }334335 //其他设备登陆336 let cc = await xky.findUiObjects('你的微信帐号于', { regex: true, timeout: 2000 });337 let dd = await xky.findUiObjects('你的帐号于', { regex: true, timeout: 2000 });338 let ee = await xky.findUiObjects('当前帐号于', { regex: true, timeout: 2000 });339 if (cc.uiObjects != "" || dd.uiObjects != "" || ee.uiObjects != "") {340 await elementClick(xky, "确定");341 return 5;342 }343344 //登陆出现错误345 let aaa = await xky.findUiObjects('重新登录', { regex: true, timeout: 2000 });346 if (aaa.uiObjects != "") {347 await elementClick(xky, "确定");348 return 5;349 }350351 //被盗异常352 let aaas = await xky.findUiObjects('被盗', { regex: true, timeout: 2000 });353 if (aaas.uiObjects != "") {354 await elementClick(xky, "确定");355 return 5;356 }357 }358 await xky.sleep(3000);359 }360}361362//处理异常号363async function repairError(xky, args, xutil, qqq) {364 while (1) {365 while (1) {366 var qqwe1 = await xky.findUiObjects("请填写微信密码");367 var qqwe2 = await xky.findUiObjects("请填写手机号");368 var qqwe3 = await xky.findUiObjects("登录");369 var qqwe4 = await xky.findUiObjects("下一步");370 var qqwe5 = await xky.findUiObjects("tcaptcha_drag_thumb");371 var qqwe6 = await xky.findUiObjects("开始验证 ");372 var qqwe7 = await xky.findUiObjects("是");373 var qqwe8 = await xky.findUiObjects('异常', { regex: true });374 var qqwe9 = await xky.findUiObjects('批量', { regex: true });375 var qqwe10 = await xky.findUiObjects('密码错误', { regex: true });376 var qqwe11 = await xky.findUiObjects('应急联系人', { regex: true });377 let goodUser = await getElementMassage(xky, "com.tencent.mm:id/d7b", 1);378 if (qqwe1.uiObjects != "") {379 await findElementIput(xky, "请填写微信密码", qqq.data.data.password);380 break;381 } else if (qqwe2.uiObjects != "") {382 await findElementIput(xky, "请填写手机号", qqq.data.data.mobile);383 break;384 } else if (qqwe3.uiObjects != "" && qqwe1.uiObjects == "") {385 await elementClick(xky, "登录", 1);386 await xky.sleep(2000);387 break;388 } else if (qqwe4.uiObjects != "" && qqwe1.uiObjects == "") {389 await elementClick(xky, "下一步", 1);390 await xky.sleep(2000);391 break;392 } else if (qqwe5.uiObjects != "") {393 await slideWecatJigsaw(xky, "tcaptcha_drag_thumb");394 await xky.sleep(3000);395 break;396 } else if (qqwe6.uiObjects != "") {397 await elementClick(xky, "开始验证 ");398 break;399 } else if (qqwe7.uiObjects != "") {400 await elementClick(xky, "是");401 await xky.sleep(5 * 1000);402 return 1;403 } else if (qqwe8.uiObjects != "" || qqwe9.uiObjects != "" || qqwe10.uiObjects != "") {404 await moveTepot(xky, xutil, 1002, qqq);405 return 2;406 } else if (qqwe11.uiObjects != "") {407 return 1;408 } else if (goodUser) {409 return 1;410 }411 }412 }413}414415//开启微信权限416async function openVxQx(xky) {417 await xky.restartApp("com.android.settings")418 await xky.sleep(2000);419 await rollFindElement(xky, "应用", "xia", 6);420 await elementClick(xky, "应用");421 await xky.sleep(2000);422 await rollFindElement(xky, "微信", "xia", 6);423 await elementClick(xky, "微信");424 await elementClick(xky, "权限");425 await xky.sleep(2000);426 while (1) {427 let sdd = await elementClick(xky, "关闭", 2);428 if (!sdd) {429 await elementClick(xky, "身体传感器");430 break;431 }432 }433 await xky.killApp('com.android.settings');434}435436//关闭新消息提醒437async function closeTis(xky) {438 await elementClick(xky, "我");439 await elementClick(xky, "设置");440 await elementClick(xky, "新消息提醒");441 await xky.sleep(2000);442 let getnewmsg = await getElementMassage(xky, "com.tencent.mm:id/j7");443 if (getnewmsg["0"].contentDesc == "已开启") {444 await elementClick(xky, "已开启");445 await elementClick(xky, "确认关闭", 3);446 } else {447 xky.log("消息提醒已经关闭")448 }449 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");450}451452//移库453async function moveTepot(xky, xutil, depot, qqq) {454 await xky.sleep(2 * 1000);455 let extendData = JSON.parse(qqq.data.data.extend)456 let saveUser = await saveData(xky, xutil, 1, qqq.data.data.id, depot, qqq.data.data.account, qqq.data.data.password, qqq.data.data.mobile, qqq.data.data.nickname, qqq.data.data.rawid, qqq.data.data.city, extendData);457 xky.log(saveUser);458 let aa = await xky.getCurrentAppSnapshot("com.tencent.mm")459 await xky.sleep(2 * 1000);460 await xky.toast("删除本地插槽结束微信");461 await xky.delAppSnapshot("com.tencent.mm", "all");//删除01462 xky.log(`------------------------------------`);463 xky.log(`${qqq.data.data.id}已经转移至${depot}库`);464 xky.log(`------------------------------------`);465}466467//关闭不保留活动468async function closeNoSave(xky) {469 await xky.restartApp("com.android.settings")470 await xky.sleep(2000)471 while (1) {472 let sss = await xky.findUiObjects('WLAN');473 if (sss.uiObjects != "") {474 await xky.swipe(0.5, 0.9, 0.5, 0.15, 2);475 break;476 }477 }478 await xky.sleep(2000)479 let bb = await elementClick(xky, "开发者选项", 2);480 if (!bb) {481 xky.log("开发者模式没有打开")482 await rollFindElement(xky, "关于手机", "xia", 6);//已num格的速度查找483 await elementClick(xky, "关于手机");484 await rollFindElement(xky, "版本号", "xia", 5);//已num格的速度查找485 await elementClick(xky, "版本号");486 await elementClick(xky, "版本号");487 await elementClick(xky, "版本号");488 await elementClick(xky, "版本号");489 await elementClick(xky, "版本号");490 await elementClick(xky, "版本号");491 await elementClick(xky, "版本号");492 await elementClick(xky, "版本号");493 await elementClick(xky, "菜单");494 await elementClick(xky, "开发者选项");495 }496 await xky.sleep(2 * 1000);497 await await xky.swipe(0.5, 0.9, 0.5, 0.15, 2);498 await xky.sleep(2000)499 await rollFindElement(xky, "不保留活动", "shang", 2);//已num格的速度查找500 await xky.sleep(2000)501 await elementClick(xky, "ON", 2);502}503504//实名昵称更改505async function isAuthentiNick(xky, xutil, qqq) {506 await elementClick(xky, "我");507 await elementClick(xky, "支付");508 await elementClick(xky, "更多");509 let yirenzheng = await getElementMassage(xky, "已认证", 3);510 if (yirenzheng) {511 let extendData = JSON.parse(qqq.data.data.extend)512 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");513 await elementClick(xky, "我");514 await xky.sleep(2000);515 let yigai = await getElementMassage(xky, "com.tencent.mm:id/a63");516 let smmmm = yigai["0"].text.indexOf("mars")517 if (smmmm < 0) {518 await elementClick(xky, "com.tencent.mm:id/py");519 await elementClick(xky, "昵称");520 await findElementIput(xky, "com.tencent.mm:id/e6r", `${yigai["0"].text}mars`);521 await xky.sleep(2000);522 await elementClick(xky, "保存");523 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");524 await xky.sleep(2 * 1000);525 if (!extendData.isShiMing) {526 extendData.isShiMing = 1;527 }528 let nickSave = await saveData(xky, xutil, 1, qqq.data.data.id, qqq.data.data.depot, qqq.data.data.account, qqq.data.data.password, qqq.data.data.mobile, `${yigai["0"].text}mars`, qqq.data.data.rawid, qqq.data.data.city, extendData);529 xky.log(nickSave);530 } else {531 if (!extendData.isShiMing) {532 extendData.isShiMing = 1;533 let nickSave = await saveData(xky, xutil, 1, qqq.data.data.id, qqq.data.data.depot, qqq.data.data.account, qqq.data.data.password, qqq.data.data.mobile, qqq.data.data.nickname, qqq.data.data.rawid, qqq.data.data.city, extendData);534 xky.log(nickSave);535 }536 }537 } else {538 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");539 }540}541542//实名认证543async function realNameAuthentication(xky, xutil) {544 await elementClick(xky, "我");545 await elementClick(xky, "支付");546 await elementClick(xky, "更多");547 let ewmArr = await getElementMassage(xky, "已认证", 3);548 if (ewmArr) {549 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");550 return 1;551 }552 await elementClick(xky, "实名认证");553 let mm = await getElementMassage(xky, "系统繁忙,请稍后再试", 3);554 if (mm) {555 await elementClick(xky, "确定", 1);556 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");557 return 1;558 }559 await elementClick(xky, "验证姓名和身份证号码");560 await elementClick(xky, "同意");561 let [ppp, qqq, aa] = [0, "", ""];562 while (1) {563 while (1) {564 qqq = await xutil.http.get("http://119.23.32.104:91/com/get/real")565 aa = await xutil.http.get(`https://www.fesugar.com/get_identitycards?id=${qqq.data.data.card}`)566 if (aa.data.msg) {567 xky.log("身份证信息错误")568 await xky.sleep(2000);569 } else {570 break;571 }572 }573 await findElementIput(xky, "请输入本人姓名", qqq.data.data.name);574 await findElementIput(xky, "输入身份证号", qqq.data.data.card);575 await elementClick(xky, "职业");576 await elementClick(xky, "其他");577 await xky.sleep(2 * 1000);578 let tasksave = await getElementMassage(xky, "android.widget.EditText");579 if (tasksave["0"].text == "请输入本人姓名" || tasksave["1"].text == "输入身份证号") {580 xky.log("不活动保留处于打开状态,正在关闭")581 await closeNoSave(xky);582 await xky.restartApp('com.tencent.mm');583 await xky.sleep(6 * 1000);584 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");585 await elementClick(xky, "我");586 await elementClick(xky, "支付");587 await elementClick(xky, "更多");588 await elementClick(xky, "实名认证");589 await elementClick(xky, "验证姓名和身份证号码");590 } else {591 await elementClick(xky, "地区");592 await elementClick(xky, "允许", 3);593 await elementClick(xky, "com.tencent.mm:id/c1");594 let bb = aa.data.data.address;595 let cc = bb.split("省");596 let dd = cc[1].split("市");597 await findElementIput(xky, "com.tencent.mm:id/kh", cc[0]);598 await elementClick(xky, "com.tencent.mm:id/d8t");599 await elementClick(xky, "com.tencent.mm:id/c1");600 await findElementIput(xky, "com.tencent.mm:id/kh", dd[0]);601 await elementClick(xky, "com.tencent.mm:id/d8t");602 await elementClick(xky, "收起键盘", 2);603 await elementClick(xky, "下一步");604 let fff = await getElementMassage(xky, "设置支付密码", 5);605 if (fff) {606 break;607 } else {608 await elementClick(xky, "确定");609 await elementClick(xky, "返回");610 ppp++;611 if (ppp > 2) {612 xky.log("不能过多的尝试实名")613 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");614 return 1;615 }616 await elementClick(xky, "验证中国大陆身份证");617 }618 }619 }620 await xky.sleep(3000);621 await coordinatesClick(xky, "android.widget.RelativeLayout", 0.17, 0.67);622 await coordinatesClick(xky, "android.widget.RelativeLayout", 0.17, 0.67);623 await coordinatesClick(xky, "android.widget.RelativeLayout", 0.17, 0.77);624 await coordinatesClick(xky, "android.widget.RelativeLayout", 0.16, 0.86);625 await coordinatesClick(xky, "android.widget.RelativeLayout", 0.50, 0.86);626 await coordinatesClick(xky, "android.widget.RelativeLayout", 0.51, 0.77);627 await xky.sleep(3000);628 await coordinatesClick(xky, "android.widget.RelativeLayout", 0.17, 0.67);629 await coordinatesClick(xky, "android.widget.RelativeLayout", 0.17, 0.67);630 await coordinatesClick(xky, "android.widget.RelativeLayout", 0.17, 0.77);631 await coordinatesClick(xky, "android.widget.RelativeLayout", 0.16, 0.86);632 await coordinatesClick(xky, "android.widget.RelativeLayout", 0.50, 0.86);633 await coordinatesClick(xky, "android.widget.RelativeLayout", 0.51, 0.77);634 await elementClick(xky, "完成", 3);635 let yj = await getElementMassage(xky, "你已通过身份证号实名注册两个微信支付账户,达到个数限制。请通过添加银行卡完成本次实名注册", 2);636 if (yj) {637 await elementClick(xky, "确定");638 await elementClick(xky, "com.tencent.mm:id/eyy");639 await elementClick(xky, "是");640 }641 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");642}643644//修改微信ID645async function setVXId(xky, xutil, qqq) {646 await elementClick(xky, "我");647 await elementClick(xky, "com.tencent.mm:id/py");648 let ewmArr = await getElementMassage(xky, "android:id/summary");649 if (!ewmArr[1].text.indexOf("wxid_")) {650 let len = 3;651 let $chars =652 "abcdefhijkmnprstwxyz"; //默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1653 let maxPos = $chars.length;654 let pwd = "";655 for (let i = 0; i < len; i++) {656 pwd += $chars.charAt(Math.floor(Math.random() * maxPos));657 }658 let VXheader = pwd;659 let newVXID = `${VXheader}${qqq.data.data.mobile.substring(5, 11)}`660 await elementClick(xky, "微信号");661 await findElementIput(xky, "com.tencent.mm:id/e69", newVXID);662 await elementClick(xky, "保存");663 await elementClick(xky, "确定");664 let IDhave = await getElementMassage(xky, "帐号已经存在,请换其它帐号", 5);665 if (IDhave) {666 newVXID = `${VXheader}${qqq.data.data.mobile.substring(5, 11)}a1`;667 await elementClick(xky, "确定");668 await findElementIput(xky, "com.tencent.mm:id/e69", newVXID);669 await elementClick(xky, "保存");670 await elementClick(xky, "确定");671 }672 await xky.sleep(3 * 1000);673 //上传修改信息信息674 let extendData = JSON.parse(qqq.data.data.extend);675 let saveUser = await saveData(xky, xutil, 1, qqq.data.data.id, qqq.data.data.depot, qqq.data.data.account, qqq.data.data.password, qqq.data.data.mobile, qqq.data.data.nickname, newVXID, qqq.data.data.city, extendData);676 xky.log(saveUser);677 xky.log("******微信号修改完成******");678 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");679 } else {680 xky.log("******该账号已经设置过微信号了******")681 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");682 }683}684685//添加内部好友686async function addPetopFriend(xky, args, xutil, qqq) {687 await elementClick(xky, "com.tencent.mm:id/d7b");688 await elementClick(xky, "更多功能按钮");689 await elementClick(xky, "添加朋友");690 await elementClick(xky, "微信号/QQ号/手机号");691 let friendVXID = "";692 let kkk = 0;693 while (1) {694 await xky.sleep(2000);695 let sss = await getInteriorFriendData(xky, xutil, 1, qqq.data.data.depot, qqq.data.data.id);696 if (sss.data.msg == "ok") {697 friendVXID = sss.data.data.rawid;698 break;699 }700 kkk++;701 if (kkk > 3) {702 xky.log("好友请求接口异常,请检查!!")703 xky.log(sss)704 xky.log("好友请求接口异常,请检查!!")705 }706 }707 await findElementIput(xky, "com.tencent.mm:id/kh", friendVXID);708 await elementClick(xky, "com.tencent.mm:id/d7b", 1);709 let noUser = await elementClick(xky, "添加到通讯录", 5);710 if (noUser) {711 await elementClick(xky, "发送", 5);712 await xky.sleep(2000);713 }714 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");715}716717//加群拉人718async function adCrowdAdPop(xky, args) {719 //清空图片720 await xky.adbShell(" rm /storage/emulated/0/Download/*.jpg");721 await xky.sleep(1000);722 //下载二维码723 await xky.adbShell(`curl '${args.addQunUrl}' -o /storage/emulated/0/Download/1.jpg`);724 await xky.sleep(3000);725 //更新图片726 await xky.insertMedia(`/storage/emulated/0/Download/1.jpg`);727 await elementClick(xky, "com.tencent.mm:id/d7b");728 await elementClick(xky, "更多功能按钮");729 await elementClick(xky, "扫一扫");730 await elementClick(xky, "com.tencent.mm:id/jy");731 await elementClick(xky, "从相册选取二维码");732 await elementClick(xky, "所有图片");733 await elementClick(xky, "Download");734 await elementClick(xky, "com.tencent.mm:id/akq");735 await elementClick(xky, "加入该群聊", 8);736 await xky.sleep(3000);737 let elmArr = await getElementMassage(xky, "com.tencent.mm:id/k3");738 let aaaa = elmArr["0"].text.replace(/[^0-9]/ig, "")739 if ((aaaa) > 95) {740 xky.log("加群人数已达到要求")741 return742 }743 await xky.sleep(5000);744 await elementClick(xky, "com.tencent.mm:id/jy");745 await elementClick(xky, "聊天信息", 1);746 await xky.sleep(2000);747 await rollFindElement(xky, "添加成员", "xia", 3);748 await elementClick(xky, "添加成员");749 await xky.sleep(3000);750 await coordinatesClick(xky, "com.tencent.mm:id/ib", 0.97, 0.61);751 await xky.sleep(3000);752 let [classify, region] = args.addQunFenLei.split(",");753 await findElementIput(xky, "com.tencent.mm:id/b8a", `${classify}_${region}`);754 let pops = await xky.findUiObjects(`${classify}_${region}`, { regex: true, timeout: 3000 });755 if (pops.uiObjects != "") {756 await elementClick(xky, pops.uiObjects["0"].text);757 await xky.sleep(2000)758 for (let i = 1; i < pops.uiObjects.length; i++) {759 await xky.sleep(2000)760 await findElementIput(xky, "com.tencent.mm:id/b8a", `${classify}_${region}`);761 await xky.sleep(2000)762 await elementClick(xky, pops.uiObjects[i].text);763 }764 await elementClick(xky, "com.tencent.mm:id/jx");765 await elementClick(xky, "邀请", 3);766 await elementClick(xky, "邀请", 3);767 await elementClick(xky, "确定", 3);768 }769 //成功后删除图片770 await xky.delString(`/storage/emulated/0/Download/1.jpg`);771 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");772}773774//抢红包775async function redPacket(xky, args, xutil) {776 await elementClick(xky, "com.tencent.mm:id/d7b");777 let dashen = await getElementMassage(xky, args.qhbName, 5);778 if (dashen) {779 await elementClick(xky, args.qhbName);780 let hongbao = await elementClick(xky, "恭喜发财,大吉大利", 3);781 if (hongbao) {782 await elementClick(xky, "com.tencent.mm:id/cyf", 3);783 await elementClick(xky, "com.tencent.mm:id/cv0", 3);784 await elementClick(xky, "返回", 3);785 }786 }787 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");788 await xky.sleep(2000);789 if (args.isFaHongBao) {790 await faRedPacket(xky, args);791 }792}793//发红包794async function faRedPacket(xky, args) {795 await elementClick(xky, "我");796 await elementClick(xky, "支付");797 await xky.sleep(2000);798 let elmArr = await getElementMassage(xky, "com.tencent.mm:id/d1c");799 let klk = elmArr["0"].text.replace("¥", "");800 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");801 if (klk >= 0.01) {802 await elementClick(xky, "com.tencent.mm:id/d7b");803 await elementClick(xky, args.qhbName);804 await elementClick(xky, "更多功能按钮,已折叠");805 await elementClick(xky, "红包");806 await findElementIput(xky, "com.tencent.mm:id/cvb", 0.01);807 await findElementIput(xky, "填写个数", 1);808 await elementClick(xky, "收起键盘", 2);809 await elementClick(xky, "塞钱进红包");810 await elementClick(xky, "立即支付", 2);811 await xky.sleep(3000);812 await coordinatesClick(xky, "android.widget.RelativeLayout", 0.17, 0.67);813 await xky.sleep(1000);814 await coordinatesClick(xky, "android.widget.RelativeLayout", 0.17, 0.67);815 await xky.sleep(1000);816 await coordinatesClick(xky, "android.widget.RelativeLayout", 0.17, 0.77);817 await xky.sleep(1000);818 await coordinatesClick(xky, "android.widget.RelativeLayout", 0.16, 0.86);819 await xky.sleep(1000);820 await coordinatesClick(xky, "android.widget.RelativeLayout", 0.50, 0.86);821 await xky.sleep(1000);822 await coordinatesClick(xky, "android.widget.RelativeLayout", 0.51, 0.77);823 }824 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");825}826//检查加通讯录827async function examineAddTxl(xky, args, xutil, qqq) {828 let sss = await contactCheck(xky, xutil, qqq.data.data.id)829 if (sss.data.data == "") {830 return;831 }832 xky.log(sss)833 let mylength = sss.data.data.length;834 await elementClick(xky, "通讯录");835 await elementClick(xky, "com.tencent.mm:id/iq");836 for (let i = 0; i < mylength; i++) {837 if (sss.data.data[i].type && sss.data.data[i].city) {838 await findElementIput(xky, "com.tencent.mm:id/kh", `${sss.data.data[i].type}_${sss.data.data[i].city}_${sss.data.data[i].id}`);839 await xky.sleep(3000);840 let isAdd = await getElementMassage(xky, `${sss.data.data[i].type}_${sss.data.data[i].city}_${sss.data.data[i].id}`, 2);841 if (isAdd.length > 1) {842 let iss = await contactFinish(xky, xutil, qqq.data.data.id, 2, sss.data.data[i].number)//type:1取备注编号 2完成添加 3拉黑,number:获取的号码843 // await elementClick(xky, "com.tencent.mm:id/q0");844 // await coordinatesClick(xky, "com.tencent.mm:id/nu", 0.08, 0.22);845 // await elementClick(xky, "设置备注和标签");846 // await elementClick(xky, "com.tencent.mm:id/b4w");847 // await findElementIput(xky, "com.tencent.mm:id/b4v", "");848 // await elementClick(xky, "完成");849 // await findUseFunction(xky, "com.tencent.mm:id/ki", "返回");850 }851 await xky.sleep(1000);852 }853 }854 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");855}856//添加通讯录857async function AddTxlFriend(xky, args, xutil, qqq) {858 await examineAddTxl(xky, args, xutil, qqq);859 await elementClick(xky, "com.tencent.mm:id/d7b");860 await elementClick(xky, "更多功能按钮");861 await elementClick(xky, "添加朋友");862 await elementClick(xky, "微信号/QQ号/手机号");863 let addNum = args.addNums;864 let cishu = 0;865 while (1) {866 cishu++;867 if (cishu > 10) {868 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");869 return 2;870 }871 //获取号码872 let getTxlNum = await contactGet(xky, xutil, qqq.data.data.id)//微信ID873 await findElementIput(xky, "com.tencent.mm:id/kh", getTxlNum.data.data.number);874 await elementClick(xky, "com.tencent.mm:id/mf");875 let isTxl = await getElementMassage(xky, "添加到通讯录", 5);876 if (isTxl) {877 let sssq = await contactFinish(xky, xutil, qqq.data.data.id, 1, getTxlNum.data.data.number)//type:1取备注编号 2完成添加 3拉黑,number:获取的号码878 //xky.log(sssq.data.data.id)879 await elementClick(xky, "设置备注和标签");880 await findElementIput(xky, "com.tencent.mm:id/b4v", `${getTxlNum.data.data.type}_${getTxlNum.data.data.city}_${sssq.data.data.id}`);881 await elementClick(xky, "保存");882 await elementClick(xky, "添加到通讯录");883 await elementClick(xky, "发送", 5);884 addNum--;885 if (addNum < 1) {886 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");887 return 1;888 }889 } else {890 await xky.sleep(2000);891 //不存在直接3拉黑892 // let sssq = await contactFinish(xky, xutil, qqq.data.data.id, 3, getTxlNum.data.data.number)//type:1取备注编号 2完成添加 3拉黑,number:获取的号码893 // xky.log(sssq)894 }895 await findUseFunction(xky, "com.tencent.mm:id/kh", "返回");896 await elementClick(xky, "微信号/QQ号/手机号", 1);897 }898}899900//综合红点(1)901async function wxhdss(xky, xutil) {902 await elementClick(xky, "com.tencent.mm:id/d7b");903 //是否有家人群904 let jiaruqun = await getElementMassage(xky, "家人", 5);905 if (jiaruqun) {906 if (jiaruqun.length > 1) {907 for (let i = 1; i < jiaruqun.length; i++) {908 await elementClick(xky, "家人", 5);909 await elementClick(xky, "com.tencent.mm:id/jy", 5);910 await rollFindElement(xky, "删除并退出", "xia", 5);911 await xky.sleep(2000);912 await elementClick(xky, "删除并退出");913 await elementClick(xky, "离开群聊", 3);914 await elementClick(xky, "确定", 3);915 await xky.sleep(2000);916 }917 }918 await elementClick(xky, "家人");919 var jiarensjs = await sjs(1, 2);920 switch (jiarensjs) {921 case 1:922 //文字923 var msg1 = await getPyqMsg(xky, xutil);924 await findElementIput(xky, "android.widget.EditText", msg1.data.data.content.substring(0, 15));925 await elementClick(xky, "发送", 3);926 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");927 break;928 case 2:929 //表情930 await elementClick(xky, "表情");931 await elementClick(xky, "系统表情");932 await xky.sleep(3 * 1000);933 await sjElementClick(xky, "com.tencent.mm:id/xs");934 await elementClick(xky, "发送", 3);935 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");936 break;937 }938 }939 while (1) {940 let fris = await elementClick(xky, "com.tencent.mm:id/mv", 5);941 if (!fris) {942 break;943 }944 let news = await elementClick(xky, "com.tencent.mm:id/a7b", 3);945 if (news) {946 await xky.sleep(5 * 1000);947 await xky.wheel(0.5, 0.5, -6); //往下滚动-2个位置948 await xky.sleep(2 * 1000);949 await xky.wheel(0.5, 0.5, -6); //往下滚动-2个位置950 await xky.sleep(2 * 1000);951 await xky.wheel(0.5, 0.5, -6); //往下滚动-2个位置952 await xky.sleep(2 * 1000);953 await xky.wheel(0.5, 0.5, -6); //往下滚动-2个位置954 await xky.sleep(2 * 1000);955 await xky.wheel(0.5, 0.5, -6); //往下滚动-2个位置956 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");957 }958 let friend = await elementClick(xky, "android.widget.EditText", 2);959 if (friend && !news) {960 var sjsa = await sjs(1, 2);961 switch (sjsa) {962 case 1:963 //文字964 var msg2 = await getPyqMsg(xky, xutil);965 await findElementIput(xky, "android.widget.EditText", msg2.data.data.content.substring(0, 15));966 await elementClick(xky, "发送", 3);967 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");968 break;969 case 2:970 //表情971 await elementClick(xky, "表情");972 await elementClick(xky, "系统表情");973 await xky.sleep(3 * 1000);974 await sjElementClick(xky, "com.tencent.mm:id/xs");975 await elementClick(xky, "发送", 3);976 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");977 break;978 }979 }980 if (!friend && !news) {981 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");982 }983 await xky.wheel(0.5, 0.5, -1); //往下滚动-2个位置984 await xky.sleep(2 * 1000);985 }986 //是否有人加我987 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");988 await elementClick(xky, "通讯录");989 let Addme = await elementClick(xky, "com.tencent.mm:id/brf", 3);990 if (Addme) {991 await xky.sleep(3000);992 let ffd = 0;993 while (1) {994 if (ffd > 1) {995 break;996 }997 let Add = await elementClick(xky, "com.tencent.mm:id/brs", 1);998 if (!Add) {999 break;1000 }1001 await elementClick(xky, "完成", 3);1002 await xky.sleep(3000);1003 await findUseFunction(xky, "添加朋友", "返回");1004 ffd++;1005 }1006 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");1007 }1008}10091010//收藏(1)1011async function collect(xky) {1012 await elementClick(xky, "com.tencent.mm:id/d7b");1013 await elementClick(xky, "腾讯新闻");1014 await elementClick(xky, "com.tencent.mm:id/an_");1015 await xky.sleep(3000);1016 await xky.wheel(0.5, 0.5, -6);//往下滚动-2个位置1017 await xky.sleep(3000);1018 await xky.wheel(0.5, 0.5, -6);//往下滚动-2个位置1019 await xky.sleep(3000);1020 await xky.wheel(0.5, 0.5, -6);//往下滚动-2个位置1021 await elementClick(xky, "更多");1022 await elementClick(xky, "收藏");1023 await elementClick(xky, "我知道了", 3);1024 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");1025}10261027//关注公众号(2)1028async function officialAccounts(xky, args, phone) {1029 //1030}10311032//删除公众号(2)1033async function delAccounts(xky, args, phone) {1034 //1035}10361037//建群聊(2)1038async function Jianqun(xky) {1039 await elementClick(xky, "com.tencent.mm:id/d7b");1040 let jiahanve = await elementClick(xky, "家人", 3);1041 if (jiahanve) {1042 xky.log("**家人群已存在,正在查看是否啦家人进群**");1043 await xky.sleep(2000);1044 let jiahanveob = await getElementMassage(xky, "com.tencent.mm:id/jw");1045 let shangxian = 9;1046 let nowpep = jiahanveob["0"].text.replace(/[^0-9]/ig, "");1047 if (nowpep < shangxian) {1048 xky.log(`现在有${nowpep}人,需要拉人`)1049 await elementClick(xky, "com.tencent.mm:id/jy");1050 await elementClick(xky, "添加成员");1051 await xky.sleep(2000);1052 let txzk = await getElementMassage(xky, "com.tencent.mm:id/zk");1053 for (let i = 0; i < txzk.length; i++) {1054 await elementClick(xky, "com.tencent.mm:id/zk", 1, i);1055 }1056 await xky.sleep(2000);1057 await elementClick(xky, "com.tencent.mm:id/jq");1058 await xky.sleep(3000);1059 await elementClick(xky, "确定");1060 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");1061 } else {1062 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");1063 }1064 } else {1065 await elementClick(xky, "通讯录");1066 await elementClick(xky, "群聊");1067 await elementClick(xky, "新群聊");10681069 let allPeople = await getElementMassage(xky, "com.tencent.mm:id/zk");1070 if (allPeople.length > 2) {1071 for (let i = 0; i < allPeople.length; i++) {1072 await coordinatesClick(xky, "com.tencent.mm:id/zk", allPeople[i].x, allPeople[i].y);1073 }1074 } else {1075 xky.log("***少于3人不能建群***")1076 xky.log("***少于3人不能建群***")1077 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");1078 return;1079 }1080 await elementClick(xky, "com.tencent.mm:id/jq");1081 let louser = await getElementMassage(xky, "发起群聊失败", 3);1082 if (louser) {1083 await elementClick(xky, "取消");1084 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");1085 return;1086 }1087 await elementClick(xky, "聊天信息");1088 await elementClick(xky, "群聊名称");1089 await findElementIput(xky, "android.widget.EditText", "家人");1090 await elementClick(xky, "保存");1091 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");1092 }1093}10941095//朋友圈(3)1096async function friendCircle(xky, args, xutil) {1097 //下载更新图片1098 let sjPic = await sjs(1, 774);1099 await xky.downloadFile(`friendPic/pyq (${sjPic}).jpg`, `/storage/emulated/0/Pictures/pyq (${sjPic}).jpg`);1100 await xky.insertMedia(`/storage/emulated/0/Pictures/pyq (${sjPic}).jpg`);1101 //创建消息1102 let sarss = "";1103 while (1) {1104 let sarArr = await getPyqMsg(xky, xutil);1105 if (sarArr.data.msg == "ok") {1106 sarss = sarArr.data.data.content;1107 break;1108 }1109 await xky.sleep(3000);1110 }1111 await elementClick(xky, "发现");1112 await elementClick(xky, "朋友圈");1113 await elementClick(xky, "拍照分享");1114 await elementClick(xky, "从相册选择");1115 await elementClick(xky, "我知道了", 2);1116 await elementClick(xky, "com.tencent.mm:id/e2a");1117 await elementClick(xky, "Pictures");1118 await elementClick(xky, "com.tencent.mm:id/bot");1119 await elementClick(xky, "com.tencent.mm:id/jx");1120 //随机消息1121 await findElementIput(xky, "这一刻的想法...", sarss);1122 await elementClick(xky, "发表");1123 //删除图片1124 await xky.delString(`/storage/emulated/0/Pictures/pyq (${sjPic}).jpg`);1125 //点赞留言1126 await xky.sleep(2 * 1000);1127 await zanAndSay(xky, xutil);1128}11291130//留言和点赞(3)1131async function zanAndSay(xky, xutil) {1132 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");1133}11341135//看一看阅读(3)1136async function lookRead(xky) {1137 await elementClick(xky, "发现");1138 await elementClick(xky, "看一看");1139 await elementClick(xky, "知道了", 3);1140 await elementClick(xky, "精选");1141 await xky.sleep(3 * 1000);1142 await xky.wheel(0.5, 0.5, -5);//往下滚动-2个位置1143 await xky.sleep(2 * 1000);1144 await xky.wheel(0.5, 0.5, -5);//往下滚动-2个位置1145 await xky.sleep(2 * 1000);1146 await sjXYClick(xky, "0.06|0.16", "0.84|0.90");1147 await sjXYClick(xky, "0.06|0.16", "0.84|0.90");1148 await sjXYClick(xky, "0.06|0.16", "0.84|0.90");1149 await xky.sleep(3 * 1000);1150 let sjs = await sjs(6, 10);1151 for (let i = 0; i < sjs; i++) {1152 await xky.sleep(1000);1153 await xky.wheel(0.5, 0.5, -3);//往下滚动-2个位置1154 }1155 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");1156}11571158//搜一搜搜索(3)1159async function SearchHotspot(xky) {1160 await elementClick(xky, "发现");1161 await elementClick(xky, "搜一搜");1162 let searchArr = ["", "美女", "化妆品", "衣服", "搭配", "鞋子", "外套", "明星", "读书", "潮男", "吃货"];1163 let sjs = await sjs(1, searchArr.length - 1);1164 await elementClick(xky, "允许", 3);1165 await findElementIput(xky, "android.widget.TextView", searchArr[sjs]);1166 let keyboard = await getElementMassage(xky, "com.android.inputmethod.latin:id/keyboard_view", 2);1167 if (!keyboard) {1168 await xky.showInputMethod();1169 await elementClick(xky, "英语(美国)");1170 }1171 await coordinatesClick(xky, "com.android.inputmethod.latin:id/keyboard_view", 0.92, 0.95);1172 await getElementMassage(xky, "android.widget.ListView");1173 let searchNo = ["", "公众号", "小程序", "文章", "音乐", "视频"];1174 let sjsNo = await sjs(1, 5);1175 await elementClick(xky, searchNo[sjsNo], 1);1176 await xky.sleep(3000);1177 await xky.wheel(0.5, 0.5, -5)1178 await xky.sleep(2000);1179 await xky.wheel(0.5, 0.5, -5)1180 await xky.sleep(5000);1181 while (1) {1182 await xky.sleep(2000);1183 await sjXYClick(xky, "0.03|0.03", "0.96|0.98");1184 await xky.sleep(2000);1185 await sjXYClick(xky, "0.03|0.03", "0.96|0.98");1186 let comeIn = await getElementMassage(xky, "com.tencent.mm:id/jy", 3);1187 let comeIn2 = await getElementMassage(xky, "android.widget.ImageButton", 1);1188 if (comeIn || comeIn2) {1189 break;1190 }1191 }1192 await xky.sleep(5000);1193 await xky.wheel(0.5, 0.5, -6)1194 await xky.sleep(3000);1195 await xky.wheel(0.5, 0.5, -6)1196 await xky.sleep(3000);1197 while (1) {1198 await xky.pressKey(4); //按下返回键1199 await xky.sleep(2 * 1000);1200 await elementClick(xky, "关闭", 1);1201 await elementClick(xky, "返回", 1);1202 let sss = await getElementMassage(xky, "com.tencent.mm:id/d7b", 1);1203 if (sss) {1204 break;1205 }1206 }1207}12081209//换头像(4)1210async function exchangeHeaderPic(xky) {1211 //下载更新图片1212 let sjPic = await sjs(1, 1620);1213 await xky.downloadFile(`herdpics/touxiang (${sjPic}).jpg`, `/storage/emulated/0/headpics/pyq (${sjPic}).jpg`);1214 await xky.insertMedia(`/storage/emulated/0/headpics/pyq (${sjPic}).jpg`);1215 await elementClick(xky, "我");1216 await elementClick(xky, "com.tencent.mm:id/py");1217 await elementClick(xky, "头像");1218 await elementClick(xky, "所有图片");1219 await elementClick(xky, "headpics");1220 await elementClick(xky, "com.tencent.mm:id/dkb");1221 await elementClick(xky, "使用");1222 //删除图片1223 await xky.delString(`/storage/emulated/0/headpics/pyq (${sjPic}).jpg`);1224 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");1225}12261227//个性签名(4)1228async function autograph(xky, xutil) {1229 await elementClick(xky, "我");1230 await elementClick(xky, "com.tencent.mm:id/py");1231 await elementClick(xky, "更多");1232 await elementClick(xky, "个性签名");12331234 let psArr = "";1235 while (1) {1236 let sarArr = await getPyqMsg(xky, xutil);1237 if (sarArr.data.msg == "ok") {1238 psArr = sarArr.data.data.content.substring(0, 29);1239 break;1240 }1241 await xky.sleep(3000);1242 }1243 await findElementIput(xky, "com.tencent.mm:id/lk", psArr);1244 await elementClick(xky, "保存", 1);1245 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");1246}12471248//下载表情(4)1249async function LowerExpression(xky) {1250 await elementClick(xky, "我");1251 await elementClick(xky, "表情");1252 await elementClick(xky, "更多表情");1253 await xky.sleep(2 * 1000);1254 let sjweizhi = await sjs(1, 5);1255 for (let i = 0; i < sjweizhi; i++) {1256 await xky.wheel(0.5, 0.5, -5);//往下滚动-2个位置1257 await xky.sleep(2 * 1000);1258 }1259 await sjElementClick(xky, "com.tencent.mm:id/bdc");1260 await elementClick(xky, "添加");1261 await getElementMassage(xky, "发表情");1262 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");1263}12641265//随机朋友圈可见时间(4)1266async function friendLookTome(xky) {1267 await elementClick(xky, "我");1268 await elementClick(xky, "设置");1269 await elementClick(xky, "隐私");1270 //总选项1271 let allTimeArr = ["最近半年", "最近三天", "全部"]1272 let nowSetArr = await getElementMassage(xky, "android:id/summary");1273 //剩余选项1274 let aa = [];1275 for (let i = 0; i < allTimeArr.length; i++) {1276 if (allTimeArr[i] != nowSetArr[1].text) {1277 aa.push(allTimeArr[i])1278 }1279 }1280 await elementClick(xky, "允许朋友查看朋友圈的范围");1281 let sjs = await sjs(0, 1);1282 if (sjs) {1283 await elementClick(xky, aa[sjs]);1284 } else {1285 await elementClick(xky, aa[0]);1286 }1287 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");1288}12891290//关闭/开启手机加好友(4)1291async function closePhoneAddFriend(xky, closeOrOpen) {1292 await elementClick(xky, "我");1293 await elementClick(xky, "设置");1294 await elementClick(xky, "隐私");1295 await elementClick(xky, "添加我的方式");1296 let phonePosition = await getElementMassage(xky, "com.tencent.mm:id/j7");1297 switch (closeOrOpen) {1298 case "close":1299 if (phonePosition[1].contentDesc == "已开启") {1300 await elementClick(xky, "com.tencent.mm:id/j7", 1, 1);1301 } else {1302 await xky.toast('该功能已经关闭');1303 xky.log('该功能已经关闭');1304 }1305 break;1306 case "open":1307 if (phonePosition[1].contentDesc == "已关闭") {1308 await elementClick(xky, "com.tencent.mm:id/j7", 1, 1);1309 } else {1310 await xky.toast('该功能已经开启');1311 xky.log('该功能已经开启');1312 }1313 break;1314 }1315 await findUseFunction(xky, "com.tencent.mm:id/d7b", "返回");1316}13171318//关注小程序(5)1319async function miniProgram(xky, args, xutil) {1320 //1321}13221323//绑定APP(5)1324async function wechatLogin(xky, args, xutil) {1325 //1326}13271328//2019/03/251329//下载图片1330//let sjPic = await sjs(1, 774);1331//await xky.downloadFile(`friendPic/pyq ${sjPic}.jpg`, `/storage/emulated/0/Pictures/pyq ${sjPic}.jpg`);13321333//更新图库1334//await xky.insertMedia(`/storage/emulated/0/Pictures/pyq ${sjPic}.jpg`);13351336//删除图片1337//await xky.delString(`/storage/emulated/0/Pictures/pyq ${sjPic}.jpg`);13381339//获取元素信息 >>必须找到,限时查找,限时查找第index-1个元素(从0开始的)1340// let elmArr = await getElementMassage(xky,"微信");1341// let elmArr = await getElementMassage(xky,"微信", 1);1342// let elmArr = await getElementMassage(xky,"微信", 1, index);1343// xky.log(elmArr);13441345//随机数1346// let sjss = await sjs(1, 24);1347// xky.log(sjss);13481349//数组打乱随机 >>传入数组1350// let arrays = await upsetArray(oldArray)13511352//元素点击 >>必须点,限时x秒内点击,限时x秒内点击第index个元素(下标0为第一个)1353// await elementClick(xky,"注册");1354// await elementClick(xky,"注册", x);1355// await elementClick(xky,"注册", x, index);13561357//正则点击1358// await regularClick(xky, element);1359// await regularClick(xky, element,index);13601361//坐标点击1362// await coordinatesClick(xky,"com.android.documentsui:id/icon_thumb", x, y);13631364//随机点击元素其中一个 >>返回点击的元素1365//await sjElementClick(xky,"注册");13661367//随机范围点击 >>点击并返回随机坐标1368// let qqq = await sjXYClick(xky,"minX|minY" ,"maxX|maxY");1369//xky.log(qqq);13701371//长按控制 >>长按复制,长按粘贴1372// await longCopyPaste(xky,"注册", "copy",);1373// await longCopyPaste(xky,"注册", "paste");13741375//找到元素输入 >>timer限时找到输入1376// await findElementIput(xky,"请填写手机号", phone);1377// await findElementIput(xky,"请填写手机号", phone,timer);13781379//使用方法找到元素 >>方法(如前进,返回,后退等)1380//await findUseFunction(xky,"首页", "方法");13811382//滚动查找元素 >>已num格的速度查找1383// await rollFindElement(xky,"延展阅读", "xia/shang",num);13841385//查找元素超时报错 >>data报错内容传什么数据都行,超出60秒报错1386//let qqq = await FindElementTimeout(xky,"首页",data,60);1387//xky.log(qqq);13881389//生成随机字符串 >>长度51390// let qqq = await randomString(5);1391// xky.log(qqq);13921393//创建插槽 >>传入包名,插槽码长度15,返回插槽码1394// let qqq = await creatSlot(xky,"com.tencent.mm",15);1395// xky.log(qqq);13961397// 微信滑动拼图1398// await slideWecatJigsaw(xky,"tcaptcha_drag_thumb");13991400//随机生成姓名(本地) >>返回姓名1401//let qqq = await getName();1402//xky.log(qqq);14031404//获取实名信息1405// let RealNameInformation = await xutil.http.get("http://119.23.32.104:91/com/get/real");1406// xky.log(RealNameInformation);14071408//接口批量生成添加联系人 >>生成5个,返回联系人数组1409//let qqq = await toLeadInsCon(xky,xutil,5);1410//xky.log(qqq);14111412//设置触动精灵代理 >>1开启,2关闭,3设置地区,4设置账号1413//await setChuDong(xky, args, xutil, 1, "绵阳");14141415//数据存储 >>新号ID为空"", 更新时必须填1416//let qqq = await saveData(xky, xutil, appName,id,depot,account,password,mobile,nickname,rawid,city,extend);1417//xky.log(qqq);14181419// 获取APP库号1420// let qqq = await getDepot(xky,xutil,app);1421// xky.log(qqq);14221423// 获取数据1424// let qqq = await getData(xky,xutil,app,depot);1425// xky.log(qqq);14261427//活跃完成通知1428//let qqq = await upData(xky, xutil,id);1429//xky.log(qqq);14301431//数据冻结1432//let qqq = await dataFrozen(xky, xutil,id);1433//xky.log(qqq);14341435//获取内部好友数据1436// let qqq = await getInteriorFriendData(xky,xutil,app,depot,id);1437// xky.log(qqq);14381439//重置活跃1440//let qqq = await resetActive(xky,xutil,id);1441//xky.log(qqq);14421443//重置库活跃1444//let qqq = await resetDepot(xky,xutil,depot);1445//xky.log(qqq);14461447//ip查询1448//let qqq = await ipWhere(xky,xutil,ip,type);1449//xky.log(qqq);14501451//获取代理1452//let qqq = await getAgency(xky, xutil, city);1453//xky.log(qqq);14541455//获取回复内容1456//let qqq = await replyMessage(xky,xutil,id,msg);1457//xky.log(qqq);14581459//获取任务1460//let qqq = await getTask(xky,xutil,id);1461//xky.log(qqq);14621463//提交任务 >>taskid任务ID,extend扩展可为空1464//let qqq = await taskFinish(xky,xutil,id,taskid,extend);1465//xky.log(qqq);14661467//活跃存取状态 >>field名称自己取名,存数据才填value1468// let qqq = await activeSaveGet(xky, xutil, id, field, value);1469// xky.log(qqq);14701471//通讯录取号 >>微信ID1472// let qqq = await contactGet(xky, xutil, id);1473// xky.log(qqq);14741475//通讯录处理 >>type:1取备注编号 2完成添加 3拉黑,number:获取的号码1476// let qqq = await contactFinish(xky, xutil, id, type, number);1477// xky.log(qqq);14781479//通讯录检查 >>id:微信ID1480// let qqq = await contactCheck(xky, xutil, id);1481// xky.log(qqq);14821483//获取昵称 >>cn中文,en英文1484//let qqq = await getNikeName(xky,xutil,"cn/en");1485//xky.log(qqq);14861487//归属地查询1488//let qqq = await phoneWhere(xky,xutil,phone);1489//xky.log(qqq);14901491//设置定位 >>根据当前IP完成定位,返回坐标1492//let qqq = await setLocations(xky);1493//xky.log(qqq);14941495//网络检测 >>传入当前ip1496//let qqq = await networkDetection(xky,ip);1497//xky.log(qqq);14981499//获取头像1500//let qqq = await getHeadPic(xky,,xutil);1501//xky.log(qqq);15021503//获取朋友圈内容1504//let qqq = await getPyqMsg(xky,xutil);1505//xky.log(qqq);15061507//上传插槽到本地服务器 >>服务器文件名,包名,插槽名1508//await uplondWeFile(xky, "WeChat", "com.tencent.mm", "dfhfh2557114");15091510//从本地服务器下载插槽到矿机 >>服务器文件名,包名,插槽名1511//await donwlondWeFile(xky, "WeChat", "com.tencent.mm", "dfhfh2557114");1512//======================================================================1513//获取元素信息1514async function getElementMassage(xky, element, timer, nums) {1515 while (1) {1516 let elementObj = await xky.findUiObjects(element);1517 let elementArr = elementObj.uiObjects;1518 if (elementArr != "") {1519 if (timer) {1520 if (nums || nums >= 0) {1521 return elementArr[nums];1522 }1523 return elementArr;1524 }1525 return elementArr;1526 } else {1527 if (timer) {1528 await xky.sleep(1000);1529 timer--;1530 if (timer < 1) {1531 break;1532 }1533 } else {1534 await xky.sleep(1000);1535 }1536 }1537 }1538}15391540//随机数1541async function sjs(min, max) {1542 return parseInt(Math.random() * (max - min + 1) + min, 10);1543}15441545//数组打乱随机1546async function upsetArray(oldarray) {1547 let pos = oldarray.length, i;1548 while (pos) {1549 i = (Math.random() * pos--) >>> 0;1550 [oldarray[pos], oldarray[i]] = [oldarray[i], oldarray[pos]]1551 }1552 return oldarray;1553}15541555//元素点击1556async function elementClick(xky, element, timer, nums) {1557 if (timer) {1558 if (nums) {1559 let qqq = await getElementMassage(xky, element, timer, nums);1560 if (qqq) {1561 await xky.findAndClick(element, { index: nums });1562 return qqq;1563 }1564 }1565 let qqq = await getElementMassage(xky, element, timer);1566 if (qqq) {1567 await xky.findAndClick(element);1568 return qqq;1569 }1570 } else {1571 let qqq = await getElementMassage(xky, element);1572 await xky.findAndClick(element);1573 return qqq;1574 }1575}15761577//正则点击1578async function regularClick(xky, element, ind) {1579 while (1) {1580 let qqq = await xky.findUiObjects(element, { regex: true, timeout: 1000 });1581 if (qqq.uiObjects != "") {1582 if (qqq.uiObjects[0].contentDesc == "") {1583 if (ind) {1584 await xky.findAndClick(qqq.uiObjects[ind].text);1585 return qqq.uiObjects;1586 }1587 await xky.findAndClick(qqq.uiObjects["0"].text);1588 return qqq.uiObjects;1589 } else {1590 if (ind) {1591 await xky.findAndClick(qqq.uiObjects[ind].contentDesc);1592 return qqq.uiObjects;1593 }1594 await xky.findAndClick(qqq.uiObjects["0"].contentDesc);1595 return qqq.uiObjects;1596 }1597 }1598 }1599}16001601//坐标点击1602async function coordinatesClick(xky, element, x, y) {1603 await getElementMassage(xky, element);1604 await xky.click(x, y);1605}16061607//随机点击元素其中一个1608async function sjElementClick(xky, element) {1609 let qqq = await getElementMassage(xky, element);1610 let sjsEl = await sjs(0, qqq.length - 1);1611 await xky.findAndClick(element, { index: sjsEl });1612 return qqq[sjsEl];1613}16141615//随机范围点击1616async function sjXYClick(xky, minXY, maxXY) {1617 let [minX, minY] = minXY.split("|");1618 let [maxX, maxY] = maxXY.split("|");1619 let X = await sjs(xky, minX * 100, maxX * 100);1620 let Y = await sjs(xky, minY * 100, maxY * 100);1621 await xky.click(X / 100, Y / 100);1622 return {1623 x: X / 100,1624 y: Y / 1001625 }1626}16271628//长按控制1629async function longCopyPaste(xky, element, copyOrPaste) {1630 let elmArr = await getElementMassage(xky, element);1631 if (copyOrPaste == "copy") {1632 await xky.mousedown(elmArr[0].x - 0.1, elmArr[0].y);1633 await elementClick(xky, "全选");1634 await xky.sleep(1000);1635 await xky.copy()1636 } else {1637 await elementClick(xky, element);1638 await xky.paste();1639 }1640}16411642//找到元素输入1643async function findElementIput(xky, element, inp, timer) {1644 if (timer) {1645 let elementTimer = await getElementMassage(xky, element, timer);1646 if (elementTimer) {1647 await xky.findAndInput(element, inp);1648 return elementTimer;1649 }1650 } else {1651 let qqq = await getElementMassage(xky, element);1652 await xky.findAndInput(element, inp);1653 return qqq;1654 }1655}16561657//使用方法找到元素1658async function findUseFunction(xky, element, fun) {1659 while (1) {1660 let elmArr = await getElementMassage(xky, element, 1);1661 if (elmArr) {1662 return elmArr;1663 }1664 await elementClick(xky, fun, 2);1665 await xky.sleep(1000);1666 }1667}16681669//滚动查找元素1670async function rollFindElement(xky, element, direction, speed, timer) {1671 while (1) {1672 let elmArr = await getElementMassage(xky, element, 1);1673 if (elmArr) {1674 return elmArr;1675 }1676 if (direction == "xia") {1677 await xky.wheel(0.5, 0.5, -speed);1678 } else {1679 await xky.wheel(0.5, 0.5, speed);1680 }1681 if (timer) {1682 timer--;1683 if (timer < 1) {1684 return "查找超时";1685 }1686 }1687 }1688}16891690//查找元素超时报错1691async function FindElementTimeout(xky, element, data, timer) {1692 let startTime = new Date();1693 while (1) {1694 let elmArr = await getElementMassage(xky, element, 1);1695 if (elmArr) {1696 await xky.sleep(1000);1697 return elmArr;1698 } else {1699 let endTime = new Date();1700 let useTime = endTime - startTime;1701 if (useTime > timer * 1000) {1702 xky.log("***************查找此元素超过限定时间,请检查账号情况和代码情况***************")1703 xky.log(data)1704 xky.log("***************查找此元素超过限定时间,请检查账号情况和代码情况***************")1705 return;1706 }1707 }1708 }1709}17101711//生成随机字符串1712async function randomString(long) {1713 let len = long;1714 let chars = "abcdefhijkmnprstwxyz1234567890"; //默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I11715 let maxPos = chars.length;1716 let pwd = "";1717 for (let i = 0; i < len; i++) {1718 pwd += chars.charAt(Math.floor(Math.random() * maxPos));1719 }1720 return pwd;1721}17221723//创建插槽1724async function creatSlot(xky, PackageName, long) {1725 let randomStringcode = await randomString(long);//长度51726 while (1) {1727 let qqq = await xky.createAppSnapshot(PackageName, randomStringcode);1728 if (qqq.msg == "快照创建成功") {1729 return randomStringcode;1730 } else {1731 await xky.sleep(1000);1732 }1733 }1734}17351736//微信滑动拼图1737async function slideWecatJigsaw(xky, element) {1738 let qqq = await getElementMassage(xky, element);1739 while (1) {1740 await xky.sleep(1000);1741 await xky.swipe(0.2, 0.54, 0.8, 0.54, 60);1742 await xky.sleep(1000);1743 qqq = await getElementMassage(xky, element, 2);1744 if (qqq) {1745 await xky.swipe(0.2, 0.54, 0.7, 0.54, 60);1746 await xky.sleep(1000);1747 qqq = await getElementMassage(xky, element, 2);1748 if (qqq) {1749 await xky.swipe(0.2, 0.54, 0.75, 0.54, 60);1750 await xky.sleep(1000);1751 } else {1752 break;1753 }1754 } else {1755 break;1756 }1757 }1758}17591760//随机生成姓名(本地)1761async function getName() {1762 var familyNames = new Array(1763 "赵", "钱", "孙", "李", "周", "吴", "郑", "王", "冯", "陈",1764 "褚", "卫", "蒋", "沈", "韩", "杨", "朱", "秦", "尤", "许",1765 "何", "吕", "施", "张", "孔", "曹", "严", "华", "金", "魏",1766 "陶", "姜", "戚", "谢", "邹", "喻", "柏", "水", "窦", "章",1767 "云", "苏", "潘", "葛", "奚", "范", "彭", "郎", "鲁", "韦",1768 "昌", "马", "苗", "凤", "花", "方", "俞", "任", "袁", "柳",1769 "酆", "鲍", "史", "唐", "费", "廉", "岑", "薛", "雷", "贺",1770 "倪", "汤", "滕", "殷", "罗", "毕", "郝", "邬", "安", "常",1771 "乐", "于", "时", "傅", "皮", "卞", "齐", "康", "伍", "余",1772 "元", "卜", "顾", "孟", "平", "黄", "和", "穆", "萧", "尹"1773 );1774 var givenNames = new Array(1775 "子璇", "淼", "国栋", "夫子", "瑞堂", "甜", "敏", "尚", "国贤", "贺祥", "晨涛",1776 "昊轩", "易轩", "益辰", "益帆", "益冉", "瑾春", "瑾昆", "春齐", "杨", "文昊",1777 "东东", "雄霖", "浩晨", "熙涵", "溶溶", "冰枫", "欣欣", "宜豪", "欣慧", "建政",1778 "美欣", "淑慧", "文轩", "文杰", "欣源", "忠林", "榕润", "欣汝", "慧嘉", "新建",1779 "建林", "亦菲", "林", "冰洁", "佳欣", "涵涵", "禹辰", "淳美", "泽惠", "伟洋",1780 "涵越", "润丽", "翔", "淑华", "晶莹", "凌晶", "苒溪", "雨涵", "嘉怡", "佳毅",1781 "子辰", "佳琪", "紫轩", "瑞辰", "昕蕊", "萌", "明远", "欣宜", "泽远", "欣怡",1782 "佳怡", "佳惠", "晨茜", "晨璐", "运昊", "汝鑫", "淑君", "晶滢", "润莎", "榕汕",1783 "佳钰", "佳玉", "晓庆", "一鸣", "语晨", "添池", "添昊", "雨泽", "雅晗", "雅涵",1784 "清妍", "诗悦", "嘉乐", "晨涵", "天赫", "玥傲", "佳昊", "天昊", "萌萌", "若萌"1785 );1786 var i = parseInt(10 * Math.random()) * 10 + parseInt(10 * Math.random());1787 var familyName = familyNames[i];1788 var j = parseInt(10 * Math.random()) * 10 + parseInt(10 * Math.random());1789 var givenName = givenNames[i];1790 var name = familyName + givenName;1791 return name;1792}17931794//接口批量生成联系人1795async function toLeadInsCon(xky, xutil, num) {1796 let PhoneNums = await xutil.http.get(`http://192.168.2.216:8090/sou/mobelRand?num=${num}`)1797 //创建收集器1798 let AllMassage = [];1799 let NumArr = PhoneNums.data.split(",")1800 for (let i = 0; i < NumArr.length - 1; i++) {1801 let EmpretMassage = { name: "", number: "" }1802 EmpretMassage.name = await getName();1803 EmpretMassage.number = NumArr[i];1804 AllMassage.push(EmpretMassage)1805 }1806 await xky.insertContacts(AllMassage);1807 return AllMassage;1808}18091810//设置触动精灵代理1811async function setChuDong(xky, args, xutil, stats, loc) {1812 var locitionNum = {1813 "上海": 1, "北京": 2, "天津": 16, "重庆": 10, "苏州": 17, "南京": 20, "无锡": 21, "南通": 31, "徐州": 40, "常州": 41,1814 "连云港": 81, "淮安": 82, "盐城": 83, "扬州": 84, "镇江": 85, "泰州": 86, "宿迁": 87, "杭州": 12, "宁波": 23, "温州": 42,1815 "绍兴": 43, "嘉兴": 88, "湖州": 89, "金华": 90, "衢州": 91, "舟山": 92, "台州": 93, "丽水": 94, "青岛": 11, "烟台": 27,1816 "济南": 28, "潍坊": 39, "济宁": 45, "淄博": 46, "枣庄": 113, "东营": 114, "泰安": 115, "威海": 116, "日照": 117,1817 "临沂": 118, "德州": 119, "聊城": 120, "滨州": 121, "菏泽": 122, "厦门": 13, "泉州": 30, "福州": 36, "莆田": 102,1818 "三明": 103, "漳州": 104, "南平": 105, "龙岩": 106, "宁德": 107, "唐山": 32, "石家庄": 38, "秦皇岛": 48, "邯郸": 49,1819 "邢台": 50, "保定": 51, "张家口": 52, "承德": 53, "沧州": 54, "廊坊": 55, "衡水": 56, "深圳": 9, "广州": 15, "佛山": 22,1820 "东莞": 29, "韶关": 152, "珠海": 153, "汕头": 154, "江门": 155, "湛江": 156, "茂名": 157, "肇庆": 158, "惠州": 159,1821 "梅州": 160, "汕尾": 161, "河源": 162, "阳江": 163, "清远": 164, "中山": 165, "潮州": 166, "揭阳": 167, "云浮": 168,1822 "武汉": 18, "黄石": 134, "十堰": 135, "宜昌": 136, "孝感": 137, "荆州": 138, "黄冈": 139, "成都": 19, "泸州": 178,1823 "德阳": 179, "绵阳": 180, "乐山": 181, "南充": 182, "眉山": 183, "宜宾": 184, "大连": 24, "沈阳": 26, "鞍山": 72,1824 "抚顺": 73, "锦州": 74, "盘锦": 75, "郑州": 25, "开封": 123, "洛阳": 124, "平顶山": 125, "安阳": 126, "新乡": 127,1825 "焦作": 128, "许昌": 129, "南阳": 130, "商丘": 131, "信阳": 132, "周口": 133, "西安": 33, "宝鸡": 199, "咸阳": 200,1826 "渭南": 201, "安康": 202, "哈尔滨": 34, "大庆": 47, "齐齐哈尔": 79, "牡丹江": 80, "合肥": 35, "芜湖": 95, "蚌埠": 96,1827 "马鞍山": 97, "淮北": 98, "安庆": 99, "滁州": 100, "六安": 101, "长春": 37, "吉林": 76, "四平": 77, "延边": 78,1828 "鄂尔多斯": 44, "呼和浩特": 65, "包头": 66, "赤峰": 67, "通辽": 68, "呼伦贝尔": 69, "巴彦淖尔": 70, "乌兰察布": 71,1829 "太原": 57, "大同": 58, "阳泉": 59, "长治": 60, "晋中": 61, "运城": 62, "忻州": 63, "临汾": 64, "南昌": 108, "赣州": 109,1830 "吉安": 110, "抚州": 111, "上饶": 112, "长沙": 140, "株洲": 141, "湘潭": 142, "衡阳": 143, "邵阳": 144, "岳阳": 145, "常德": 146,1831 "张家界": 147, "益阳": 148, "郴州": 149, "怀化": 150, "娄底": 151, "南宁": 169, "柳州": 170, "桂林": 171, "梧州": 172, "北海": 173,1832 "贵港": 174, "玉林": 175, "百色": 176, "海口": 177, "贵阳": 185, "遵义": 186, "黔东南": 187, "昆明": 188, "曲靖": 189, "玉溪": 190,1833 "保山": 191, "临沧": 192, "楚雄": 193, "红河": 194, "文山": 195, "西双版纳": 196, "大理": 197, "德宏": 198, "兰州": 203,1834 "西宁": 204, "乌鲁木齐": 205, "昌吉": 206, "巴音郭楞": 207, "伊犁": 2081835 }1836 let [usesIp, ewmArr] = ["", ""];1837 var ewmArr1 = await getElementMassage(xky, "start.lua", 3);1838 if (!ewmArr1) {1839 while (1) {1840 await xky.restartApp('com.touchsprite.android');1841 await elementClick(xky, "重新打开应用", 3);1842 await elementClick(xky, "知道了", 3);1843 var closeAPP = await elementClick(xky, "关闭应用", 3);1844 if (closeAPP) {1845 await xky.restartApp('com.touchsprite.android');1846 await elementClick(xky, "重新打开应用", 3);1847 }1848 var kkk = await elementClick(xky, "忽略此版本", 3);1849 if (kkk) {1850 await elementClick(xky, "com.touchsprite.android:id/iv_experience");1851 await elementClick(xky, "com.touchsprite.android:id/title_bar_tv_left");1852 await elementClick(xky, "我的账号");1853 await rollFindElement(xky, "自动检测更新", "xia", 5);1854 await elementClick(xky, "自动检测更新");1855 await elementClick(xky, "com.touchsprite.android:id/more_sb_service_switch");1856 await elementClick(xky, "com.touchsprite.android:id/title_bar_tv_left");1857 await elementClick(xky, "我的脚本");1858 }1859 var ewmArrqqq = await getElementMassage(xky, "start.lua", 3);1860 if (ewmArrqqq) {1861 ewmArr = ewmArrqqq;1862 break;1863 }1864 }1865 } else {1866 ewmArr = ewmArr1;1867 }1868 switch (stats) {1869 case 1:1870 await elementClick(xky, "start.lua");1871 while (1) {1872 await coordinatesClick(xky, "com.touchsprite.android:id/image_file_arrows2", 0.95, ewmArr["0"].y);1873 await elementClick(xky, "立即运行");1874 var ffff = await getElementMassage(xky, "com.touchsprite.android:id/text_main");1875 var ipwherre = await ipWhere(xky, xutil, ffff["0"].text.split("IP: ")[1], 1);1876 xky.log(`${ffff["0"].text}的地区为:${ipwherre.data.data.city}`);1877 var bb = ipwherre.data.data.city.indexOf(loc)1878 if (bb >= 0) {1879 usesIp = ffff["0"].text.split("IP: ")[1];1880 break;1881 } else {1882 var iploser = ffff["0"].text.indexOf("string")1883 if (iploser >= 0) {1884 await elementClick(xky, "确定", 2);1885 }1886 }1887 }1888 await elementClick(xky, "确定", 2);1889 return usesIp;1890 case 2:1891 await elementClick(xky, "stop.lua");1892 var ewmArre = await getElementMassage(xky, "stop.lua");1893 await coordinatesClick(xky, "com.touchsprite.android:id/image_file_arrows2", 0.95, ewmArre["0"].y);1894 await elementClick(xky, "立即运行");1895 await xky.sleep(2000)1896 break;1897 case 3:1898 await xky.mousedown(ewmArr["0"].x, ewmArr["0"].y);1899 await elementClick(xky, "编辑");1900 var jpyn = await getElementMassage(xky, "com.android.inputmethod.latin:id/keyboard_view", 3);1901 if (jpyn) {1902 await xky.showInputMethod();1903 await elementClick(xky, "X输入法");1904 }1905 await xky.sleep(2000);1906 await xky.mousedown(0.60, 0.57);1907 await xky.sleep(2000);1908 await xky.setClipboardText(locitionNum[loc]);1909 await xky.paste();1910 var ccc = await elementClick(xky, "保存", 2);1911 if (!ccc) {1912 await elementClick(xky, "com.touchsprite.android:id/title_bar_tv_left");1913 }1914 break;1915 case 4:1916 await xky.mousedown(ewmArr["0"].x, ewmArr["0"].y);1917 await elementClick(xky, "编辑");1918 var jpyn2 = await getElementMassage(xky, "com.android.inputmethod.latin:id/keyboard_view", 3);1919 if (jpyn2) {1920 await xky.showInputMethod();1921 await elementClick(xky, "X输入法");1922 }1923 var userVpnObj = [{1924 users: "b819deee8d17ed1022f4281c4240584a",1925 password: "7eb3e95a8d4dfb67b36560ed9d6dd4ee"1926 }, {1927 users: "494ffbb1c3d2c55b523acd11ddefa0dd",1928 password: "779f9871aafe9a4d0423d6da7377d89f"1929 }, {1930 users: "f11f5dfd7b8726d9a795dbc1000e8840",1931 password: "9198ae0cedf91137086283abacbb8145"1932 }]1933 if (!args.setChuDongUser) {1934 xky.log("******请先配置参数才能选择账号******")1935 xky.log("******参数为:账号一账号二账号三******")1936 xky.log("******请先配置参数才能选择账号******")1937 }1938 await xky.mousedown(0.54, 0.27);1939 await xky.sleep(3000);1940 switch (args.setChuDongUser) {1941 case "账号一":1942 await xky.setClipboardText(userVpnObj["0"].users);1943 await xky.paste();1944 await xky.sleep(2000);1945 await xky.mousedown(0.56, 0.30);1946 await xky.sleep(2000);1947 await xky.setClipboardText(userVpnObj["0"].password);1948 await xky.paste();1949 break;1950 case "账号二":1951 await xky.setClipboardText(userVpnObj["1"].users);1952 await xky.paste();1953 await xky.sleep(2000);1954 await xky.mousedown(0.56, 0.30);1955 await xky.sleep(2000);1956 await xky.setClipboardText(userVpnObj["1"].password);1957 await xky.paste();1958 break;1959 case "账号三":1960 await xky.setClipboardText(userVpnObj["2"].users);1961 await xky.paste();1962 await xky.sleep(2000);1963 await xky.mousedown(0.56, 0.30);1964 await xky.sleep(2000);1965 await xky.setClipboardText(userVpnObj["2"].password);1966 await xky.paste();1967 break;1968 }1969 var www = await elementClick(xky, "保存", 3);1970 if (!www) {1971 await elementClick(xky, "com.touchsprite.android:id/title_bar_tv_left");1972 }1973 break;1974 }1975}19761977//数据存储1978async function saveData(xky, xutil, appName, id, depot, account, password, mobile, nickname, rawid, city,extend) {1979 let oldData = {1980 app: appName,//APP编号1981 id: id, //新号不填, 更新时必须填1982 depot: depot, //库号,这个应该在界面上可以填写,不是写死的1983 account: account, //微信账号没有可以不填1984 password: password,//密码1985 mobile: mobile,//手机 ...

Full Screen

Full Screen

nvD3Events.js

Source:nvD3Events.js Github

copy

Full Screen

1function processEvents(chart, scope) {2 if (chart.dispatch) {3 if (chart.dispatch.tooltipShow) {4 chart.dispatch.on('tooltipShow.directive', function (event) {5 scope.$emit('tooltipShow.directive', event);6 });7 }8 if (chart.dispatch.tooltipHide) {9 chart.dispatch.on('tooltipHide.directive', function (event) {10 scope.$emit('tooltipHide.directive', event);11 });12 }13 if (chart.dispatch.beforeUpdate) {14 chart.dispatch.on('beforeUpdate.directive', function (event) {15 scope.$emit('beforeUpdate.directive', event);16 });17 }18 if (chart.dispatch.stateChange) {19 chart.dispatch.on('stateChange.directive', function (event) {20 scope.$emit('stateChange.directive', event);21 });22 }23 if (chart.dispatch.changeState) {24 chart.dispatch.on('changeState.directive', function (event) {25 scope.$emit('changeState.directive', event);26 });27 }28 }29 if (chart.lines) {30 chart.lines.dispatch.on('elementMouseover.tooltip.directive', function (event) {31 scope.$emit('elementMouseover.tooltip.directive', event);32 });33 chart.lines.dispatch.on('elementMouseout.tooltip.directive', function (event) {34 scope.$emit('elementMouseout.tooltip.directive', event);35 });36 chart.lines.dispatch.on('elementClick.directive', function (event) {37 scope.$emit('elementClick.directive', event);38 });39 }40 if (chart.stacked && chart.stacked.dispatch) {41 chart.stacked.dispatch.on('areaClick.toggle.directive', function (event) {42 scope.$emit('areaClick.toggle.directive', event);43 });44 chart.stacked.dispatch.on('tooltipShow.directive', function (event) {45 scope.$emit('tooltipShow.directive', event);46 });47 chart.stacked.dispatch.on('tooltipHide.directive', function (event) {48 scope.$emit('tooltipHide.directive', event);49 });50 }51 if (chart.interactiveLayer) {52 if (chart.interactiveLayer.elementMouseout) {53 chart.interactiveLayer.dispatch.on('elementMouseout.directive', function (event) {54 scope.$emit('elementMouseout.directive', event);55 });56 }57 if (chart.interactiveLayer.elementMousemove) {58 chart.interactiveLayer.dispatch.on('elementMousemove.directive', function (event) {59 scope.$emit('elementMousemove.directive', event);60 });61 }62 }63 if (chart.discretebar) {64 chart.discretebar.dispatch.on('elementMouseover.tooltip.directive', function (event) {65 scope.$emit('elementMouseover.tooltip.directive', event);66 });67 chart.discretebar.dispatch.on('elementMouseout.tooltip.directive', function (event) {68 scope.$emit('elementMouseover.tooltip.directive', event);69 });70 chart.discretebar.dispatch.on('elementClick.directive', function (event) {71 scope.$emit('elementClick.directive', event);72 });73 }74 if (chart.multibar) {75 chart.multibar.dispatch.on('elementMouseover.tooltip.directive', function (event) {76 scope.$emit('elementMouseover.tooltip.directive', event);77 });78 chart.multibar.dispatch.on('elementMouseout.tooltip.directive', function (event) {79 scope.$emit('elementMouseover.tooltip.directive', event);80 });81 chart.multibar.dispatch.on('elementClick.directive', function (event) {82 scope.$emit('elementClick.directive', event);83 });84 }85 if (chart.pie) {86 chart.pie.dispatch.on('elementMouseover.tooltip.directive', function (event) {87 scope.$emit('elementMouseover.tooltip.directive', event);88 });89 chart.pie.dispatch.on('elementMouseout.tooltip.directive', function (event) {90 scope.$emit('elementMouseover.tooltip.directive', event);91 });92 93 chart.pie.dispatch.on('elementClick.directive', function(event) {94 scope.$emit('elementClick.directive', event);95 });96 }97 if (chart.scatter) {98 chart.scatter.dispatch.on('elementMouseover.tooltip.directive', function (event) {99 scope.$emit('elementMouseover.tooltip.directive', event);100 });101 chart.scatter.dispatch.on('elementMouseout.tooltip.directive', function (event) {102 scope.$emit('elementMouseover.tooltip.directive', event);103 });104 }105 if (chart.bullet) {106 chart.bullet.dispatch.on('elementMouseover.tooltip.directive', function (event) {107 scope.$emit('elementMouseover.tooltip.directive', event);108 });109 chart.bullet.dispatch.on('elementMouseout.tooltip.directive', function (event) {110 scope.$emit('elementMouseover.tooltip.directive', event);111 });112 }113 if (chart.legend) {114 //'legendClick', 'legendDblclick', 'legendMouseover'115 //stateChange116 chart.legend.dispatch.on('stateChange.legend.directive', function (event) {117 scope.$emit('stateChange.legend.directive', event);118 });119 chart.legend.dispatch.on('legendClick.directive', function (d, i) {120 scope.$emit('legendClick.directive', d, i);121 });122 chart.legend.dispatch.on('legendDblclick.directive', function (d, i) {123 scope.$emit('legendDblclick.directive', d, i);124 });125 chart.legend.dispatch.on('legendMouseover.directive', function (d, i) {126 scope.$emit('legendMouseover.directive', d, i);127 });128 }129 if (chart.controls) {130 if (chart.controls.legendClick) {131 chart.controls.dispatch.on('legendClick.directive', function (d, i) {132 scope.$emit('legendClick.directive', d, i);133 });134 }135 }...

Full Screen

Full Screen

Signup.spec.js

Source:Signup.spec.js Github

copy

Full Screen

...15 afterEach(async () => {16 await driver.reset();17 });18 it('Signup with invalid age', async () =>{19 await driver.elementClick(SignupPOM.signupButtonPOM() );20 await driver.elementClick(SignupPOM.emailSignupButtonPOM() );21 22 await driver.elementSendKeys(SignupPOM.ageTextBoxPOM(),"10");23 24 await driver.elementClick(SignupPOM.ageNextButtonPOM() );25 26 const assertion = await ScreenContains("next")27 driver.waitUntil (()=>assertion)28 })29 30 it('Signup with invalid email', async () => {31 32 await driver.elementClick( SignupPOM.signupButtonPOM() );33 await driver.elementClick( SignupPOM.emailSignupButtonPOM() );34 35 await driver.elementSendKeys( SignupPOM.ageTextBoxPOM(),"20");36 37 await driver.elementClick( SignupPOM.ageNextButtonPOM() );38 39 await driver.elementSendKeys( SignupPOM.nameTextBoxPOM(),"ssthsrth2lm");40 41 await driver.elementSendKeys( SignupPOM.emailTextBoxPOM(),"ziadgmail.com");42 43 await driver.elementSendKeys( SignupPOM.passwordTextBoxPOM(),"Qwer1234##");44 await driver.elementClick( SignupPOM.signupDoneButtonPOM() );45 46 })47 48 it('Signup with invalid blog name', async () => {49 50 await driver.elementClick( SignupPOM.signupButtonPOM() );51 await driver.elementClick( SignupPOM.emailSignupButtonPOM() );52 53 await driver.elementSendKeys( SignupPOM.ageTextBoxPOM(),"20");54 55 await driver.elementClick( SignupPOM.ageNextButtonPOM() );56 57 await driver.elementSendKeys( SignupPOM.emailTextBoxPOM(),"ziad@gmail.com");58 59 await driver.elementSendKeys( SignupPOM.passwordTextBoxPOM(),"Qwer1234##");60 await driver.elementClick( SignupPOM.signupDoneButtonPOM() );61 })62 63 it('Signup with invalid password name', async () => {64 65 await driver.elementClick( SignupPOM.signupButtonPOM() );66 await driver.elementClick( SignupPOM.emailSignupButtonPOM() );67 68 await driver.elementSendKeys( SignupPOM.ageTextBoxPOM(),"20");69 70 await driver.elementClick( SignupPOM.ageNextButtonPOM() );71 72 await driver.elementSendKeys( SignupPOM.nameTextBoxPOM(),"ssthsrth2lm");73 74 await driver.elementSendKeys( SignupPOM.emailTextBoxPOM(),"ziad@gmail.com");75 76 await driver.elementSendKeys( SignupPOM.passwordTextBoxPOM(),"Qw");77 await driver.elementClick( SignupPOM.signupDoneButtonPOM() );78 79 })80 81 it('Full valid test', async () => {82 83 await driver.elementClick( SignupPOM.signupButtonPOM() );84 await driver.elementClick( SignupPOM.emailSignupButtonPOM() );85 86 await driver.elementSendKeys( SignupPOM.ageTextBoxPOM(),"20");87 88 await driver.elementClick( SignupPOM.ageNextButtonPOM() );89 90 await driver.elementSendKeys( SignupPOM.nameTextBoxPOM(),"fdbfdb");91 92 await driver.elementSendKeys( SignupPOM.emailTextBoxPOM(),"ziadfgsg@gmail.com");93 94 await driver.elementSendKeys( SignupPOM.passwordTextBoxPOM(),"Qwfdgs131$#!");95 await driver.elementClick( SignupPOM.signupDoneButtonPOM() );96 })...

Full Screen

Full Screen

utilsLogin.js

Source:utilsLogin.js Github

copy

Full Screen

...12// const HomePOM = new Home();13module.exports.LoginWithEmail = async () => {14 const LoginButton = LoginPOM.loginButtonPOM();15 const SignupButton = SignupPOM.signupButtonPOM();16 await driver.elementClick(LoginButton);17 const LoginWithEmailButton = LoginPOM.loginWithEmailButtonPOM();18 await driver.elementClick(LoginWithEmailButton);19}20module.exports.EnterEmail = async (inputEmail = '') => {21 // inputEmail = inputEmail === '' ? 'email' : inputEmail;22 let EmailField = LoginPOM.emailFieldPOM();23 let ContinueButton = LoginPOM.ContinueButtonPOM();24 await driver.elementSendKeys(EmailField, inputEmail);25 let email = await driver.getElementText(EmailField);26 expect(email).toBe(inputEmail);27 await driver.elementClick(ContinueButton);28 EmailField = LoginPOM.email2FieldPOM();29 ContinueButton = LoginPOM.EnterPasswordButtonPOM();30 let EmailClear = LoginPOM.email2FieldClearPOM();31 email = await driver.getElementText(EmailField);32 expect(email).toBe(inputEmail);33 await driver.elementClick(ContinueButton);34}35module.exports.EnterPassword = async (inputEmail = '', inputPassword = '') => {36 // inputEmail = inputEmail === '' ? 'email' : inputEmail;37 // inputPassword = inputPassword === '' ? 'password' : inputPassword;38 let EmailField = LoginPOM.email3FieldPOM();39 let PasswordField = LoginPOM.passwordFieldPOM();40 let EmailClear = LoginPOM.email3FieldClearPOM();41 let PasswordShow = LoginPOM.showPasswordButtonPOM();42 let email = await driver.getElementText(EmailField);43 expect(email).toBe(inputEmail);44 await driver.elementSendKeys(PasswordField, inputPassword);45 await driver.elementClick(PasswordShow);46 await driver.elementClick(PasswordShow);47 await driver.elementClick(PasswordShow);48 await driver.elementClick(PasswordShow);49 let password = await driver.getElementText(PasswordField);50 expect(password).toBe(inputPassword);51 // expect(password).not.toBe(inputPassword);52}53module.exports.EmptyEmailPasswordAssertion = async (email, password) => {54 const emailText = await driver.getElementText(LoginPOM.email3FieldPOM());55 const passwordText = await driver.getElementText(LoginPOM.passwordFieldPOM());56 expect(emailText.toString()).toBe(email);57 expect(passwordText.toString()).toBe(password);58}59module.exports.SuccessLoginAssertion = async (email, password) => {60 await driver.elementClick(HomePOM.HomeScreenButton());61 await driver.elementClick(HomePOM.SearchScreenButton());62 await driver.elementClick(HomePOM.MessageScreenButton());63 await driver.elementClick(HomePOM.ProfileScreenButton());...

Full Screen

Full Screen

init.js

Source:init.js Github

copy

Full Screen

1$(document).ready(function(){23 $('.owl-carousel').owlCarousel({4 loop:false,5 margin:0,6 nav:true,7 items:1,8 autoHeight:true,9 dots:false,10 navSpeed:30011 })12 13 $('.element-1').lightGallery({1415 });16 1718 $('.menu-burger__header').click(function(){19 $('.menu-burger__header').toggleClass('open-menu');20 $('.header-inner .nav').toggleClass('open-menu');21 $('.shadow').toggleClass('active');22 });2324 $("a.footer-link").click(function() {25 var elementClick = $(this).attr("href")26 var destination = $(elementClick).offset().top;27 jQuery("html:not(:animated),body:not(:animated)").animate({28 scrollTop: destination29 }, 800);30 return false;31 }); 3233 $("a.catalog1").click(function() {34 var elementClick = $(this).attr("href")35 var destination = $(elementClick).offset().top;36 jQuery("html:not(:animated),body:not(:animated)").animate({37 scrollTop: destination38 }, 800);39 return false;40 });4142 $("a.about1").click(function() {43 var elementClick = $(this).attr("href")44 var destination = $(elementClick).offset().top;45 jQuery("html:not(:animated),body:not(:animated)").animate({46 scrollTop: destination47 }, 800);48 return false;49});50 51 $("a.stages1").click(function() {52 var elementClick = $(this).attr("href")53 var destination = $(elementClick).offset().top;54 jQuery("html:not(:animated),body:not(:animated)").animate({55 scrollTop: destination56 }, 800);57 return false;58 });59 60 $("a.vorteile1").click(function() {61 var elementClick = $(this).attr("href")62 var destination = $(elementClick).offset().top;63 jQuery("html:not(:animated),body:not(:animated)").animate({64 scrollTop: destination65 }, 800);66 return false;67 });68 69 $("a.gallery1").click(function() {70 var elementClick = $(this).attr("href")71 var destination = $(elementClick).offset().top;72 jQuery("html:not(:animated),body:not(:animated)").animate({73 scrollTop: destination74 }, 800);75 return false;76 });77 78 $("a.contacts1").click(function() {79 var elementClick = $(this).attr("href")80 var destination = $(elementClick).offset().top;81 jQuery("html:not(:animated),body:not(:animated)").animate({82 scrollTop: destination83 }, 800);84 return false;85 }); ...

Full Screen

Full Screen

main.js

Source:main.js Github

copy

Full Screen

1$(function (){2 $("a.btn").click(function() {3 var elementClick = $(this).attr("href")4 var destination = $(elementClick).offset().top;5 jQuery("html:not(:animated),body:not(:animated)").animate({6 scrollTop: destination7 }, 800);8 return false;9 });10 $('a.call-btn').click( function(event){11 event.preventDefault();12 $('#myOverlay').fadeIn(297, function(){13 $('#myModal') 14 .css('display', 'block')15 .animate({opacity: 1}, 198);16 });17 });1819 $('#myModal__close, #myOverlay').click( function(){20 $('#myModal').animate({opacity: 0}, 198, function(){21 $(this).css('display', 'none');22 $('#myOverlay').fadeOut(297);23 });24 });25 $('.btn-routs').click(function (e) {26 e.preventDefault();27 $('.destinations-more').toggleClass('destinations-visible');28 if ($('.destinations-more').hasClass('destinations-visible')) {29 $(this).text('Свернуть');30 }31 else {32 $(this).text('Смотреть еще страны');33 }34 });35 $("a.where").click(function() {36 var elementClick = $(this).attr("href")37 var destination = $(elementClick).offset().top;38 jQuery("html:not(:animated),body:not(:animated)").animate({39 scrollTop: destination40 }, 800);41 return false;42 });43 $("a.about").click(function() {44 var elementClick = $(this).attr("href")45 var destination = $(elementClick).offset().top;46 jQuery("html:not(:animated),body:not(:animated)").animate({47 scrollTop: destination48 }, 800);49 return false;50 });51 $("a.cont").click(function() {52 var elementClick = $(this).attr("href")53 var destination = $(elementClick).offset().top;54 jQuery("html:not(:animated),body:not(:animated)").animate({55 scrollTop: destination56 }, 800);57 return false;58 });59 $("a.arrow").click(function() {60 var elementClick = $(this).attr("href")61 var destination = $(elementClick).offset().top;62 jQuery("html:not(:animated),body:not(:animated)").animate({63 scrollTop: destination64 }, 800);65 return false;66 }); ...

Full Screen

Full Screen

index.js

Source:index.js Github

copy

Full Screen

1const list = document.querySelector(".taskList");2const submit = document.querySelector(".submit");3const inputTask = document.querySelector(".task");45const createTask = (value) => {6 const elementLi = document.createElement("li");7 const contentLi = document.createTextNode(value);8 elementLi.appendChild(contentLi);9 elementLi.appendChild(createDeleteBtn());10 list.appendChild(elementLi);11 inputTask.value = "";12};1314const createDeleteBtn = () => {15 const elementBtn = document.createElement("button");16 elementBtn.appendChild(document.createTextNode("X"));17 elementBtn.classList.add("remove");18 return elementBtn;19};202122document.addEventListener("click", (e) => {23 const elementClick = e.target;24 console.log(elementClick.tagName);2526 if (elementClick.classList.contains("submit")) {27 const value = inputTask.value;28 const valueLong = value.length;29 if (valueLong > 0) createTask(value);30 };31 if (elementClick.tagName === "LI") {32 elementClick.classList.toggle("complete");33 }34 if (elementClick.classList.contains("remove")) {35 const elementDelete = elementClick.parentNode;36 list.removeChild(elementDelete);37 } ...

Full Screen

Full Screen

backend.js

Source:backend.js Github

copy

Full Screen

1$(function () {2 $("a.skroll").click(function () {3 let elementClick = $(this).attr("href")4 let destination = $(elementClick).offset().top;5 $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination }, 1000);6 return false;7 });8});910$(function () {11 $("a.skroll_1").click(function () {12 let elementClick = $(this).attr("href")13 let destination = $(elementClick).offset().top;14 $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination }, 1000);15 return false;16 });17});1819$(function () {20 $("a.skroll_2").click(function () {21 let elementClick = $(this).attr("href")22 let destination = $(elementClick).offset().top;23 $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination }, 1000);24 return false;25 });26});2728$(function () {29 $("a.skroll_3").click(function () {30 let elementClick = $(this).attr("href")31 let destination = $(elementClick).offset().top;32 $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination }, 1000);33 return false;34 }); ...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var webdriverio = require('webdriverio');2var options = {3 desiredCapabilities: {4 }5};6 .remote(options)7 .init()8 .setValue('#lst-ib', 'webdriverio')9 .click('#_fZl')10 .getTitle().then(function(title) {11 console.log('Title was: ' + title);12 })13 .end();

Full Screen

Using AI Code Generation

copy

Full Screen

1describe('webdriver.io page', () => {2 it('should have the right title', () => {3 const title = browser.getTitle()4 expect(title).toEqual('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js')5 browser.pause(3000)6 })7})8describe('webdriver.io page', () => {9 it('should have the right title', () => {10 const title = browser.getTitle()11 expect(title).toEqual('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js')12 browser.pause(3000)13 })14})

Full Screen

Using AI Code Generation

copy

Full Screen

1describe('webdriver.io page', () => {2 it('should have the right title', () => {3 const title = browser.getTitle()4 expect(title).toEqual('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js')5 })6 it('should click on the link', () => {7 browser.elementClick('a[href="/docs/gettingstarted"]')8 })9})10browser.click('=Getting Started')11browser.click('a[href="/docs/gettingstarted"]')12browser.click('a[href="/docs/gettingstarted"]')13browser.click('a[href="/docs/gettingstarted"]')14browser.click('a[href="/docs/gettingstarted"]')15browser.click('a[href="/docs/gettingstarted"]')16browser.click('a[href="/docs/gettingstarted"]')17browser.click('a[href="/docs/gettingstarted"]')18browser.click('a[href="/docs/gettingstarted"]')19browser.click('a[href="/docs/gettingstarted"]')20browser.click('a[href="/docs/get

Full Screen

Using AI Code Generation

copy

Full Screen

1browser.elementClick('#myElement');2browser.click('#myElement');3browser.elementSendKeys('#myElement', 'text');4browser.setValue('#myElement', 'text');5browser.execute(function() { return document.body.innerHTML; });6browser.getText('body', function(result) {7 console.log(result);8});9browser.moveToObject('#myElement', 10, 10);10browser.moveToElement('#myElement', 10, 10);11browser.pause(3000);12browser.pause(3000);13browser.frame('#myFrame');14browser.frame(null);15browser.frame('myFrame');16browser.frame(null);17browser.waitForExist('#myElement', 3000);18browser.waitForElementPresent('#myElement', 3000);19browser.waitForVisible('#myElement', 3000);20browser.waitForElementVisible('#myElement', 3000);21browser.saveScreenshot('screenshot.png');22browser.saveScreenshot('screenshot.png');23browser.getSource();24browser.getSource(function(result) {25 console.log(result);26});27browser.getTitle();28browser.getTitle(function(result) {

Full Screen

Using AI Code Generation

copy

Full Screen

1browser.elementClick('#elementID');2browser.elementClick('#elementID');3browser.elementClick('#elementID');4browser.elementClick('#elementID');5browser.elementClick('#elementID');6browser.elementClick('#elementID');7browser.elementClick('#elementID');8browser.elementClick('#elementID');9browser.elementClick('#elementID');10browser.elementClick('#elementID');11browser.elementClick('#elementID');12browser.elementClick('#elementID');13browser.elementClick('#elementID');14browser.elementClick('#elementID');15browser.elementClick('#elementID');16browser.elementClick('#elementID');17browser.elementClick('#elementID');18browser.elementClick('#elementID');19browser.elementClick('#elementID');20browser.elementClick('#elementID');21browser.elementClick('#elementID');22browser.elementClick('#elementID');23browser.elementClick('#elementID');

Full Screen

Using AI Code Generation

copy

Full Screen

1browser.elementClick('css selector', 'div#someId', function(err, res) {2 console.log(err, res);3});4browser.element('css selector', 'div#someId', function(err, res) {5 console.log(err, res);6 browser.elementIdClick(res.value.ELEMENT, function(err, res) {7 console.log(err, res);8 });9});10browser.element('css selector', 'div#someId', function(err, res) {11 console.log(err, res);12 browser.elementIdClick(res.value.ELEMENT, function(err, res) {13 console.log(err, res);14 });15});16browser.element(by.css('div#someId')).click();17var element = driver.findElement(By.css('div#someId'));18element.click();19driver.elementByCssSelector('div#someId').click();20driver.elementByCssSelector('div#someId').click();21browser.elementByCssSelector('div#someId').click();22browser.element('css selector', 'div#someId').click();23browser.element('css selector', 'div#someId').click();24browser.element('css selector', 'div#someId').click();25browser.element('css selector', 'div#someId').click();26browser.element('css selector', 'div#someId').click();27browser.element('css selector', 'div#someId').click();28browser.element('css selector', 'div#someId').click();29browser.element('css selector', 'div#someId').click();

Full Screen

WebdriverIO Tutorial

Wondering what could be a next-gen browser and mobile test automation framework that is also simple and concise? Yes, that’s right, it's WebdriverIO. Since the setup is very easy to follow compared to Selenium testing configuration, you can configure the features manually thereby being the center of attraction for automation testing. Therefore the testers adopt WedriverIO to fulfill their needs of browser testing.

Learn to run automation testing with WebdriverIO tutorial. Go from a beginner to a professional automation test expert with LambdaTest WebdriverIO tutorial.

Chapters

  1. Running Your First Automation Script - Learn the steps involved to execute your first Test Automation Script using WebdriverIO since the setup is very easy to follow and the features can be configured manually.

  2. Selenium Automation With WebdriverIO - Read more about automation testing with WebdriverIO and how it supports both browsers and mobile devices.

  3. Browser Commands For Selenium Testing - Understand more about the barriers faced while working on your Selenium Automation Scripts in WebdriverIO, the ‘browser’ object and how to use them?

  4. Handling Alerts & Overlay In Selenium - Learn different types of alerts faced during automation, how to handle these alerts and pops and also overlay modal in WebdriverIO.

  5. How To Use Selenium Locators? - Understand how Webdriver uses selenium locators in a most unique way since having to choose web elements very carefully for script execution is very important to get stable test results.

  6. Deep Selectors In Selenium WebdriverIO - The most popular automation testing framework that is extensively adopted by all the testers at a global level is WebdriverIO. Learn how you can use Deep Selectors in Selenium WebdriverIO.

  7. Handling Dropdown In Selenium - Learn more about handling dropdowns and how it's important while performing automated browser testing.

  8. Automated Monkey Testing with Selenium & WebdriverIO - Understand how you can leverage the amazing quality of WebdriverIO along with selenium framework to automate monkey testing of your website or web applications.

  9. JavaScript Testing with Selenium and WebdriverIO - Speed up your Javascript testing with Selenium and WebdriverIO.

  10. Cross Browser Testing With WebdriverIO - Learn more with this step-by-step tutorial about WebdriverIO framework and how cross-browser testing is done with WebdriverIO.

Run Webdriverio automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful