input directly the firstName

This commit is contained in:
Lei PAN
2023-08-12 18:31:16 +02:00
parent d2127f2cea
commit c1d03b5580
+13 -12
View File
@@ -381,14 +381,15 @@ class CommandorPage {
}, this.contact.lastName) }, this.contact.lastName)
await page.focus(FIRST_NAME); await page.focus(FIRST_NAME);
await delay(getRandomWaitTime()); await delay(getRandomWaitTime());
console.log("will clear name field"); // console.log("will clear name field");
await page.evaluate(() => { await page.evaluate((firstName) => {
let field = document.getElementById("name"); let field = document.getElementById("name");
if (field) { if (field) {
field.value = "" field.value = firstName;
// field.value = ""
} }
}) }, this.contact.firstName)
await page.keyboard.type(this.contact.firstName); // await page.keyboard.type(this.contact.firstName);
this.isNameInput = true; this.isNameInput = true;
} }
} }
@@ -906,13 +907,13 @@ class CommandorPage {
if (currentPage.url() === RDV_URL) { if (currentPage.url() === RDV_URL) {
this.page = currentPage; this.page = currentPage;
} else { } else {
try { // try {
if (!currentPage.isClosed()) { // if (!currentPage.isClosed()) {
currentPage.close() // currentPage.close()
} // }
} catch (e) { // } catch (e) {
console.log(e) // console.log(e)
} // }
} }
}) })
} catch (e) { } catch (e) {