use adb insead of playwright

This commit is contained in:
Lei PAN
2023-10-21 18:21:36 +02:00
parent 04e1dbbee7
commit dda926bdcd
2 changed files with 27 additions and 8 deletions
+16 -3
View File
@@ -981,7 +981,12 @@ class CommandorPage {
else if (this.device.model() === "ONEPLUS A6000")
await this.device.shell("input tap " + 530 + " " + 1064)
else
await this.device.shell("input tap " + 500 + " " + 1120)
try {
await this.tapForDevice(this.device, 500, 1120)
// await this.device.shell("input tap " + 500 + " " + 1120)
} catch (e) {
console.log(e)
}
await delay(2000);
await this.checkResultWithOcr();
break;
@@ -1092,13 +1097,21 @@ class CommandorPage {
} else if (model === "ONEPLUS A6000") {
await this.device.shell("input tap " + 530 + " " + 1106)
} else {
await this.device.shell("input tap " + 470 + " " + 1160)
logWithDevice("handleBraveSkipBtn", this.device)
await this.tapForDevice(this.device, 470, 1160)
// await this.device.shell("input tap " + 470 + " " + 1160)
}
await delay(2000);
await this.device.shell("input tap " + 455 + " " + 1920)
await this.tapForDevice(this.device, 455, 1920)
// await this.device.shell("input tap " + 455 + " " + 1920)
await delay(1000);
}
async tapForDevice(device, x, y) {
let cmd = `adb -s ${device.serial()} shell input tap ${x} ${y}`
await exec(cmd);
}
async clickOnConfirmBtn() {
if (this.device.model() === "CPH2219") {
this.device.shell("input tap " + 900 + " " + 1532)