create timeout variable
This commit is contained in:
+4
-4
@@ -25,7 +25,7 @@ OTP_FIELD_ID = "#sms_code"
|
|||||||
MESSAGE_FIELD_CLASS = ".message"
|
MESSAGE_FIELD_CLASS = ".message"
|
||||||
|
|
||||||
CONFIRMED_MESSAGE = "Your request for a Leather Goods appointment has been registered"
|
CONFIRMED_MESSAGE = "Your request for a Leather Goods appointment has been registered"
|
||||||
|
TIME_OUT = 400000
|
||||||
|
|
||||||
def get_random_wait_time() -> float:
|
def get_random_wait_time() -> float:
|
||||||
wait_time = random.randint(0, 10) / 10.0 * 5
|
wait_time = random.randint(0, 10) / 10.0 * 5
|
||||||
@@ -63,10 +63,10 @@ class CommandorPage:
|
|||||||
#
|
#
|
||||||
self._checkCgu()
|
self._checkCgu()
|
||||||
# wait for sms_code field
|
# wait for sms_code field
|
||||||
self.clickOnValidBtn()
|
# self.clickOnValidBtn()
|
||||||
on_ready_for_otp(e, self)
|
on_ready_for_otp(e, self)
|
||||||
otp_input = self.page.locator(OTP_FIELD_ID)
|
otp_input = self.page.locator(OTP_FIELD_ID)
|
||||||
otp_input.wait_for(state='visible', timeout=90000)
|
otp_input.wait_for(state='visible', timeout=TIME_OUT)
|
||||||
event_is_set = e.wait()
|
event_is_set = e.wait()
|
||||||
logging.info('event set: %s', event_is_set)
|
logging.info('event set: %s', event_is_set)
|
||||||
if self.otp_value:
|
if self.otp_value:
|
||||||
@@ -74,7 +74,7 @@ class CommandorPage:
|
|||||||
time.sleep(get_random_wait_time())
|
time.sleep(get_random_wait_time())
|
||||||
self.clickOnValidBtn()
|
self.clickOnValidBtn()
|
||||||
otp_sent = self.page.locator(MESSAGE_FIELD_CLASS)
|
otp_sent = self.page.locator(MESSAGE_FIELD_CLASS)
|
||||||
otp_sent.wait_for(state='visible', timeout=90000)
|
otp_sent.wait_for(state='visible', timeout=TIME_OUT)
|
||||||
message = self.page.content()
|
message = self.page.content()
|
||||||
# print("message is:" + message)
|
# print("message is:" + message)
|
||||||
time.sleep(get_random_wait_time())
|
time.sleep(get_random_wait_time())
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class ExcelHelper:
|
|||||||
user_agents.append(user_agent)
|
user_agents.append(user_agent)
|
||||||
return user_agents
|
return user_agents
|
||||||
|
|
||||||
def read_contacts(self,file_name="/contact.xlsx") -> list:
|
def read_contacts(self,file_name="/contact_all.xlsx") -> list:
|
||||||
contact_list_in_json = pandas.read_excel(definitions.ROOT_DIR + file_name).to_json(orient='records')
|
contact_list_in_json = pandas.read_excel(definitions.ROOT_DIR + file_name).to_json(orient='records')
|
||||||
contact_dict_list = json.loads(contact_list_in_json)
|
contact_dict_list = json.loads(contact_list_in_json)
|
||||||
contact_list = []
|
contact_list = []
|
||||||
|
|||||||
Reference in New Issue
Block a user