Merge branch 'feature/disconnect_after_opening_appointment_url' of bitbucket.org:panleicim/puppeteerjs into feature/disconnect_after_opening_appointment_url
This commit is contained in:
@@ -116,7 +116,7 @@ class CommandorPage {
|
|||||||
// } else {
|
// } else {
|
||||||
// await delay(10000);
|
// await delay(10000);
|
||||||
// if (!await this.checkIfSuccessful()) {
|
// if (!await this.checkIfSuccessful()) {
|
||||||
let cmd = "input swipe 382 482 382 1582"
|
let cmd = "input swipe 382 682 382 1682"
|
||||||
logWithDevice("will send cmd:" + cmd, this.device)
|
logWithDevice("will send cmd:" + cmd, this.device)
|
||||||
this.device.shell(cmd);
|
this.device.shell(cmd);
|
||||||
await delay(3000);
|
await delay(3000);
|
||||||
@@ -769,17 +769,25 @@ class CommandorPage {
|
|||||||
} else {
|
} else {
|
||||||
logWithDevice("this.browser.isConnected() is " + this.browser.isConnected(), this.device)
|
logWithDevice("this.browser.isConnected() is " + this.browser.isConnected(), this.device)
|
||||||
if (this.browser.isConnected()) {
|
if (this.browser.isConnected()) {
|
||||||
let pages = await this.browser.pages();
|
try {
|
||||||
pages.forEach((currentPage) => {
|
let pages = await this.browser.pages();
|
||||||
if (currentPage.url() === RDV_URL) {
|
logWithDevice("get pages", this.device)
|
||||||
this.page = currentPage;
|
pages.forEach((currentPage) => {
|
||||||
}
|
if (currentPage.url() === RDV_URL) {
|
||||||
})
|
this.page = currentPage;
|
||||||
await this.page.bringToFront();
|
}
|
||||||
// this.page = pages;
|
})
|
||||||
// this.page.await
|
logWithDevice("this.page.bringToFront();", this.device)
|
||||||
await this.fillFields(this.page)
|
await this.page.bringToFront();
|
||||||
await delay(2 * 1000);
|
// this.page = pages;
|
||||||
|
// this.page.await
|
||||||
|
await this.fillFields(this.page)
|
||||||
|
await delay(2 * 1000);
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
this.isTerminated = true
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if (!this.browser.isConnected()) {
|
// if (!this.browser.isConnected()) {
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ const BLOCKED_MSG_EN = "have been blocked"
|
|||||||
const BLOCKED_MSG_FR = "avez été bloqué"
|
const BLOCKED_MSG_FR = "avez été bloqué"
|
||||||
const CHECKING_MSG_FR = "Verifying"
|
const CHECKING_MSG_FR = "Verifying"
|
||||||
const ERR_CACHE_MISS = "ERR_CACHE_MISS"
|
const ERR_CACHE_MISS = "ERR_CACHE_MISS"
|
||||||
|
const ERR_CACHE_MISS_2 = "ERR_CACHE-MISS"
|
||||||
|
const ERR_CACHE_MISS_3 = "appuyer sur le bouton d'actualisation"
|
||||||
|
const ERR_CACHE_MISS_4 = "renvoyer les données"
|
||||||
const SLIDING_CAPTCHA_FR = "Pourquoi cette vérification"
|
const SLIDING_CAPTCHA_FR = "Pourquoi cette vérification"
|
||||||
const MESSAGE_FILL_FIELD_FR = "Demande de rendez-vous pour"
|
const MESSAGE_FILL_FIELD_FR = "Demande de rendez-vous pour"
|
||||||
const WELCOME_MESSAGE_FR = "Bienvenue dans Chrome"
|
const WELCOME_MESSAGE_FR = "Bienvenue dans Chrome"
|
||||||
@@ -74,7 +77,7 @@ class OCRChecker {
|
|||||||
return OCRResult.RECAPTCHA_ERROR
|
return OCRResult.RECAPTCHA_ERROR
|
||||||
} else if (result.includes(BLOCKED_MSG_EN) || result.includes(BLOCKED_MSG_FR)) {
|
} else if (result.includes(BLOCKED_MSG_EN) || result.includes(BLOCKED_MSG_FR)) {
|
||||||
return OCRResult.BLOCKED
|
return OCRResult.BLOCKED
|
||||||
} else if (result.includes(ERR_CACHE_MISS)) {
|
} else if (result.includes(ERR_CACHE_MISS) || result.includes(ERR_CACHE_MISS_2) || result.includes(ERR_CACHE_MISS_3) || result.includes(ERR_CACHE_MISS_4)) {
|
||||||
return OCRResult.TO_REFRESH
|
return OCRResult.TO_REFRESH
|
||||||
} else if (result.includes(CHECKING_MSG_FR)) {
|
} else if (result.includes(CHECKING_MSG_FR)) {
|
||||||
return OCRResult.RECHECK
|
return OCRResult.RECHECK
|
||||||
|
|||||||
Reference in New Issue
Block a user