use brave as browser
This commit is contained in:
@@ -8,7 +8,8 @@ const puppeteer = require('puppeteer');
|
||||
const GeoCaptchaSolver = require("./GeoCaptchaSolver");
|
||||
const SlidingCaptchaSolver = require("./SlidingCaptchaSolver");
|
||||
const OCRChecker = require("./OCRChecker");
|
||||
const {main} = require("yarn/lib/cli");
|
||||
const {main, elephant} = require("yarn/lib/cli");
|
||||
const {exec} = require("child_process");
|
||||
// const RDV_URL = "http://192.168.0.44:8000/test_appointment.html"
|
||||
const RDV_URL = "https://rendezvousparis.hermes.com/client/register";
|
||||
const BLANK_URL = "about:blank"
|
||||
@@ -665,6 +666,11 @@ class CommandorPage {
|
||||
|
||||
async slidingCaptcha(onResult) {
|
||||
logWithDevice("slidingCaptcha", this.device);
|
||||
if (this.device.model() === "MI 5s") {
|
||||
let cmd = `adb -s ${this.device.serial()} shell input touchscreen swipe 900 495 900 295`
|
||||
await exec(cmd);
|
||||
await delay(1000);
|
||||
}
|
||||
let slidingCaptchaSolver = new SlidingCaptchaSolver(this.device);
|
||||
await slidingCaptchaSolver.solve(this.page, async (isSuccessful) => {
|
||||
console.log("check isAlwaysBlocked")
|
||||
@@ -893,12 +899,18 @@ class CommandorPage {
|
||||
await this.checkResultWithOcr();
|
||||
break;
|
||||
case OCRResult.BRAVE_PRIVACY:
|
||||
await this.device.shell("input tap " + 500 + " " + 1120)
|
||||
if (this.device.model() === "MI 5s")
|
||||
await this.device.shell("input tap " + 530 + " " + 970)
|
||||
else
|
||||
await this.device.shell("input tap " + 500 + " " + 1120)
|
||||
await delay(2000);
|
||||
await this.checkResultWithOcr();
|
||||
break;
|
||||
case OCRResult.BRAVE_PRIVACY_PUB:
|
||||
await this.device.shell("input tap " + 455 + " " + 1920)
|
||||
if (this.device.model() === "MI 5s")
|
||||
await this.device.shell("input tap " + 60 + " " + 900)
|
||||
else
|
||||
await this.device.shell("input tap " + 455 + " " + 1920)
|
||||
await delay(2000);
|
||||
await this.checkResultWithOcr();
|
||||
break;
|
||||
@@ -993,8 +1005,11 @@ class CommandorPage {
|
||||
|
||||
|
||||
async handleBraveSkipBtn() {
|
||||
if (this.device.model() === "CPH2219") {
|
||||
let model = this.device.model()
|
||||
if (model === "CPH2219") {
|
||||
await this.device.shell("input tap " + 558 + " " + 1160)
|
||||
} else if (model === "MI 5s") {
|
||||
await this.device.shell("input tap " + 530 + " " + 1000)
|
||||
} else {
|
||||
await this.device.shell("input tap " + 470 + " " + 1160)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user