check page is closed or not before inputing user info with try catch

This commit is contained in:
2022-09-13 13:49:40 +02:00
parent a56649e3a7
commit 44c096aea7
+6
View File
@@ -120,10 +120,16 @@ class CommandorPage {
}
async fillEmail(page) {
try {
if (!page.isClosed()) {
await page.locator(EMAIL_ID).focus();
await delay(getRandomWaitTime())
await page.locator(EMAIL_ID).fill(this.contact.mail);
}
} catch (e) {
console.log(e)
}
}
async inputPhoneNumber(page) {
try {