try to close page
This commit is contained in:
@@ -200,9 +200,9 @@ class CommandorPage {
|
||||
if (this.isTerminated) {
|
||||
log(this.device.model() + ":request terminated, send cancel()");
|
||||
// this.resetBrowser();
|
||||
this.disconnectBrowser();
|
||||
clearInterval(intervalTask)
|
||||
cancel()
|
||||
// return this.browser
|
||||
} else {
|
||||
}
|
||||
}, 10 * 1000)//interval of 10 seconds
|
||||
@@ -319,7 +319,7 @@ class CommandorPage {
|
||||
}
|
||||
})
|
||||
await delay(1000);
|
||||
await page.keyboard.type("" + this.contact.phoneNumber);
|
||||
await page.keyboard.type("0" + this.contact.phoneNumber);
|
||||
this.isPhoneInput = true;
|
||||
}
|
||||
}
|
||||
@@ -625,6 +625,7 @@ class CommandorPage {
|
||||
let reserve = ReserveResultPojo.create_from_contact(this.contact, id, url, this.choosedStore, publishType);
|
||||
reserve.source_from = this.device.model();
|
||||
await this.mongoManager.saveReserveToDb(reserve.to_mongo_dict())
|
||||
await this.page.close();
|
||||
// await this.deleteFromBlackList()
|
||||
// await this.resetBrowser()
|
||||
this.isTerminated = true
|
||||
@@ -723,8 +724,8 @@ class CommandorPage {
|
||||
this.isTerminated = true;
|
||||
break;
|
||||
case OCRResult.FILL_FIELD:
|
||||
console.log("browser.isConnected: " + this.browser.isConnected());
|
||||
if (!this.browser.isConnected()) {
|
||||
// console.log("browser.isConnected: " + this.browser.isConnected());
|
||||
if (this.browser === undefined || !this.browser.isConnected()) {
|
||||
logWithDevice("trying to connect to browser", this.device)
|
||||
try {
|
||||
this.browser = await puppeteer.connect({
|
||||
@@ -850,6 +851,8 @@ class CommandorPage {
|
||||
log("model is " + model);
|
||||
if (model === "CPH2219") {
|
||||
this.device.shell("input tap " + 385 + " " + 1930)
|
||||
} else if (model === "ASUS_X00QD") {
|
||||
this.device.shell("input tap " + 490 + " " + 1910)
|
||||
} else
|
||||
this.device.shell("input tap " + 385 + " " + 2050)
|
||||
await delay(2000);
|
||||
|
||||
Reference in New Issue
Block a user