adapt oppo

This commit is contained in:
2023-07-18 16:20:08 +02:00
parent b3e376cd05
commit 343449b17c
2 changed files with 20 additions and 16 deletions
+16 -14
View File
@@ -707,7 +707,7 @@ class CommandorPage {
}
// save to mongoDb
let reserve = ReserveResultPojo.create_from_contact(this.contact, id, url, this.choosedStore, publishType);
reserve.source_from = this.device.serial();
reserve.source_from = this.device.model();
await this.mongoManager.saveReserveToDb(reserve.to_mongo_dict())
await this.page.close();
// await this.deleteFromBlackList()
@@ -833,11 +833,13 @@ class CommandorPage {
logWithDevice("get pages", this.device)
let pages = await this.browser.pages();
pages.forEach((currentPage) => {
if (currentPage.url() === RDV_URL) {
this.page = currentPage;
}
})
let needPages = pages.filter(currentPage => currentPage.url() === RDV_URL)
this.page = needPages[0]
// pages.forEach((currentPage) => {
// if (currentPage.url() === RDV_URL) {
// this.page = currentPage;
// }
// })
logWithDevice("this.page.bringToFront();", this.device)
await this.page.bringToFront();
@@ -856,11 +858,8 @@ class CommandorPage {
logWithDevice("get pages", this.device)
let pages = await this.browser.pages();
logWithDevice("get current page", this.device)
pages.forEach((currentPage) => {
if (currentPage.url() === RDV_URL) {
this.page = currentPage;
}
})
let needPages = pages.filter(currentPage => currentPage.url() === RDV_URL)
this.page = needPages[0]
logWithDevice("this.page.bringToFront();", this.device)
await this.page.bringToFront();
// this.page = pages;
@@ -1120,11 +1119,14 @@ class CommandorPage {
if (this.device.model() === "MI 5s") {
if (this.browserPackageName.includes("brave"))
await this.device.shell("input tap " + 535 + " " + 1629)
else
await this.device.shell("input tap " + 550 + " " + 1740)
} else
await this.device.shell("input tap " + 411 + " " + 2100)
} else {
if (this.browserPackageName.includes("brave") && this.device.model() === "CPH2219") {
await this.device.shell("input tap " + 411 + " " + 1977)
} else
await this.device.shell("input tap " + 411 + " " + 2100)
}
await delay(2000);
}
}