1111class DashboardPage (NavigationBarPage ):
1212 """Class for Dashboard page"""
1313
14- def __init__ (self , driver , cfg , enterprise ):
14+ def __init__ (self , driver , cfg , video_start_time , enterprise ):
1515 """dashboardPage class initialization"""
16- super ().__init__ (driver , cfg )
16+ super ().__init__ (driver , cfg , video_start_time )
1717 self .check_server_package_name_id = "enterpriseLabel" if enterprise else "communityLabel"
1818 self .check_current_package_version_id = "currentVersion"
1919 self .check_current_username_id = "//li[@id='userBar']//span[@class='toggle']"
@@ -31,7 +31,7 @@ def __init__(self, driver, cfg, enterprise):
3131 def check_server_package_name (self ):
3232 """checking server package version name"""
3333 check_server_package_name_sitem = self .locator_finder_by_id (self .check_server_package_name_id )
34- print ( "Server Package: " , check_server_package_name_sitem .text )
34+ self . tprint ( f "Server Package: { check_server_package_name_sitem .text } " )
3535 time .sleep (1 )
3636
3737 def check_current_package_version (self ):
@@ -41,25 +41,23 @@ def check_current_package_version(self):
4141 def check_current_username (self ):
4242 """checking current username from the dashboard"""
4343 check_current_username_sitem = self .locator_finder_by_xpath (self .check_current_username_id )
44- print ( "Current User: " , check_current_username_sitem .text )
44+ self . tprint ( f "Current User: { check_current_username_sitem .text } " )
4545 time .sleep (1 )
4646
4747 def check_current_db (self ):
4848 """checking current database name from the dashboard"""
4949 check_current_db_sitem = self .locator_finder_by_xpath (self .check_current_db_id )
50- print ( "Current DB: " , check_current_db_sitem .text )
50+ self . tprint ( f "Current DB: { check_current_db_sitem .text } " )
5151 time .sleep (1 )
5252
5353 def check_db_status (self , cluster ):
5454 """checking current database status from the dashboard"""
5555 if cluster :
5656 status = self .locator_finder_by_xpath (self .check_cluster_status_id )
57- print ("Cluster Health: " , status .text )
58-
57+ self .tprint (f"Cluster Health: { status .text } " )
5958 else :
6059 status = self .locator_finder_by_xpath (self .check_db_status_id )
61- print ("Current Status: " , status .text )
62-
60+ self .tprint (f"Current Status: { status .text } " )
6361 if cluster :
6462 assert (
6563 status .text in "NODES OK"
@@ -69,20 +67,18 @@ def check_db_status(self, cluster):
6967 assert (
7068 status .text in "GOOD"
7169 ), f"Expected page title GOOD but got { status .text } "
72-
7370 time .sleep (1 )
74-
7571
7672 def check_db_engine (self ):
7773 """checking current database status from the dashboard"""
7874 check_db_engine_sitem = self .locator_finder_by_id (self .check_db_engine_id )
79- print ( "Current Engine: " , check_db_engine_sitem .text )
75+ self . tprint ( f "Current Engine: { check_db_engine_sitem .text } " )
8076 time .sleep (1 )
8177
8278 def check_db_uptime (self ):
8379 """checking current database uptime status from the dashboard"""
8480 check_db_uptime_sitem = self .locator_finder_by_xpath (self .check_db_uptime_id )
85- print ( "DB Uptime: " , check_db_uptime_sitem .text )
81+ self . tprint ( f "DB Uptime: { check_db_uptime_sitem .text } " )
8682 time .sleep (1 )
8783
8884 def check_responsiveness_for_dashboard (self ):
@@ -96,7 +92,7 @@ def check_system_resource(self):
9692 check_system_resource_sitem .click ()
9793 time .sleep (3 )
9894 except TimeoutException as ex :
99- print ("FAIL: cound not find the system-statistics locator! \n " + str (ex ))
95+ self . tprint ("FAIL: cound not find the system-statistics locator! \n " + str (ex ))
10096
10197 def check_distribution_tab (self ):
10298 """Checking distribution tab"""
@@ -119,16 +115,16 @@ def check_system_metrics(self):
119115 check_system_metrics_sitem .click ()
120116 time .sleep (1 )
121117
122- print ("scrolling the current page \n " )
118+ self . tprint ("scrolling the current page \n " )
123119 self .scroll ()
124120
125121 # toggle view text to table and vice-versa
126- print ("Changing metrics tab to table view \n " )
122+ self . tprint ("Changing metrics tab to table view \n " )
127123 text_view = self .locator_finder_by_id (self .show_text )
128124 text_view .click ()
129125 time .sleep (3 )
130126
131- print ("Changing metrics tab to text view \n " )
127+ self . tprint ("Changing metrics tab to text view \n " )
132128 table_view = self .locator_finder_by_id (self .show_text )
133129 table_view .click ()
134130 time .sleep (3 )
@@ -139,11 +135,11 @@ def check_system_metrics(self):
139135
140136 # Downloading metrics from the dashboard
141137 if self .webdriver .name == "chrome" : # this will check browser name
142- print ("Downloading metrics has been disabled for the Chrome browser \n " )
138+ self . tprint ("Downloading metrics has been disabled for the Chrome browser \n " )
143139 else :
144140 metrics_download_sitem = self .locator_finder_by_id (self .metrics_download_id )
145141 metrics_download_sitem .click ()
146142 time .sleep (3 )
147143 # self.clear_download_bar()
148144 else :
149- print ("Metrics Tab not supported for the current package \n " )
145+ self . tprint ("Metrics Tab not supported for the current package \n " )
0 commit comments