correction on handleErrors
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user