use local server

This commit is contained in:
Lei PAN
2023-06-08 18:05:54 +02:00
parent 5c7ef11668
commit 577ca37c24
4 changed files with 21 additions and 13 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ let excelUtil = new ExcelUtil();
let collectionName = formatDate(new Date())
// device_to_excludes = ["47e7e36b", "e30eb015"]
// device_to_excludes = ["J4AXB761H2322WJ"]
device_to_excludes = [ "R9TR608ZLKJ", "heuklr55wo8tfyvw"]
device_to_excludes = ["4e8ca027", "hi7ljr5xduyt9pfi"]
attributedPorts = []
const device_port_info = new Map();
startPort = 9000
+5
View File
@@ -461,17 +461,20 @@ class CommandorPage {
await delay(getRandomWaitTime())
try {
if (!this.page.isClosed()) {
if (!this.isTerminated) {
this.page.evaluate(() => {
let element = document.getElementsByClassName("btn")[0];
if (typeof element !== 'undefined')
document.getElementsByClassName("btn")[0].focus();
})
}
await delay(getRandomWaitTime())
if (!this.page.isClosed()) {
try {
// remove debug flag
// const validElement = await page.$('.btn');
console.log("will click on valid button");
if (!this.isTerminated) {
await this.page.evaluate(() => {
document.getElementsByClassName("btn")[0].click();
})
@@ -479,6 +482,8 @@ class CommandorPage {
this.disconnectBrowser();
await this.checkResultWithOcr();
}
}
} catch (e) {
log(e);
await this.checkResultWithOcr()
+2
View File
@@ -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_5 = "Avec la mesure des performance"
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 CONFIRM_RESEND_FORM_FR = "Confirmer le nouvel envoi"
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)
|| 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_8)
|| result.includes(PAGE_OPTIMIZATION_CHROME_FR_7)
) {
return OCRResult.PAGE_OPTIMIZATION
+2 -1
View File
@@ -4,7 +4,8 @@ const {exec} = require("child_process");
const axios = require("axios");
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) {
return new Promise(resolve => {