33
44
55class BIABPage (BasePage ):
6- WELCOME_PAGE_TITLE = "//span[normalize-space()='Multi-Agent-Custom-Automation-Engine']"
7- NEW_TASK_PROMPT = "//textarea[@id='newTaskPrompt']"
8- SEND_BUTTON = "//button[@class='send-button']"
9- TASK_LIST = "//span[contains(text(),'1.')]"
10- NEW_TASK = "//button[@id='newTaskButton']"
11- MOBILE_PLAN = "//div[@class='columns']//div[1]//div[1]//div[1]"
12- MOBILE_TASK1 = "//span[contains(text(),'1.')]"
13- MOBILE_TASK2 = "//span[contains(text(),'2.')]"
14- MOBILE_APPROVE_TASK1 = "i[title='Approve']"
15- ADDITIONAL_INFO = "//textarea[@id='taskMessageTextarea']"
16- ADDITIONAL_INFO_SEND_BUTTON = "//button[@id='taskMessageAddButton']"
17- STAGES = "//i[@title='Approve']"
6+ WELCOME_PAGE_TITLE = (
7+ "//span[normalize-space()='Multi-Agent-Custom-Automation-Engine']"
8+ )
9+ NEW_TASK_PROMPT = "//textarea[@id='newTaskPrompt']"
10+ SEND_BUTTON = "//button[@class='send-button']"
11+ TASK_LIST = "//span[contains(text(),'1.')]"
12+ NEW_TASK = "//button[@id='newTaskButton']"
13+ MOBILE_PLAN = "//div[@class='columns']//div[1]//div[1]//div[1]"
14+ MOBILE_TASK1 = "//span[contains(text(),'1.')]"
15+ MOBILE_TASK2 = "//span[contains(text(),'2.')]"
16+ MOBILE_APPROVE_TASK1 = "i[title='Approve']"
17+ ADDITIONAL_INFO = "//textarea[@id='taskMessageTextarea']"
18+ ADDITIONAL_INFO_SEND_BUTTON = "//button[@id='taskMessageAddButton']"
19+ STAGES = "//i[@title='Approve']"
1820
19-
20-
2121 def __init__ (self , page ):
2222 super ().__init__ (page )
2323 self .page = page
2424
2525 def click_my_task (self ):
2626 # self.page.locator(self.TASK_LIST).click()
2727 # self.page.wait_for_timeout(2000)
28- self .page .locator (self .TASK_LIST ).click ()
28+ self .page .locator (self .TASK_LIST ).click ()
2929 self .page .wait_for_timeout (10000 )
3030
31- def enter_aditional_info (self ,text ):
32- additional_info = self .page .frame (' viewIframe' ).locator (self .ADDITIONAL_INFO )
31+ def enter_aditional_info (self , text ):
32+ additional_info = self .page .frame (" viewIframe" ).locator (self .ADDITIONAL_INFO )
3333
34- if (additional_info ).is_enabled ():
34+ if (additional_info ).is_enabled ():
3535 additional_info .fill (text )
3636 self .page .wait_for_timeout (5000 )
3737 # Click on send button in question area
38- self .page .frame ('viewIframe' ).locator (self .ADDITIONAL_INFO_SEND_BUTTON ).click ()
38+ self .page .frame ("viewIframe" ).locator (
39+ self .ADDITIONAL_INFO_SEND_BUTTON
40+ ).click ()
3941 self .page .wait_for_timeout (5000 )
4042
4143 def click_send_button (self ):
4244 # Click on send button in question area
43- self .page .frame (' viewIframe' ).locator (self .SEND_BUTTON ).click ()
45+ self .page .frame (" viewIframe" ).locator (self .SEND_BUTTON ).click ()
4446 self .page .wait_for_timeout (25000 )
45- #self.page.wait_for_load_state('networkidle')
47+ # self.page.wait_for_load_state('networkidle')
4648
4749 def validate_rai_validation_message (self ):
4850 # Click on send button in question area
49- self .page .frame (' viewIframe' ).locator (self .SEND_BUTTON ).click ()
51+ self .page .frame (" viewIframe" ).locator (self .SEND_BUTTON ).click ()
5052 self .page .wait_for_timeout (1000 )
51- expect (self .page .frame ('viewIframe' ).locator ("//div[@class='notyf-announcer']" )).to_have_text ("Unable to create plan for this task." )
53+ expect (
54+ self .page .frame ("viewIframe" ).locator ("//div[@class='notyf-announcer']" )
55+ ).to_have_text ("Unable to create plan for this task." )
5256 self .page .wait_for_timeout (3000 )
5357
5458 def click_aditional_send_button (self ):
5559 # Click on send button in question area
56- self .page .frame (' viewIframe' ).locator (self .ADDITIONAL_INFO_SEND_BUTTON ).click ()
60+ self .page .frame (" viewIframe" ).locator (self .ADDITIONAL_INFO_SEND_BUTTON ).click ()
5761 self .page .wait_for_timeout (5000 )
5862
5963 def click_new_task (self ):
6064 self .page .locator (self .NEW_TASK ).click ()
6165 self .page .wait_for_timeout (5000 )
6266
6367 def click_mobile_plan (self ):
64- self .page .frame (' viewIframe' ).locator (self .MOBILE_PLAN ).click ()
68+ self .page .frame (" viewIframe" ).locator (self .MOBILE_PLAN ).click ()
6569 self .page .wait_for_timeout (3000 )
6670
6771 def validate_home_page (self ):
6872 expect (self .page .locator (self .WELCOME_PAGE_TITLE )).to_be_visible ()
6973
70-
71- def enter_a_question (self ,text ):
74+ def enter_a_question (self , text ):
7275 # Type a question in the text area
73- #self.page.pause()
74- self .page .frame (' viewIframe' ).locator (self .NEW_TASK_PROMPT ).fill (text )
76+ # self.page.pause()
77+ self .page .frame (" viewIframe" ).locator (self .NEW_TASK_PROMPT ).fill (text )
7578 self .page .wait_for_timeout (5000 )
7679
77-
7880 def processing_different_stage (self ):
79- if self .page .frame ('viewIframe' ).locator (self .STAGES ).count () >= 1 :
80- for i in range (self .page .frame ('viewIframe' ).locator (self .STAGES ).count ()):
81- approve_stages = self .page .frame ('viewIframe' ).locator (self .STAGES ).nth (0 )
81+ if self .page .frame ("viewIframe" ).locator (self .STAGES ).count () >= 1 :
82+ for i in range (self .page .frame ("viewIframe" ).locator (self .STAGES ).count ()):
83+ approve_stages = (
84+ self .page .frame ("viewIframe" ).locator (self .STAGES ).nth (0 )
85+ )
8286 approve_stages .click ()
83- self .page .wait_for_timeout (10000 )
87+ self .page .wait_for_timeout (10000 )
8488 BasePage .validate_response_status (self )
85- self .page .wait_for_timeout (10000 )
86- expect (self .page .frame ('viewIframe' ).locator ("//tag[@id='taskStatusTag']" )).to_have_text ("Completed" )
87- expect (self .page .frame ('viewIframe' ).locator ("//div[@id='taskProgressPercentage']" )).to_have_text ("100%" )
88-
89-
90-
91-
92-
89+ self .page .wait_for_timeout (10000 )
90+ expect (
91+ self .page .frame ("viewIframe" ).locator ("//tag[@id='taskStatusTag']" )
92+ ).to_have_text ("Completed" )
93+ expect (
94+ self .page .frame ("viewIframe" ).locator ("//div[@id='taskProgressPercentage']" )
95+ ).to_have_text ("100%" )
0 commit comments