click home page

This commit is contained in:
Lei PAN
2024-02-23 16:09:09 +01:00
parent 8402640a56
commit 99953c758f
+38 -2
View File
@@ -169,12 +169,12 @@ class CommandorPage {
let y0 = 600 + getRandom() * 100 + getRandom() * 10 + getRandom() * 1
let swipCmd = "input swipe " + x + " " + y0 + " " + x + " 1522"
logWithDevice("will send cmd:" + swipCmd, this.device)
this.device.shell(swipCmd);
await this.device.shell(swipCmd);
await delay(3 * getRandomWaitTime());
}
// await this.openGoogle()
// await delay(3 * getRandomWaitTime());
// await this.clickOnConfirmBtn();
await this.clickOnHomeBtn();
await this.checkResultWithOcr();
}
@@ -753,6 +753,7 @@ class CommandorPage {
}
async push_message_to_queue(publishType) {
this.isAlreadyRefresh = true;
let url = this.page.url();
logWithDevice("successful url is " + url, this.device)
await this.push_message_to_db(publishType, url)
@@ -1215,6 +1216,41 @@ class CommandorPage {
await delay(2000);
}
async clickOnHomeBtn() {
// await this.enableDisableAirPlanMode()
if (this.device.model() === "22041219PG") {
await this.tapForDevice(this.device, 110, 2208)
await delay(2000);
await openUrlWithAdb(RDV_URL, this.device)
}
if (this.device.model() === "21091116C") {
await this.tapForDevice(this.device, 107, 2193)
await delay(2000);
await openUrlWithAdb(RDV_URL, this.device)
} else if (this.device.model() === "MI 5s") {
await this.tapForDevice(this.device, 110, 1842)
await delay(2000);
await openUrlWithAdb(RDV_URL, this.device)
} else if (this.device.model() === "ASUS_X00QD" || this.device.model() === "CPH2219") {
await this.tapForDevice(this.device, 112, 2172)
await delay(2000);
await openUrlWithAdb(RDV_URL, this.device)
} else if (this.device.model() === "moto g51 5G") {
await this.tapForDevice(this.device, 103, 2283)
await delay(2000);
await openUrlWithAdb(RDV_URL, this.device)
} else if (this.device.model() === "ONEPLUS A6000") {
await this.tapForDevice(this.device, 122, 2172)
await delay(2000);
await openUrlWithAdb(RDV_URL, this.device)
} else if (this.device.model() === "DE2117") {
await this.tapForDevice(this.device, 122, 2172)
await delay(2000);
await openUrlWithAdb(RDV_URL, this.device)
}
await delay(4000);
}
async closePage() {
await this.resetBrowser();
}