correction on handleErrors

This commit is contained in:
2022-09-09 14:53:09 +02:00
parent 10a371ae38
commit 2017e8b099
2 changed files with 15 additions and 14 deletions
+10 -13
View File
@@ -200,15 +200,12 @@ class CommandorPage {
document.getElementById("g-recaptcha-response").innerHTML = solution;
}, solution)
this.clickValid();
} catch
(e) {
console.log(e)
this.isTerminated = true;
}
catch
(e)
{
console.log(e)
this.isTerminated = true;
}
}
else{
} else {
this.isTerminated = true;
}
})
@@ -225,14 +222,14 @@ class CommandorPage {
if (currentPage.url() === RDV_URL) {
await this.fillFields(this.page);
if (this.isFillingFields)
this.getErrors()
await this.getErrors()
} else {
if (content.includes(MESSAGE_URL_VALIDATION_FR)) {
console.log("successful");
await this.push_message_to_queue(PublishType.SUCCESS);
} else {
// try to get errors
this.getErrors()
await this.getErrors()
}
}
}
@@ -286,14 +283,14 @@ class CommandorPage {
}
getErrors() {
async getErrors() {
if (this.page.url() === BLANK_URL) {
this.isTerminated = true;
} else {
try {
let errorItem = this.page.querySelector("div.alert");
let errorItem = this.page.locator("div.alert");
if (errorItem) {
let errorContent = errorItem.innerHTML;
let errorContent = await errorItem.innerHTML();
console.log("error:" + errorContent);
this.handleError(errorContent);
}