check page is closed or not before inputing user info

This commit is contained in:
2022-09-12 11:59:49 +02:00
parent fb69de40d0
commit 2076154da7
+6 -4
View File
@@ -124,10 +124,12 @@ class CommandorPage {
async inputName(page) { async inputName(page) {
await page.locator(LAST_NAME).focus() await page.locator(LAST_NAME).focus()
await delay(getRandomWaitTime()) await delay(getRandomWaitTime())
await page.locator(LAST_NAME).fill(this.contact.lastName) if (!page.isClosed()) {
await page.locator(FIRST_NAME).focus() await page.locator(LAST_NAME).fill(this.contact.lastName)
await delay(getRandomWaitTime()) await page.locator(FIRST_NAME).focus()
await page.locator(FIRST_NAME).fill(this.contact.firstName) await delay(getRandomWaitTime())
await page.locator(FIRST_NAME).fill(this.contact.firstName)
}
} }
async inputPassportId(page) { async inputPassportId(page) {