create timeout variable

This commit is contained in:
2022-04-12 15:49:58 +02:00
parent 5177dc859e
commit 4fdcaf09ce
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -25,7 +25,7 @@ OTP_FIELD_ID = "#sms_code"
MESSAGE_FIELD_CLASS = ".message"
CONFIRMED_MESSAGE = "Your request for a Leather Goods appointment has been registered"
TIME_OUT = 400000
def get_random_wait_time() -> float:
wait_time = random.randint(0, 10) / 10.0 * 5
@@ -63,10 +63,10 @@ class CommandorPage:
#
self._checkCgu()
# wait for sms_code field
self.clickOnValidBtn()
# self.clickOnValidBtn()
on_ready_for_otp(e, self)
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()
logging.info('event set: %s', event_is_set)
if self.otp_value:
@@ -74,7 +74,7 @@ class CommandorPage:
time.sleep(get_random_wait_time())
self.clickOnValidBtn()
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()
# print("message is:" + message)
time.sleep(get_random_wait_time())