support for oneplus N20

This commit is contained in:
2023-12-08 11:38:19 +01:00
parent 0c18ae491c
commit 95c62a614c
2 changed files with 27 additions and 21 deletions
+5 -1
View File
@@ -1,4 +1,6 @@
const PublishType = require("./PublishType"); const PublishType = require("./PublishType");
const {hostname} = require("os");
const hostName = hostname();
class ReserveResultPojo { class ReserveResultPojo {
@@ -13,6 +15,7 @@ class ReserveResultPojo {
this.email = mail; this.email = mail;
this.type = type; this.type = type;
this.source_from = "" this.source_from = ""
this.hostName = hostName
this.created_at = new Date().toLocaleString() this.created_at = new Date().toLocaleString()
} }
@@ -27,7 +30,8 @@ class ReserveResultPojo {
url: this.url, url: this.url,
store_type: this.storeType, store_type: this.storeType,
source_from: this.source_from, source_from: this.source_from,
created_at: this.created_at created_at: this.created_at,
hostName: this.hostName
} }
} }
+21 -19
View File
@@ -168,12 +168,8 @@ class CommandorPage {
await this.enableDisableAirPlanMode(); await this.enableDisableAirPlanMode();
// await delay(10 * 1000); // await delay(10 * 1000);
await openUrlWithAdb(RDV_URL, this.device) await openUrlWithAdb(RDV_URL, this.device)
await delay(15000) await delay(10 * 1000)
await this.checkResultWithOcr() await this.checkResultWithOcr()
// await this.clickOnlineAppointment();
// } else {
// this.isTerminated = true;
// }
let cancel let cancel
const intervalTask = setInterval(async () => { const intervalTask = setInterval(async () => {
@@ -953,6 +949,8 @@ class CommandorPage {
await this.tapForDevice(this.device, 530, 1064) await this.tapForDevice(this.device, 530, 1064)
} else if (this.device.model() === "moto g51 5G") { } else if (this.device.model() === "moto g51 5G") {
await this.tapForDevice(this.device, 500, 1080) await this.tapForDevice(this.device, 500, 1080)
} else if (this.device.model() === "CPH2469") {
await this.tapForDevice(this.device, 360, 820)
} else if (this.device.model() === "M2006C3LG" || this.device.model() === "220233L2G") { } else if (this.device.model() === "M2006C3LG" || this.device.model() === "220233L2G") {
await this.tapForDevice(this.device, 350, 777) await this.tapForDevice(this.device, 350, 777)
} else if (this.device.model() === "KB2003" || this.device.model() === "DE2117") { } else if (this.device.model() === "KB2003" || this.device.model() === "DE2117") {
@@ -984,6 +982,8 @@ class CommandorPage {
await this.tapForDevice(this.device, 540, 1611) await this.tapForDevice(this.device, 540, 1611)
} else if (this.device.model() === "22041219PG") { } else if (this.device.model() === "22041219PG") {
await this.tapForDevice(this.device, 530, 1600) await this.tapForDevice(this.device, 530, 1600)
} else if (this.device.model() === "CPH2469") {
await this.tapForDevice(this.device, 322, 1146)
} else } else
await this.tapForDevice(this.device, 500, 1680) await this.tapForDevice(this.device, 500, 1680)
// await this.device.shell("input tap " + 500 + " " + 1680) // await this.device.shell("input tap " + 500 + " " + 1680)
@@ -1096,6 +1096,8 @@ class CommandorPage {
await this.tapForDevice(this.device, 360, 777) await this.tapForDevice(this.device, 360, 777)
} else if (model === "ONEPLUS A6000") { } else if (model === "ONEPLUS A6000") {
await this.tapForDevice(this.device, 530, 1045) await this.tapForDevice(this.device, 530, 1045)
} else if (model === "CPH2469") {
await this.tapForDevice(this.device, 360, 820)
} else { } else {
logWithDevice("handleBraveSkipBtn", this.device) logWithDevice("handleBraveSkipBtn", this.device)
await this.tapForDevice(this.device, 470, 1160) await this.tapForDevice(this.device, 470, 1160)
@@ -1184,21 +1186,21 @@ class CommandorPage {
async enableDisableAirPlanMode() { async enableDisableAirPlanMode() {
logWithDevice("will enable/disable airplane mode", this.device) logWithDevice("will enable/disable airplane mode", this.device)
// try { try {
// // await this.device.shell("cmd connectivity airplane-mode enable") // await this.device.shell("cmd connectivity airplane-mode enable")
// await exceutShellCmd(this.device, "cmd connectivity airplane-mode enable") await exceutShellCmd(this.device, "cmd connectivity airplane-mode enable")
// await delay(1000) await delay(1000)
// await exceutShellCmd(this.device, "cmd connectivity airplane-mode disable") await exceutShellCmd(this.device, "cmd connectivity airplane-mode disable")
// // await this.device.shell("cmd connectivity airplane-mode disable")
// await delay(2000)
// } catch (e) {
// try {
// await this.device.shell("cmd connectivity airplane-mode disable") // await this.device.shell("cmd connectivity airplane-mode disable")
// } catch (e) { await delay(2000)
// console.log(e) } catch (e) {
// } try {
// console.log(e) await this.device.shell("cmd connectivity airplane-mode disable")
// } } catch (e) {
console.log(e)
}
console.log(e)
}
} }
async tapGoogleDisconnectBtn() { async tapGoogleDisconnectBtn() {