support genymotion emulator
This commit is contained in:
+4
-1
@@ -1,6 +1,9 @@
|
|||||||
const {exec} = require("child_process");
|
const {exec} = require("child_process");
|
||||||
|
|
||||||
DEVICE_REGEX = "(^[a-z0-9A-Z]*) .* model:([a-z0-9A-Z_]+)"
|
// DEVICE_REGEX = "(^[a-z0-9A-Z]*) .* model:([a-z0-9A-Z_]+)"
|
||||||
|
DEVICE_REGEX = "(^[a-z0-9A-Z-.:]*) .* model:([a-z0-9A-Z_]+)"
|
||||||
|
// DEVICE_REGEX = "(^[a-z0-9A-Z-]*) .* model:([a-z0-9A-Z_]+)"
|
||||||
|
|
||||||
|
|
||||||
async function devices() {
|
async function devices() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ const OCRResult = {
|
|||||||
RECAPTCHA_FAILED: Symbol("RECAPTCHA_FAILED"),
|
RECAPTCHA_FAILED: Symbol("RECAPTCHA_FAILED"),
|
||||||
RECAPTCHA_ERROR: Symbol("RECAPTCHA_ERROR"),
|
RECAPTCHA_ERROR: Symbol("RECAPTCHA_ERROR"),
|
||||||
NO_INTERNET: Symbol("NO_INTERNET"),
|
NO_INTERNET: Symbol("NO_INTERNET"),
|
||||||
|
CHROME_NOTIFICATION: Symbol("CHROME_NOTIFICATION"),
|
||||||
BRAVE_SKIP: Symbol("BRAVE_SKIP"),
|
BRAVE_SKIP: Symbol("BRAVE_SKIP"),
|
||||||
BRAVE_PRIVACY: Symbol("BRAVE_PRIVACY"),
|
BRAVE_PRIVACY: Symbol("BRAVE_PRIVACY"),
|
||||||
BRAVE_PRIVACY_PUB: Symbol("BRAVE_PRIVACY_PUB"),
|
BRAVE_PRIVACY_PUB: Symbol("BRAVE_PRIVACY_PUB"),
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ const {exec} = require("child_process");
|
|||||||
const {openUrlWithAdb} = require("../utiles/CmdUtils");
|
const {openUrlWithAdb} = require("../utiles/CmdUtils");
|
||||||
const RequestDataPojo = require("../models/RequestDataPojo");
|
const RequestDataPojo = require("../models/RequestDataPojo");
|
||||||
const {REQUEST_DATA_OBJECT, TEST_QUEUE} = require("../queue/Sender");
|
const {REQUEST_DATA_OBJECT, TEST_QUEUE} = require("../queue/Sender");
|
||||||
// const RDV_URL = "http://192.168.0.44:8000/test_appointment.html"
|
|
||||||
const RDV_URL = "https://rendezvousparis.hermes.com/client/register";
|
const RDV_URL = "https://rendezvousparis.hermes.com/client/register";
|
||||||
const BLANK_URL = "about:blank"
|
const BLANK_URL = "about:blank"
|
||||||
const ERROR_CAPTCHA_UNSOLVABLE = "ERROR_CAPTCHA_UNSOLVABLE";
|
const ERROR_CAPTCHA_UNSOLVABLE = "ERROR_CAPTCHA_UNSOLVABLE";
|
||||||
@@ -888,6 +887,10 @@ class CommandorPage {
|
|||||||
case OCRResult.SLIDING_CAPTCHA_REFRESH:
|
case OCRResult.SLIDING_CAPTCHA_REFRESH:
|
||||||
await this.connect_to_browser(checkResult)
|
await this.connect_to_browser(checkResult)
|
||||||
break;
|
break;
|
||||||
|
case OCRResult.CHROME_NOTIFICATION:
|
||||||
|
await this.handleChromeNotification()
|
||||||
|
await this.checkResultWithOcr();
|
||||||
|
break;
|
||||||
case OCRResult.SLIDING_CAPTCHA:
|
case OCRResult.SLIDING_CAPTCHA:
|
||||||
logWithDevice("will call this.slidingCaptcha()", this.device)
|
logWithDevice("will call this.slidingCaptcha()", this.device)
|
||||||
await this.slidingCaptcha(async (isSuccessful) => {
|
await this.slidingCaptcha(async (isSuccessful) => {
|
||||||
@@ -1448,6 +1451,8 @@ class CommandorPage {
|
|||||||
this.device.shell("input tap " + 490 + " " + 1910)
|
this.device.shell("input tap " + 490 + " " + 1910)
|
||||||
} else if (model === "RMX3151") {
|
} else if (model === "RMX3151") {
|
||||||
this.device.shell("input tap " + 492 + " " + 1960)
|
this.device.shell("input tap " + 492 + " " + 1960)
|
||||||
|
} else if (model === "Pixel") {
|
||||||
|
this.device.shell("input tap " + 312 + " " + 1490)
|
||||||
} else if (model === "Mi Note 10") {
|
} else if (model === "Mi Note 10") {
|
||||||
this.device.shell("input tap " + 550 + " " + 1920)
|
this.device.shell("input tap " + 550 + " " + 1920)
|
||||||
} else if (model === "ONEPLUS_A6000") {
|
} else if (model === "ONEPLUS_A6000") {
|
||||||
@@ -1545,6 +1550,16 @@ class CommandorPage {
|
|||||||
await this.tapForDevice(this.device, 100, 400)
|
await this.tapForDevice(this.device, 100, 400)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async handleChromeNotification() {
|
||||||
|
let model = this.device.model
|
||||||
|
if (model === "KB2003" || model === "22041219PG" || model === "DE2117" || model === "21091116C") {
|
||||||
|
await this.tapForDevice(this.device, 545, 1448)
|
||||||
|
} else if (model === "sdk_gphone64_arm64") {
|
||||||
|
await this.tapForDevice(this.device, 484, 1723)
|
||||||
|
} else
|
||||||
|
await this.tapForDevice(this.device, 100, 400)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module
|
module
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ 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 PAGE_OPTIMIZATION_CHROME_FR_7 = "Les annonces suggérées par les"
|
||||||
const PAGE_OPTIMIZATION_CHROME_FR_8 = "Chrome estime vos centres"
|
const PAGE_OPTIMIZATION_CHROME_FR_8 = "Chrome estime vos centres"
|
||||||
|
const CHROME_NOTIFICATION = "Les notifications de Chrome"
|
||||||
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"
|
||||||
@@ -109,6 +110,9 @@ class OCRChecker {
|
|||||||
} else if (result.includes(PUSH_NOTIFICATION_1)) {
|
} else if (result.includes(PUSH_NOTIFICATION_1)) {
|
||||||
await this.deleteFile(fileName)
|
await this.deleteFile(fileName)
|
||||||
return OCRResult.BRAVE_PUSH_NOTIFICATION
|
return OCRResult.BRAVE_PUSH_NOTIFICATION
|
||||||
|
} else if (result.includes(CHROME_NOTIFICATION)) {
|
||||||
|
await this.deleteFile(fileName)
|
||||||
|
return OCRResult.CHROME_NOTIFICATION
|
||||||
} else if (result.includes(CHOOSE_POSITION_GOOGLE_FR)) {
|
} else if (result.includes(CHOOSE_POSITION_GOOGLE_FR)) {
|
||||||
await this.deleteFile(fileName)
|
await this.deleteFile(fileName)
|
||||||
return OCRResult.CHOOSE_POSITION
|
return OCRResult.CHOOSE_POSITION
|
||||||
|
|||||||
Reference in New Issue
Block a user