Merge branch 'master' into feature/gui

This commit is contained in:
2022-09-12 21:28:34 +02:00
+28
View File
@@ -101,14 +101,23 @@ class CommandorPage {
}
async chooseCountry(page) {
if (!page.isClosed()) {
try {
await page.locator(COUNTRY_ID).focus();
await delay(getRandomWaitTime())
await page.click(COUNTRY_ID);
await delay(getRandomWaitTime())
await page.selectOption(COUNTRY_ID, 'FR');
await delay(getRandomWaitTime())
} catch (e) {
console.log(e);
this.isTerminated = true;
}
// await page.click(COUNTRY_ID);
}
}
async fillEmail(page) {
await page.locator(EMAIL_ID).focus();
@@ -117,18 +126,35 @@ class CommandorPage {
}
async inputPhoneNumber(page) {
try {
if (!page.isClosed()) {
await page.locator(PHONE_NUMBER).focus()
await page.locator(PHONE_NUMBER).fill("0" + this.contact.phoneNumber)
}
} catch (e) {
console.log(e);
this.isTerminated = true;
}
}
async inputName(page) {
await page.locator(LAST_NAME).focus()
await delay(getRandomWaitTime())
try {
if (!page.isClosed()) {
await page.locator(LAST_NAME).fill(this.contact.lastName)
await page.locator(FIRST_NAME).focus()
await delay(getRandomWaitTime())
await page.locator(FIRST_NAME).fill(this.contact.firstName)
}
} catch (e) {
console.log(e);
this.isTerminated = true
}
}
async inputPassportId(page) {
await page.locator(PASSPORT_ID).focus()
@@ -178,10 +204,12 @@ class CommandorPage {
document.getElementsByClassName("btn")[0].focus();
})
await delay(getRandomWaitTime())
if (!this.page.isClosed()) {
this.page.evaluate(() => {
document.getElementsByClassName("btn")[0].click();
})
}
}
} catch (e) {
console.log(e)
}