support mi 5s
This commit is contained in:
@@ -110,12 +110,6 @@ class CommandorPage {
|
|||||||
break;
|
break;
|
||||||
case OCRResult.TO_REFRESH:
|
case OCRResult.TO_REFRESH:
|
||||||
logWithDevice("will reload page", this.device)
|
logWithDevice("will reload page", this.device)
|
||||||
// if (this.browser.isConnected()) {
|
|
||||||
// await this.page.reload();
|
|
||||||
// await this.checkIfSuccessful()
|
|
||||||
// } else {
|
|
||||||
// await delay(10000);
|
|
||||||
// if (!await this.checkIfSuccessful()) {
|
|
||||||
let cmd = "input swipe 382 682 382 1682"
|
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);
|
||||||
@@ -485,6 +479,7 @@ class CommandorPage {
|
|||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log(e);
|
log(e);
|
||||||
|
await this.checkResultWithOcr()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -734,7 +729,8 @@ class CommandorPage {
|
|||||||
if (isSuccessful) {
|
if (isSuccessful) {
|
||||||
checkResult = await this.ocrChecker.get_result();
|
checkResult = await this.ocrChecker.get_result();
|
||||||
} else {
|
} else {
|
||||||
this.isTerminated = true
|
await this.checkResultWithOcr()
|
||||||
|
// this.isTerminated = true
|
||||||
}
|
}
|
||||||
// await this.checkResultWithOcr()
|
// await this.checkResultWithOcr()
|
||||||
})
|
})
|
||||||
@@ -855,6 +851,9 @@ class CommandorPage {
|
|||||||
OCRResult.GOOGLE_DISCONNECT
|
OCRResult.GOOGLE_DISCONNECT
|
||||||
:
|
:
|
||||||
logWithDevice("GOOGLE_DISCONNECT", this.device)
|
logWithDevice("GOOGLE_DISCONNECT", this.device)
|
||||||
|
if (this.device.model() === "MI 5s") {
|
||||||
|
this.device.shell("input tap " + 550 + " " + 1740)
|
||||||
|
} else
|
||||||
this.device.shell("input tap " + 411 + " " + 2100)
|
this.device.shell("input tap " + 411 + " " + 2100)
|
||||||
await delay(2000);
|
await delay(2000);
|
||||||
await this.checkResultWithOcr();
|
await this.checkResultWithOcr();
|
||||||
@@ -896,6 +895,8 @@ class CommandorPage {
|
|||||||
async clickOnConfirmBtn() {
|
async clickOnConfirmBtn() {
|
||||||
if (this.device.model() === "CPH2219") {
|
if (this.device.model() === "CPH2219") {
|
||||||
this.device.shell("input tap " + 900 + " " + 1532)
|
this.device.shell("input tap " + 900 + " " + 1532)
|
||||||
|
} else if (this.device.model() === "MI 5s") {
|
||||||
|
this.device.shell("input tap " + 925 + " " + 1325)
|
||||||
} else
|
} else
|
||||||
this.device.shell("input tap " + 933 + " " + 1538)
|
this.device.shell("input tap " + 933 + " " + 1538)
|
||||||
await delay(2000);
|
await delay(2000);
|
||||||
@@ -934,6 +935,11 @@ class CommandorPage {
|
|||||||
await delay(2000);
|
await delay(2000);
|
||||||
this.device.shell("input tap " + 818 + " " + 2140)
|
this.device.shell("input tap " + 818 + " " + 2140)
|
||||||
await delay(1000);
|
await delay(1000);
|
||||||
|
} else if (model === "MI 5s") {
|
||||||
|
this.device.shell("input tap " + 790 + " " + 1807)
|
||||||
|
await delay(2000);
|
||||||
|
this.device.shell("input tap " + 790 + " " + 1807)
|
||||||
|
await delay(1000);
|
||||||
} else {
|
} else {
|
||||||
this.device.shell("input tap " + 800 + " " + 2215)
|
this.device.shell("input tap " + 800 + " " + 2215)
|
||||||
await delay(2000);
|
await delay(2000);
|
||||||
@@ -954,9 +960,11 @@ class CommandorPage {
|
|||||||
this.device.shell("input tap " + 550 + " " + 1920)
|
this.device.shell("input tap " + 550 + " " + 1920)
|
||||||
} else if (model === "ONEPLUS A6000") {
|
} else if (model === "ONEPLUS A6000") {
|
||||||
this.device.shell("input tap " + 535 + " " + 1945)
|
this.device.shell("input tap " + 535 + " " + 1945)
|
||||||
|
} else if (model === "MI 5s") {
|
||||||
|
this.device.shell("input tap " + 510 + " " + 1615)
|
||||||
} else
|
} else
|
||||||
this.device.shell("input tap " + 385 + " " + 2050)
|
this.device.shell("input tap " + 385 + " " + 2050)
|
||||||
await delay(2000);
|
await delay(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
async enableDisableAirPlanMode() {
|
async enableDisableAirPlanMode() {
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ const ERR_CACHE_MISS_3 = "appuyer sur le bouton d'actualisation"
|
|||||||
const ERR_CACHE_MISS_4 = "renvoyer les données"
|
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 SLIDING_CAPTCHA_FR_2 = "Glissez vers la droite pour"
|
const SLIDING_CAPTCHA_FR_2 = "Glissez vers la droite pour"
|
||||||
|
const SLIDING_CAPTCHA_FR_3 = "la droite pour completer le puzzle"
|
||||||
const MESSAGE_FILL_FIELD_FR = "Demande de rendez-vous pour"
|
const MESSAGE_FILL_FIELD_FR = "Demande de rendez-vous pour"
|
||||||
const MESSAGE_FILL_FIELD_FR_2 = "Lensemble des champs de données doivent étre complétés"
|
const MESSAGE_FILL_FIELD_FR_2 = "Lensemble des champs de données doivent étre complétés"
|
||||||
const WELCOME_MESSAGE_FR = "Bienvenue dans Chrome"
|
const WELCOME_MESSAGE_FR = "Bienvenue dans Chrome"
|
||||||
@@ -40,6 +41,7 @@ const PAGE_OPTIMIZATION_CHROME_FR_2 = "Vous pouvez modifier vos options a tout m
|
|||||||
const PAGE_OPTIMIZATION_CHROME_FR_3 = "Vous pouvez effectuer des modifications"
|
const PAGE_OPTIMIZATION_CHROME_FR_3 = "Vous pouvez effectuer des modifications"
|
||||||
const PAGE_OPTIMIZATION_CHROME_FR_4 = "de nouvelles fonctionnalités"
|
const PAGE_OPTIMIZATION_CHROME_FR_4 = "de nouvelles fonctionnalités"
|
||||||
const PAGE_OPTIMIZATION_CHROME_FR_5 = "Avec la mesure des performance"
|
const PAGE_OPTIMIZATION_CHROME_FR_5 = "Avec la mesure des performance"
|
||||||
|
const PAGE_OPTIMIZATION_CHROME_FR_7 = "Les annonces suggérées par les"
|
||||||
const ONLINE_APPOINTMENT = "Online Appointment"
|
const ONLINE_APPOINTMENT = "Online Appointment"
|
||||||
const CONFIRM_RESEND_FORM_FR = "Confirmer le nouvel envoi"
|
const CONFIRM_RESEND_FORM_FR = "Confirmer le nouvel envoi"
|
||||||
const CLOSED_MESSAGE_FR = "Depuis plus de 130 ans"
|
const CLOSED_MESSAGE_FR = "Depuis plus de 130 ans"
|
||||||
@@ -84,15 +86,21 @@ class OCRChecker {
|
|||||||
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
|
||||||
} else if (result.includes(SLIDING_CAPTCHA_FR) || result.includes(SLIDING_CAPTCHA_FR_2)) {
|
} else if (result.includes(SLIDING_CAPTCHA_FR) || result.includes(SLIDING_CAPTCHA_FR_2) || result.includes(SLIDING_CAPTCHA_FR_3)) {
|
||||||
return OCRResult.SLIDING_CAPTCHA
|
return OCRResult.SLIDING_CAPTCHA
|
||||||
} else if (result.includes(MESSAGE_FILL_FIELD_FR) || result.includes(MESSAGE_FILL_FIELD_FR_2)) {
|
} else if (result.includes(MESSAGE_FILL_FIELD_FR) || result.includes(MESSAGE_FILL_FIELD_FR_2)) {
|
||||||
return OCRResult.FILL_FIELD
|
return OCRResult.FILL_FIELD
|
||||||
} else if (result.includes(WELCOME_MESSAGE_FR)) {
|
} else if (result.includes(WELCOME_MESSAGE_FR)) {
|
||||||
return OCRResult.NEED_TO_CLICK_LATE_BTN
|
return OCRResult.NEED_TO_CLICK_LATE_BTN
|
||||||
|
} else if (result.includes(GOOGLE_DISCONNECT_FR)) {
|
||||||
|
return OCRResult.GOOGLE_DISCONNECT
|
||||||
} else if (result.toLowerCase().includes(ONLINE_APPOINTMENT.toLowerCase())) {
|
} else if (result.toLowerCase().includes(ONLINE_APPOINTMENT.toLowerCase())) {
|
||||||
return OCRResult.ONLINE_APPOINTMENT
|
return OCRResult.ONLINE_APPOINTMENT
|
||||||
} else if (result.includes(PAGE_OPTIMIZATION_CHROME_FR) || result.includes(PAGE_OPTIMIZATION_CHROME_FR_2) || result.includes(PAGE_OPTIMIZATION_CHROME_FR_3) || result.includes(PAGE_OPTIMIZATION_CHROME_FR_4) || result.includes(PAGE_OPTIMIZATION_CHROME_FR_5) || result.includes(PAGE_OPTIMIZATION_CHROME_FR_6)) {
|
} else if (result.includes(PAGE_OPTIMIZATION_CHROME_FR) || result.includes(PAGE_OPTIMIZATION_CHROME_FR_2) || result.includes(PAGE_OPTIMIZATION_CHROME_FR_3)
|
||||||
|
|| result.includes(PAGE_OPTIMIZATION_CHROME_FR_4) || result.includes(PAGE_OPTIMIZATION_CHROME_FR_5)
|
||||||
|
|| result.includes(PAGE_OPTIMIZATION_CHROME_FR_6)
|
||||||
|
|| result.includes(PAGE_OPTIMIZATION_CHROME_FR_7)
|
||||||
|
) {
|
||||||
return OCRResult.PAGE_OPTIMIZATION
|
return OCRResult.PAGE_OPTIMIZATION
|
||||||
} else if (result.includes(CONFIRM_RESEND_FORM_FR)) {
|
} else if (result.includes(CONFIRM_RESEND_FORM_FR)) {
|
||||||
return OCRResult.CONFIRM_RESEND_FORM
|
return OCRResult.CONFIRM_RESEND_FORM
|
||||||
@@ -102,8 +110,6 @@ class OCRChecker {
|
|||||||
return OCRResult.TERMINAED
|
return OCRResult.TERMINAED
|
||||||
} else if (result.includes(DIALOG_TO_SKIP)) {
|
} else if (result.includes(DIALOG_TO_SKIP)) {
|
||||||
return OCRResult.TO_SKIP
|
return OCRResult.TO_SKIP
|
||||||
} else if (result.includes(GOOGLE_DISCONNECT_FR)) {
|
|
||||||
return OCRResult.GOOGLE_DISCONNECT
|
|
||||||
} else if (result.includes(RECAPTCHA_FAILED_FR)) {
|
} else if (result.includes(RECAPTCHA_FAILED_FR)) {
|
||||||
return OCRResult.TERMINAED
|
return OCRResult.TERMINAED
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user