Merge branch 'master' into feature/recaptha

This commit is contained in:
PAN Lei
2022-05-23 17:28:09 +02:00
3 changed files with 7 additions and 15 deletions
+5 -4
View File
@@ -91,7 +91,7 @@ class CommandorPage:
"username": proxy_username,
"password": params.PROXY_PASSWORD
}
self.fill_fields()
# self.fill_fields()
# wait the captha element
# wait for sms_code field
# self.clickOnValidBtn()
@@ -118,6 +118,7 @@ class CommandorPage:
self.termine()
def fill_fields(self):
self.logger.info("will call fill_fields for " + str(self.contact.phone))
self._set_name(self.contact.last_name, self.contact.first_name)
self._setPhoneCountryAndStore()
self._setPhoneNumber(self.contact.phone)
@@ -183,13 +184,13 @@ class CommandorPage:
try:
if self.store_type == 0:
self.page.evaluate("""()=>{
document.getElementById("phone_country").focus();
//document.getElementById("phone_country").focus();
document.getElementById("phone_country").value = \"FR\" }""")
else:
store_to_choose = self.store_map[self.store_type]
self.page.evaluate("""(store_to_choose)=>{
document.getElementById("prefer").value = store_to_choose;
document.getElementById("phone_country").focus();
//document.getElementById("phone_country").focus();
document.getElementById("phone_country").value = \"FR\" }""", store_to_choose)
except Exception as error:
self.logger.error(error)
@@ -208,7 +209,7 @@ class CommandorPage:
self.page.evaluate("""(name)=> {
let surname = document.getElementById("surname");
if(surname.value.length == 0){
surname.focus();
// surname.focus();
surname.value = name.lastName;
document.getElementById("name").focus();
document.getElementById("name").value = name.firstName