def validate_social_media_youtube(driver, social_media_youtube, youtube_layer_name, index, ws_index): """ Method to validate the twitter social media item """ try: row_tweet_container = driver.find_elements_by_class_name("rowYoutubeContainer") row_tweet_container[0].click() except Exception: AppCommanUtility.widget_close_icon(driver, social_media_youtube, index, ws_index) TestResults.open_py_excel_pass(index, ws_index) return True AppCommanUtility.click_minimize_btn(driver, social_media_youtube, index, ws_index) YouTubeValidation.validate_youtube_highlighted_buffer(driver) AppCommanUtility.widget_close_icon(driver, social_media_youtube, index, ws_index) YouTubeValidation.validate_youtube_buffer(driver) AppCommanUtility.click_down_panel(driver, social_media_youtube, index, ws_index) AppCommanUtility.click_select_layer_label_container(driver, social_media_youtube, index, ws_index) AppCommanValidation.validate_layer_name(driver, youtube_layer_name, social_media_youtube, index, ws_index, boolean_value=True) AppCommanValidation.validate_right_panel_layer_name(driver, youtube_layer_name, social_media_youtube, index, ws_index) AppCommanValidation.validate_feature_count_panel(driver, social_media_youtube, index, ws_index) AppCommanValidation.validate_feature_count(driver, "youtubeResultFeatureLayer", social_media_youtube, index, ws_index) TestResults.open_py_excel_pass(index, ws_index)
def validate_browse_widget(driver, category_sub_layer_name, tool_name, index, ws_index): AppCommanValidation.validate_right_panel_layer_name(driver, category_sub_layer_name, tool_name, index, ws_index) # click_bottom_panel_layer_name(driver, tool_name, index, ws_index) AppCommanValidation.validate_feature_count_panel(driver, tool_name, index, ws_index) AppCommanValidation.validate_feature_count(driver, category_sub_layer_name, tool_name, index, ws_index) TestLogBombBlast.open_py_excel_pass(index, ws_index)
def validate_avl_live_tab(driver, agency_feed_avl, avl_live_layer_name, index, ws_index): try: avl_live_layer = driver.find_element_by_id("avlLive_layer") if avl_live_layer.is_displayed(): AppCommanUtility.click_minimize_btn(driver, agency_feed_avl, index, ws_index) AppCommanUtility.click_down_panel(driver, agency_feed_avl, index, ws_index) AppCommanUtility.click_select_layer_label_container(driver, agency_feed_avl, index, ws_index) AppCommanValidation.validate_layer_name(driver, avl_live_layer_name, agency_feed_avl, index, ws_index, boolean_value=True) AppCommanUtility.click_live_tab(driver, agency_feed_avl, index, ws_index) AppCommanValidation.validate_right_panel_layer_name(driver, avl_live_layer_name, agency_feed_avl, index, ws_index) AppCommanValidation.validate_feature_count(driver, "avlLive", agency_feed_avl, index, ws_index) AppCommanUtility.click_maximize_btn(driver, agency_feed_avl, index, ws_index) TestResults.open_py_excel_pass(index, ws_index) else: AppCommanUtility.click_popup_close_icon(driver, agency_feed_avl) except Exception: AppCommanUtility.click_popup_close_icon(driver, agency_feed_avl)
def click_okbtn_historic_select_by_unit_tab(driver, agency_feed_avl, index, ws_index): try: avl_ok_content = driver.find_elements_by_class_name("avlOkContent") avl_ok_content[1].click() time.sleep(2) except Exception: TestFailScreenShots.get_screenshots(driver, agency_feed_avl, "click_okbtn_historic_select_by_unit_tab") TestLog.log_creation(agency_feed_avl, "click_okbtn_historic_select_by_unit_tab", index, ws_index) try: avl_historic_layer = driver.find_element_by_id("avlHistoricLayer_layer") if avl_historic_layer.is_displayed(): AppCommanUtility.click_minimize_btn(driver, agency_feed_avl, index, ws_index) AppCommanUtility.click_down_panel(driver, agency_feed_avl, index, ws_index) AppCommanUtility.click_select_layer_label_container(driver, agency_feed_avl, index, ws_index) AppCommanValidation.validate_layer_name(driver, "AVL Historic Layer", agency_feed_avl, index, ws_index, boolean_value=True) AppCommanValidation.validate_right_panel_layer_name(driver, "AVL Historic Layer", agency_feed_avl, index, ws_index) AppCommanValidation.validate_agency_feed_avl_historic_tab(driver, "avlHistoricLayer") AppCommanUtility.click_maximize_btn(driver, agency_feed_avl, index, ws_index) except Exception: AppCommanUtility.click_popup_close_icon(driver, agency_feed_avl)
def validate_agency_feed_lpr_live_tab(driver, agency_feed_lpr_textbox, agency_feed_lpr_item, index, ws_index): try: lpr_live_layer = driver.find_element_by_id("lprLive_layer") if lpr_live_layer.is_displayed(): AppCommanUtility.click_minimize_btn(driver, "LPR", index, ws_index) AppCommanUtility.click_down_panel(driver, agency_feed_lpr_item, index, ws_index) AppCommanUtility.click_select_layer_label_container(driver, agency_feed_lpr_item, index, ws_index) AppCommanValidation.validate_layer_name(driver, "LPN SUSPECT", agency_feed_lpr_item, index, ws_index, boolean_value=True) AppCommanUtility.click_live_tab(driver, agency_feed_lpr_item, index, ws_index) AppCommanValidation.validate_right_panel_layer_name(driver, "LPN SUSPECT", agency_feed_lpr_item, index, ws_index) AppCommanValidation.validate_feature_count(driver, "lpnlive", agency_feed_lpr_item, index, ws_index) AppCommanUtility.click_maximize_btn(driver, "LPR", index, ws_index) else: AppCommanUtility.click_popup_close_icon(driver, "LPR") except Exception: AppCommanUtility.click_popup_close_icon(driver, "LPR")
def validate_social_media_flickr(driver, social_media_flickr, flickr_layer, index, ws_index): """ Method to validate the twitter social media item """ try: row_tweet_container = driver.find_elements_by_class_name( "rowflickrContainer") row_tweet_container[0].click() except Exception: AppCommanUtility.widget_close_icon(driver, social_media_flickr, index, ws_index) return True AppCommanUtility.click_minimize_btn(driver, social_media_flickr, index, ws_index) FlickrValidation.validate_flickr_buffer(driver) AppCommanUtility.widget_close_icon(driver, social_media_flickr, index, ws_index) FlickrValidation.validate_flickr_highlighted_buffer(driver) AppCommanUtility.click_down_panel(driver, social_media_flickr, index, ws_index) AppCommanUtility.click_select_layer_label_container( driver, social_media_flickr, index, ws_index) AppCommanValidation.validate_layer_name(driver, flickr_layer, social_media_flickr, index, ws_index, boolean_value=True) AppCommanValidation.validate_right_panel_layer_name( driver, flickr_layer, social_media_flickr, index, ws_index) AppCommanValidation.validate_feature_count_panel(driver, social_media_flickr, index, ws_index) AppCommanValidation.validate_feature_count(driver, "flickrResultFeatureLayer", social_media_flickr, index, ws_index) TestResults.open_py_excel_pass(index, ws_index)
def tool_search_attribute_validation(driver, search_attribute_select_layer_textbox_text, search_attribute_sub_layer_name, tools_advanced_search_search_attribute_item, index, ws_index): """ Method to perfrom validation of search attribute """ AppCommanUtility.click_down_panel(driver, tools_advanced_search_search_attribute_item, index, ws_index) AppCommanUtility.click_select_layer_label_container(driver, tools_advanced_search_search_attribute_item, index, ws_index) AppCommanUtility.click_right_panel_open(driver, tools_advanced_search_search_attribute_item, index, True, ws_index) AppCommanValidation.validate_right_panel_layer_name(driver, search_attribute_select_layer_textbox_text, tools_advanced_search_search_attribute_item, index, ws_index) click_bottom_panel_layer_name(driver, tools_advanced_search_search_attribute_item, index, ws_index) AppCommanValidation.validate_feature_count_panel(driver, tools_advanced_search_search_attribute_item, index, ws_index) AppCommanValidation.validate_feature_count(driver, search_attribute_select_layer_textbox_text, tools_advanced_search_search_attribute_item, index, ws_index)
def validate_browse_widget(driver, category_sub_layer_name, tool_name, index, ws_index): AppCommanValidation.validate_right_panel_layer_name( driver, category_sub_layer_name, tool_name, index, ws_index) # click_bottom_panel_layer_name(driver, tool_name, index, ws_index) AppCommanValidation.validate_feature_count_panel(driver, tool_name, index, ws_index) AppCommanValidation.validate_feature_count(driver, category_sub_layer_name, tool_name, index, ws_index) TestLogBombBlast.open_py_excel_pass(index, ws_index)
def tool_selection_buffer_validation(driver, tools_utilities_selection_item, index, ws_index): """ Method to validate buffer tab""" AppCommanUtility.click_down_panel(driver, tools_utilities_selection_item, index, ws_index) AppCommanUtility.click_select_layer_label_container(driver, tools_utilities_selection_item, index, ws_index) AppCommanUtility.click_right_panel_open(driver, True, tools_utilities_selection_item, index, ws_index) # AppCommanUtility.click_graphics_tab(driver) AppCommanValidation.validate_right_panel_layer_name(driver, tools_utilities_selection_item, tools_utilities_selection_item, index, ws_index) AppCommanUtility.click_bottom_panel_layer(driver, "Select Buffer Results", tools_utilities_selection_item, index, ws_index) AppCommanValidation.validate_feature_count_panel(driver, tools_utilities_selection_item, index, ws_index) AppCommanValidation.validate_feature_count(driver, "proximityResultLayer", tools_utilities_selection_item, index, ws_index)
def tool_selection_proximity_validation(driver, tools_utilities_selection_item, index, ws_index): """ Method to validate proximity tab """ AppCommanUtility.widget_close_icon(driver, tools_utilities_selection_item, index, ws_index) AppCommanUtility.click_select_layer_label_container(driver, tools_utilities_selection_item, index, ws_index) AppCommanValidation.validate_right_panel_layer_name(driver, tools_utilities_selection_item, tools_utilities_selection_item, index, ws_index) AppCommanUtility.click_bottom_panel_layer(driver, "Proximity Results", tools_utilities_selection_item, index, ws_index) AppCommanValidation.validate_feature_count_panel(driver, tools_utilities_selection_item, index, ws_index) AppCommanValidation.validate_feature_count(driver, "proximityResultLayer", tools_utilities_selection_item, index, ws_index) TestResults.open_py_excel_pass(index, ws_index)
def tool_bomb_blast_validation(driver,index, tool_bomb_blast_widget_name, tools_utilities_bomb_blast_item, ws_index): """ Method to perform validation of tool bomb blast """ AppCommanUtility.click_down_panel(driver, tools_utilities_bomb_blast_item, index, ws_index) AppCommanUtility.click_select_layer_label_container(driver, tools_utilities_bomb_blast_item, index, ws_index) AppCommanUtility.click_right_panel_open(driver, tools_utilities_bomb_blast_item, index, boolean_value=False, ws_index=7) AppCommanUtility.click_graphics_tab(driver, tools_utilities_bomb_blast_item, index, ws_index) AppCommanValidation.validate_right_panel_layer_name(driver, tool_bomb_blast_widget_name, tools_utilities_bomb_blast_item, index, ws_index) AppCommanUtility.click_bottom_panel_layer(driver, tool_bomb_blast_widget_name, tools_utilities_bomb_blast_item, index, ws_index) AppCommanValidation.validate_feature_count_panel(driver, tools_utilities_bomb_blast_item, index, ws_index) AppCommanValidation.validate_feature_count(driver, tool_bomb_blast_widget_name, tools_utilities_bomb_blast_item, index, ws_index) TestLogBombBlast.open_py_excel_pass(index, ws_index)
def find_coordinates_tool_validation(driver, tools_navigation_find_coordinates_item, index, ws_index): """ Method to validate the tool find coordinates """ AppCommanUtility.click_down_panel(driver, tools_navigation_find_coordinates_item, index, ws_index) AppCommanUtility.click_select_layer_label_container(driver, tools_navigation_find_coordinates_item, index, ws_index) AppCommanUtility.click_right_panel_open(driver, False, tools_navigation_find_coordinates_item, index, ws_index) AppCommanUtility.click_graphics_tab(driver, tools_navigation_find_coordinates_item, index, ws_index) AppCommanValidation.validate_right_panel_layer_name(driver, tools_navigation_find_coordinates_item, tools_navigation_find_coordinates_item, index, ws_index) AppCommanUtility.click_bottom_panel_layer(driver, tools_navigation_find_coordinates_item, tools_navigation_find_coordinates_item, index, ws_index) AppCommanValidation.validate_feature_count_panel(driver, tools_navigation_find_coordinates_item, index, ws_index) AppCommanValidation.validate_feature_circle_count(driver, "findCoordinates", tools_navigation_find_coordinates_item, index, ws_index) TestResults.open_py_excel_pass(index, ws_index)
def click_okbtn_historic_select_by_unit_tab(driver, agency_feed_avl, index, ws_index): try: avl_ok_content = driver.find_elements_by_class_name("avlOkContent") avl_ok_content[1].click() time.sleep(2) except Exception: TestFailScreenShots.get_screenshots( driver, agency_feed_avl, "click_okbtn_historic_select_by_unit_tab") TestLog.log_creation(agency_feed_avl, "click_okbtn_historic_select_by_unit_tab", index, ws_index) try: avl_historic_layer = driver.find_element_by_id( "avlHistoricLayer_layer") if avl_historic_layer.is_displayed(): AppCommanUtility.click_minimize_btn(driver, agency_feed_avl, index, ws_index) AppCommanUtility.click_down_panel(driver, agency_feed_avl, index, ws_index) AppCommanUtility.click_select_layer_label_container( driver, agency_feed_avl, index, ws_index) AppCommanValidation.validate_layer_name(driver, "AVL Historic Layer", agency_feed_avl, index, ws_index, boolean_value=True) AppCommanValidation.validate_right_panel_layer_name( driver, "AVL Historic Layer", agency_feed_avl, index, ws_index) AppCommanValidation.validate_agency_feed_avl_historic_tab( driver, "avlHistoricLayer") AppCommanUtility.click_maximize_btn(driver, agency_feed_avl, index, ws_index) except Exception: AppCommanUtility.click_popup_close_icon(driver, agency_feed_avl)
def validate_avl_live_tab(driver, agency_feed_avl, avl_live_layer_name, index, ws_index): try: avl_live_layer = driver.find_element_by_id("avlLive_layer") if avl_live_layer.is_displayed(): AppCommanUtility.click_minimize_btn(driver, agency_feed_avl, index, ws_index) AppCommanUtility.click_down_panel(driver, agency_feed_avl, index, ws_index) AppCommanUtility.click_select_layer_label_container( driver, agency_feed_avl, index, ws_index) AppCommanValidation.validate_layer_name(driver, avl_live_layer_name, agency_feed_avl, index, ws_index, boolean_value=True) AppCommanUtility.click_live_tab(driver, agency_feed_avl, index, ws_index) AppCommanValidation.validate_right_panel_layer_name( driver, avl_live_layer_name, agency_feed_avl, index, ws_index) AppCommanValidation.validate_feature_count(driver, "avlLive", agency_feed_avl, index, ws_index) AppCommanUtility.click_maximize_btn(driver, agency_feed_avl, index, ws_index) TestResults.open_py_excel_pass(index, ws_index) else: AppCommanUtility.click_popup_close_icon(driver, agency_feed_avl) except Exception: AppCommanUtility.click_popup_close_icon(driver, agency_feed_avl)
def tool_selection_proximity_validation(driver, tools_utilities_selection_item, index, ws_index): """ Method to validate proximity tab """ AppCommanUtility.widget_close_icon(driver, tools_utilities_selection_item, index, ws_index) AppCommanUtility.click_select_layer_label_container( driver, tools_utilities_selection_item, index, ws_index) AppCommanValidation.validate_right_panel_layer_name( driver, tools_utilities_selection_item, tools_utilities_selection_item, index, ws_index) AppCommanUtility.click_bottom_panel_layer(driver, "Proximity Results", tools_utilities_selection_item, index, ws_index) AppCommanValidation.validate_feature_count_panel( driver, tools_utilities_selection_item, index, ws_index) AppCommanValidation.validate_feature_count(driver, "proximityResultLayer", tools_utilities_selection_item, index, ws_index) TestResults.open_py_excel_pass(index, ws_index)
def validate_agency_feed_lpr_live_tab(driver, agency_feed_lpr_textbox, agency_feed_lpr_item, index, ws_index): try: lpr_live_layer = driver.find_element_by_id("lprLive_layer") if lpr_live_layer.is_displayed(): AppCommanUtility.click_minimize_btn(driver, "LPR", index, ws_index) AppCommanUtility.click_down_panel(driver, agency_feed_lpr_item, index, ws_index) AppCommanUtility.click_select_layer_label_container( driver, agency_feed_lpr_item, index, ws_index) AppCommanValidation.validate_layer_name(driver, "LPN SUSPECT", agency_feed_lpr_item, index, ws_index, boolean_value=True) AppCommanUtility.click_live_tab(driver, agency_feed_lpr_item, index, ws_index) AppCommanValidation.validate_right_panel_layer_name( driver, "LPN SUSPECT", agency_feed_lpr_item, index, ws_index) AppCommanValidation.validate_feature_count(driver, "lpnlive", agency_feed_lpr_item, index, ws_index) AppCommanUtility.click_maximize_btn(driver, "LPR", index, ws_index) else: AppCommanUtility.click_popup_close_icon(driver, "LPR") except Exception: AppCommanUtility.click_popup_close_icon(driver, "LPR")
def tool_selection_buffer_validation(driver, tools_utilities_selection_item, index, ws_index): """ Method to validate buffer tab""" AppCommanUtility.click_down_panel(driver, tools_utilities_selection_item, index, ws_index) AppCommanUtility.click_select_layer_label_container( driver, tools_utilities_selection_item, index, ws_index) AppCommanUtility.click_right_panel_open(driver, True, tools_utilities_selection_item, index, ws_index) # AppCommanUtility.click_graphics_tab(driver) AppCommanValidation.validate_right_panel_layer_name( driver, tools_utilities_selection_item, tools_utilities_selection_item, index, ws_index) AppCommanUtility.click_bottom_panel_layer(driver, "Select Buffer Results", tools_utilities_selection_item, index, ws_index) AppCommanValidation.validate_feature_count_panel( driver, tools_utilities_selection_item, index, ws_index) AppCommanValidation.validate_feature_count(driver, "proximityResultLayer", tools_utilities_selection_item, index, ws_index)
def tool_search_attribute_validation( driver, search_attribute_select_layer_textbox_text, search_attribute_sub_layer_name, tools_advanced_search_search_attribute_item, index, ws_index): """ Method to perfrom validation of search attribute """ AppCommanUtility.click_down_panel( driver, tools_advanced_search_search_attribute_item, index, ws_index) AppCommanUtility.click_select_layer_label_container( driver, tools_advanced_search_search_attribute_item, index, ws_index) AppCommanUtility.click_right_panel_open( driver, tools_advanced_search_search_attribute_item, index, True, ws_index) AppCommanValidation.validate_right_panel_layer_name( driver, search_attribute_select_layer_textbox_text, tools_advanced_search_search_attribute_item, index, ws_index) click_bottom_panel_layer_name(driver, tools_advanced_search_search_attribute_item, index, ws_index) AppCommanValidation.validate_feature_count_panel( driver, tools_advanced_search_search_attribute_item, index, ws_index) AppCommanValidation.validate_feature_count( driver, search_attribute_select_layer_textbox_text, tools_advanced_search_search_attribute_item, index, ws_index)
def click_lpr_select_by_lpn_okbtn(driver, agency_feed_lpr, index, ws_index): lpr_Ok_Content = driver.find_elements_by_class_name("lprOkContent") lpr_Ok_Content[1].click() time.sleep(2) avl_historic_layer = driver.find_element_by_id("historicLayer_layer") if avl_historic_layer.is_displayed(): AppCommanUtility.click_minimize_btn(driver, "LPR", index, ws_index) AppCommanUtility.click_down_panel(driver, agency_feed_lpr, index, ws_index) AppCommanUtility.click_select_layer_label_container(driver, agency_feed_lpr, index, ws_index) AppCommanValidation.validate_layer_name(driver, "LPN Historic Layer", agency_feed_lpr, index, ws_index, boolean_value=True) AppCommanValidation.validate_right_panel_layer_name(driver, "LPN Historic Layer", agency_feed_lpr, index, ws_index) AppCommanValidation.validate_feature_count(driver, "historicLayer", agency_feed_lpr, index, ws_index) AppCommanUtility.click_maximize_btn(driver, "LPR", index, ws_index) else: AppCommanUtility.click_popup_close_icon(driver, "LPR")
def social_media_search_validation(driver, social_media_social_media_search, social_media_search_select_source_item, social_media_search_layer_name, social_media_sub_layer, index, ws_index): click_select_source_dropdown(driver, "Select Source", social_media_social_media_search, index, ws_index) AppCommanUtility.select_ddl_item(driver, social_media_search_select_source_item, social_media_social_media_search, index, ws_index) try: social_media_row_container = driver.find_elements_by_class_name( "socialMediaRowContainer") for item in social_media_row_container: if item.is_displayed(): item.click() break except Exception: AppCommanUtility.widget_close_icon(driver, social_media_social_media_search, index, ws_index) return True AppCommanUtility.click_minimize_btn(driver, social_media_social_media_search, index, ws_index) SocialMediaSearchValidation.validate_social_media_highlighted_buffer( driver) AppCommanUtility.widget_close_icon(driver, social_media_social_media_search, index, ws_index) SocialMediaSearchValidation.validate_social_media_buffer(driver) AppCommanUtility.click_down_panel(driver, social_media_social_media_search, index, ws_index) AppCommanUtility.click_select_layer_label_container( driver, social_media_social_media_search, index, ws_index) AppCommanValidation.validate_layer_name(driver, social_media_search_layer_name, social_media_social_media_search, index, ws_index, boolean_value=True) AppCommanValidation.validate_right_panel_layer_name( driver, social_media_search_layer_name, social_media_social_media_search, index, ws_index) AppCommanValidation.validate_feature_count_panel( driver, social_media_social_media_search, index, ws_index) AppCommanValidation.validate_feature_count( driver, social_media_sub_layer, social_media_social_media_search, index, ws_index) TestResults.open_py_excel_pass(index, ws_index)
def validate_agency_feed_current_call_for_services( driver, agency_feed_current_call_for_service_widget_name, live_cad_layer_name, index, ws_index): try: live_cad_layer = driver.find_element_by_id("LiveCAD_layer") if live_cad_layer.is_displayed(): AppCommanUtility.widget_close_icon( driver, agency_feed_current_call_for_service_widget_name, index, ws_index) AppCommanUtility.click_down_panel( driver, agency_feed_current_call_for_service_widget_name, index, ws_index) AppCommanUtility.click_select_layer_label_container( driver, agency_feed_current_call_for_service_widget_name, index, ws_index) AppCommanValidation.validate_layer_name( driver, live_cad_layer_name, agency_feed_current_call_for_service_widget_name, index, ws_index, boolean_value=True) AppCommanUtility.click_live_tab( driver, agency_feed_current_call_for_service_widget_name, index, ws_index) AppCommanValidation.validate_right_panel_layer_name( driver, live_cad_layer_name, agency_feed_current_call_for_service_widget_name, index, ws_index) AppCommanValidation.validate_feature_count_panel( driver, agency_feed_current_call_for_service_widget_name, index, ws_index) AppCommanValidation.validate_feature_count( driver, "LiveCAD", agency_feed_current_call_for_service_widget_name, index, ws_index) TestResults.open_py_excel_pass(index, ws_index) else: AppCommanUtility.click_popup_close_icon( driver, agency_feed_current_call_for_service_widget_name) AppCommanUtility.widget_close_icon( driver, agency_feed_current_call_for_service_widget_name, index, ws_index) TestResults.open_py_excel_pass(index, ws_index) except Exception: AppCommanUtility.click_popup_close_icon( driver, agency_feed_current_call_for_service_widget_name) AppCommanUtility.widget_close_icon( driver, agency_feed_current_call_for_service_widget_name, index, ws_index) TestResults.open_py_excel_pass(index, ws_index)