Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r302953f40b6bbfaf9a0688a0fda72e022258e10e -r18644d8168dd945e383ea4c072eea95d5ec396ea --- shared/scripts/configuration/utility.py (.../utility.py) (revision 302953f40b6bbfaf9a0688a0fda72e022258e10e) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 18644d8168dd945e383ea4c072eea95d5ec396ea) @@ -395,7 +395,7 @@ test.compare(ven_min, ven_low, "Actual Venous range minimum value: {} is equal to Expected value: {}".format(ven_min, ven_low)) test.endSection() - + def scroll_to_value_on_pop_up(value=None, container=None): """ scroll to the to the value if object is hidden @@ -522,33 +522,35 @@ test.endSection() -def verify_page_step_indicator(screen_obj, pre_treatment_step): +def verify_page_step_indicator(screen_obj, treatment_step, treatment_screens): """ Method to verify the Page Step indicators [the object on top of the screen which indicates the steps passed, current, remained] - @param pre_treatment_step : (int) indicates the Current pre-treatment step - """ + @param treatment_step : indicates the Current treatment step + """ + test.startSection("verification of page step indicators") - for page in range(len(config.PRE_TREATMENT_SCREENS)): + for page in range(len(treatment_screens)): bullet_children = object.children(squish.waitForObjectExists(get_bullet_object(screen_obj, page))) bullet_circle_color = bullet_children[0].color.name bullet_border_color = bullet_children[0].border.color.name - step_title = squish.waitForObjectExists(get_text_object(screen_obj, config.PRE_TREATMENT_SCREENS[page])) - #To verify the step indicators of the completed pre treatment screens - if page < pre_treatment_step: + step_title = squish.waitForObjectExists(get_text_object(screen_obj, treatment_screens[page])) + + #To verify the step indicators of the completed treatment screens + if page < treatment_step: test.verify(squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete) test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).current) test.compare(bullet_circle_color, config.COMPLETE_COLOR) - test.compare(bullet_border_color, config.COMPLETE_COLOR) - test.compare(step_title.color.name, config.ENABLED_COLOR) - #To verify the step indicators of the current pre treatment screen - elif page == pre_treatment_step: - test.verify(squish.waitForObjectExists(get_bullet_object(screen_obj, page)).current,) + test.compare(bullet_border_color,config.COMPLETE_COLOR) + test.compare(step_title.color.name,config.ENABLED_COLOR) + #To verify the step indicators of the current treatment screen + elif page == treatment_step: + test.verify(squish.waitForObjectExists(get_bullet_object(screen_obj, page)).current) test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete) test.compare(bullet_circle_color, config.CURRENT_COLOR) test.compare(bullet_border_color, config.COMPLETE_COLOR) test.compare(step_title.color.name, config.ENABLED_COLOR) test.verify(step_title.font.bold) - #To verify the step indicators of the remaining pre-treatment screens + #To verify the step indicators of the remaining treatment screens else: test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).current,) test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete,) @@ -631,7 +633,6 @@ def is_float(num): """ This function checks the value is adaptable for float conversion. - @param num - (string) input value for conversion. @return True/False- (bool) returns True if the value can type casted into float, else False """ @@ -646,7 +647,6 @@ def is_intiger(num): """ This function checks the value is adaptable for integer conversion. - @param num - (string) (string) input value for conversion. @return True/False- (bool) returns True if the value can type casted into int, else False """ @@ -660,12 +660,9 @@ def get_extracted_file(): """ This function is the handler for getting file from log folder. - This handler will go inside log folder and looks for newly added log based on current time. if it satisfied that condition, it will return the exact path of newly created log. - Application log file is automatically created on '/home/denali/Desktop/sd-card/log/ {current_date}_denaliSquish.log' - @return latest_file - (string) returns latest file that append on log folder from sd-data """ try: @@ -681,7 +678,6 @@ """ This method intended to extract the message from application log. For row[index], index represent column to be extracted. - @param file_name - (string) path of the latest log file created. @param message_text - (string) message text to be extracted. @return message - (list) API arguments displayed in log. @@ -725,9 +721,7 @@ """ This method intended to extract acknowledgement request status, negative requested acknowledgement and message id from application log. - For row[index], were index represent column to be extracted. - @param file_name - (string) path of the latest log file created. @param message_text - (string) message text to be extracted from log. @return row[3] - (string) acknowledgement request status. @@ -766,9 +760,7 @@ def get_bak_request_details(file_name, ack_bak_value): """ This method intended to extract the acknowledgement back status from application log. - For row[index], were index represent column to be extracted. - @param file_name - (string) path of the latest log file created. @param ack_bak_value - (string) Positive back acknowledgement value (Sq). @return row[3] - (string) acknowledgement back status. @@ -797,9 +789,7 @@ def get_current_log_details(message_ack = False, message_text = None): """ This function is capable to perform data analysis from application log folder. - logs are automatically created in path :"/home/denali/Desktop/sd-card/log/*.log". - In row[index], index represent column to be extracted. @param message_ack - (bool) 'True' - if ack is satisfied in log / 'False' - if ack condition is not satisfied @param message_text - (string) message text to be extracted from log. @@ -829,9 +819,7 @@ def get_extracted_error_file(): """ This function is the handler for getting error file from service folder. - Application log file is automatically created on '/home/denali/Desktop/sd-card/service/ {current_date}_denaliSquish.err ' - @return latest_file - (string) returns latest file that append on log folder from service """ try: @@ -905,10 +893,8 @@ def get_extracted_file_from_post_treatment(): """ This function is the handler for getting file from log folder. - This handler will go inside log folder and looks for newly added log based on current time. if it satisfied that condition, it will return the exact path of newly created log. - @return latest_file - (string) returns latest file that append on log folder from sd-data """ try: @@ -957,6 +943,3 @@ test.compare(bullet_circle_color,config.CURRENT_COLOR," the bullet color must be " + str(config.CURRENT_COLOR)) test.compare(bullet_border_color,config.INCOMPLETE_COLOR, " the bullet border color must be " + str(config.INCOMPLETE_COLOR)) test.endSection() - - - \ No newline at end of file