You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
logger.info("Step 3: Validate GP Prompts response.")
21
-
forquestioninquestions:
22
-
#enter question
23
-
home_page.enter_chat_question(question)
24
-
# click on send button
25
-
home_page.click_send_button()
26
-
#validate the response status
27
-
home_page.validate_response_status(question)
28
-
#validate response text
29
-
response_text=page.locator("//p")
30
-
#assert response text
31
-
check.not_equal("I cannot answer this question from the data available. Please rephrase or add more details.", response_text.nth(response_text.count() -1).text_content(), f"Invalid response for : {question}")
32
-
check.not_equal("Chart cannot be generated.", response_text.nth(response_text.count() -1).text_content(), f"Invalid response for : {question}")
33
-
34
-
35
-
logger.info("Step 4: Validate chat history.")
36
-
home_page.show_chat_history()
72
+
home_page.page=page
73
+
74
+
log_capture=io.StringIO()
75
+
handler=logging.StreamHandler(log_capture)
76
+
logger.addHandler(handler)
77
+
78
+
logger.info(f"Running test step: {description}")
79
+
start=time.time()
80
+
81
+
try:
82
+
step(home_page)
83
+
finally:
84
+
duration=time.time() -start
85
+
logger.info(f"Execution Time for '{description}': {duration:.2f}s")
86
+
logger.removeHandler(handler)
37
87
38
-
logger.info("Step 5: Validate close chat history.")
0 commit comments