use local server
This commit is contained in:
+1
-1
@@ -12,7 +12,7 @@ let excelUtil = new ExcelUtil();
|
|||||||
let collectionName = formatDate(new Date())
|
let collectionName = formatDate(new Date())
|
||||||
// device_to_excludes = ["47e7e36b", "e30eb015"]
|
// device_to_excludes = ["47e7e36b", "e30eb015"]
|
||||||
// device_to_excludes = ["J4AXB761H2322WJ"]
|
// device_to_excludes = ["J4AXB761H2322WJ"]
|
||||||
device_to_excludes = [ "R9TR608ZLKJ", "heuklr55wo8tfyvw"]
|
device_to_excludes = ["4e8ca027", "hi7ljr5xduyt9pfi"]
|
||||||
attributedPorts = []
|
attributedPorts = []
|
||||||
const device_port_info = new Map();
|
const device_port_info = new Map();
|
||||||
startPort = 9000
|
startPort = 9000
|
||||||
|
|||||||
@@ -461,24 +461,29 @@ class CommandorPage {
|
|||||||
await delay(getRandomWaitTime())
|
await delay(getRandomWaitTime())
|
||||||
try {
|
try {
|
||||||
if (!this.page.isClosed()) {
|
if (!this.page.isClosed()) {
|
||||||
this.page.evaluate(() => {
|
if (!this.isTerminated) {
|
||||||
let element = document.getElementsByClassName("btn")[0];
|
this.page.evaluate(() => {
|
||||||
if (typeof element !== 'undefined')
|
let element = document.getElementsByClassName("btn")[0];
|
||||||
document.getElementsByClassName("btn")[0].focus();
|
if (typeof element !== 'undefined')
|
||||||
})
|
document.getElementsByClassName("btn")[0].focus();
|
||||||
|
})
|
||||||
|
}
|
||||||
await delay(getRandomWaitTime())
|
await delay(getRandomWaitTime())
|
||||||
if (!this.page.isClosed()) {
|
if (!this.page.isClosed()) {
|
||||||
try {
|
try {
|
||||||
// remove debug flag
|
// remove debug flag
|
||||||
// const validElement = await page.$('.btn');
|
// const validElement = await page.$('.btn');
|
||||||
console.log("will click on valid button");
|
console.log("will click on valid button");
|
||||||
await this.page.evaluate(() => {
|
if (!this.isTerminated) {
|
||||||
document.getElementsByClassName("btn")[0].click();
|
await this.page.evaluate(() => {
|
||||||
})
|
document.getElementsByClassName("btn")[0].click();
|
||||||
if (this.firstStart) {
|
})
|
||||||
this.disconnectBrowser();
|
if (this.firstStart) {
|
||||||
await this.checkResultWithOcr();
|
this.disconnectBrowser();
|
||||||
|
await this.checkResultWithOcr();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log(e);
|
log(e);
|
||||||
await this.checkResultWithOcr()
|
await this.checkResultWithOcr()
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ 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 PAGE_OPTIMIZATION_CHROME_FR_7 = "Les annonces suggérées par les"
|
||||||
|
const PAGE_OPTIMIZATION_CHROME_FR_8 = "Chrome estime vos centres"
|
||||||
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"
|
||||||
@@ -99,6 +100,7 @@ class OCRChecker {
|
|||||||
} else if (result.includes(PAGE_OPTIMIZATION_CHROME_FR) || result.includes(PAGE_OPTIMIZATION_CHROME_FR_2) || result.includes(PAGE_OPTIMIZATION_CHROME_FR_3)
|
} 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_4) || result.includes(PAGE_OPTIMIZATION_CHROME_FR_5)
|
||||||
|| result.includes(PAGE_OPTIMIZATION_CHROME_FR_6)
|
|| result.includes(PAGE_OPTIMIZATION_CHROME_FR_6)
|
||||||
|
|| result.includes(PAGE_OPTIMIZATION_CHROME_FR_8)
|
||||||
|| result.includes(PAGE_OPTIMIZATION_CHROME_FR_7)
|
|| result.includes(PAGE_OPTIMIZATION_CHROME_FR_7)
|
||||||
) {
|
) {
|
||||||
return OCRResult.PAGE_OPTIMIZATION
|
return OCRResult.PAGE_OPTIMIZATION
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ const {exec} = require("child_process");
|
|||||||
const axios = require("axios");
|
const axios = require("axios");
|
||||||
const {v4: uuidv4} = require('uuid');
|
const {v4: uuidv4} = require('uuid');
|
||||||
|
|
||||||
const DEEPLEARNING_CAPTCHA_HOST = "http://appointment.lpaconsulting.fr:9000"
|
// const DEEPLEARNING_CAPTCHA_HOST = "http://appointment.lpaconsulting.fr:9000"
|
||||||
|
const DEEPLEARNING_CAPTCHA_HOST = "http://192.168.0.36:9000"
|
||||||
|
|
||||||
function delay(delayInMs) {
|
function delay(delayInMs) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
|
|||||||
Reference in New Issue
Block a user