remove unused codes

This commit is contained in:
2023-11-20 22:27:55 +01:00
parent de17ebbc78
commit 0751c8a79f
+15 -46
View File
@@ -33,8 +33,6 @@ const MESSAGE_URL_VALIDATION_EN = "Please click on the link we sent by email"
const REGEX_RDV_URL = "https:\/\/rendezvousparis\.hermes\.com\/client\/register\/[A-Z0-9]+" const REGEX_RDV_URL = "https:\/\/rendezvousparis\.hermes\.com\/client\/register\/[A-Z0-9]+"
const DEFAULT_STORE = 'faubourg'; const DEFAULT_STORE = 'faubourg';
const searchTexts = ['hermes+rdv+online+paris', 'hermes+rdv+enligne+paris', 'hermes+rdv+en+ligne+paris', 'hermes+rendezvous+en+ligne+paris', 'hermes+appointment+online+paris', 'hermes+appointment+online+paris', 'appointment+hermes+paris+on+line', 'hermes+rendez+vous+online+paris', 'hermes+rendez+vous+paris+en+ligne', 'hermes+rendez+vous+paris+enligne', 'hermes+rendez+vous+paris+online', 'online+appointment+hermes+paris', 'hermes+online+appointment+paris', 'paris+hermes+online+appointment']
function delay(delayInMs) { function delay(delayInMs) {
return new Promise(resolve => { return new Promise(resolve => {
setTimeout(() => { setTimeout(() => {
@@ -92,31 +90,6 @@ class CommandorPage {
this.firstStart = true; this.firstStart = true;
} }
async getActivePage(browser, timeout) {
const start = new Date().getTime();
while (new Date().getTime() - start < timeout) {
logWithDevice("get pages", this.device)
let pages = await browser.pages();
try {
pages.forEach((currentPage) => {
if (currentPage.url() === RDV_URL) {
return currentPage;
} else {
try {
currentPage.close()
} catch (e) {
console.log(e)
}
}
})
} catch (e) {
this.isTerminated = true;
console.log(e)
}
}
throw "Unable to get active page";
}
async connect_to_browser(ocrResult) { async connect_to_browser(ocrResult) {
console.log("connect_to_browser() called"); console.log("connect_to_browser() called");
if (this.browser === undefined) { if (this.browser === undefined) {
@@ -193,7 +166,7 @@ class CommandorPage {
await this.enableDisableAirPlanMode(); await this.enableDisableAirPlanMode();
// await delay(10 * 1000); // await delay(10 * 1000);
await openUrlWithAdb(RDV_URL, this.device) await openUrlWithAdb(RDV_URL, this.device)
await delay(5000) await delay(10000)
await this.checkResultWithOcr() await this.checkResultWithOcr()
// await this.clickOnlineAppointment(); // await this.clickOnlineAppointment();
// } else { // } else {
@@ -748,10 +721,6 @@ class CommandorPage {
this.isTerminated = true this.isTerminated = true
} }
async deleteFromBlackList() {
await this.mongoManager.removeFromBlackList(this.contact)
}
async getErrors() { async getErrors() {
logWithDevice("getErrors", this.device); logWithDevice("getErrors", this.device);
await this.checkResultWithOcr(); await this.checkResultWithOcr();
@@ -1193,21 +1162,21 @@ class CommandorPage {
async enableDisableAirPlanMode() { async enableDisableAirPlanMode() {
logWithDevice("will enable/disable airplane mode", this.device) logWithDevice("will enable/disable airplane mode", this.device)
try { // try {
// await this.device.shell("cmd connectivity airplane-mode enable") // // await this.device.shell("cmd connectivity airplane-mode enable")
await exceutShellCmd(this.device, "cmd connectivity airplane-mode enable") // await exceutShellCmd(this.device, "cmd connectivity airplane-mode enable")
await delay(1000) // await delay(1000)
await exceutShellCmd(this.device, "cmd connectivity airplane-mode disable") // await exceutShellCmd(this.device, "cmd connectivity airplane-mode disable")
// // await this.device.shell("cmd connectivity airplane-mode disable")
// await delay(2000)
// } catch (e) {
// try {
// await this.device.shell("cmd connectivity airplane-mode disable") // await this.device.shell("cmd connectivity airplane-mode disable")
await delay(2000) // } catch (e) {
} catch (e) { // console.log(e)
try { // }
await this.device.shell("cmd connectivity airplane-mode disable") // console.log(e)
} catch (e) { // }
console.log(e)
}
console.log(e)
}
} }
async tapGoogleDisconnectBtn() { async tapGoogleDisconnectBtn() {