From a767923dcb2cce2ae527a2538f8dc6058a266f28 Mon Sep 17 00:00:00 2001 From: PAN Lei Date: Mon, 19 Sep 2022 13:39:05 +0200 Subject: [PATCH] print to console and files --- src/utiles/LoggerUtils.js | 1 + src/workers/CommandorPage.js | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/utiles/LoggerUtils.js b/src/utiles/LoggerUtils.js index 0dffea4..ef71a6c 100644 --- a/src/utiles/LoggerUtils.js +++ b/src/utiles/LoggerUtils.js @@ -16,6 +16,7 @@ const appointmentLogger = createLogger({ myFormat ), transports: [ + new transports.Console(), new transports.File({filename: path.join(homedir, "appointment_" + formatDate(new Date()) + ".log")}), ], }); diff --git a/src/workers/CommandorPage.js b/src/workers/CommandorPage.js index d4b6795..dca03e0 100644 --- a/src/workers/CommandorPage.js +++ b/src/workers/CommandorPage.js @@ -35,11 +35,11 @@ const CAPTCHA_ERROR_MESSAGE_FR = "La vérification du captcha a échoué" REGEX_RDV_URL = "https:\/\/rendezvousparis\.hermes\.com\/client\/register\/[A-Z0-9]+" const DEFAULT_STORE = 'faubourg'; -function delay(delayInms) { +function delay(delayInMs) { return new Promise(resolve => { setTimeout(() => { resolve(2); - }, delayInms); + }, delayInMs); }); } @@ -324,7 +324,7 @@ class CommandorPage { let audioBtn = await this.page.frameLocator("iframe").locator("#captcha__audio__button"); if (audioBtn) { log("audioBtn found") - audioBtn.click() + // audioBtn.click() } else { log("audioBtn not found") }