diff --git a/src/workers/CommandorPage.js b/src/workers/CommandorPage.js index cc734e0..e9eedaa 100644 --- a/src/workers/CommandorPage.js +++ b/src/workers/CommandorPage.js @@ -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(); }