def test_c18521044(self): test_case_number = "18521044" web_driver = self.fetch_webdriver() try: web_element = SeleniumActions.find_by_xpath( web_driver, BannerModuleData.ADD_BANNER_CANCEL_BUTTON) SeleniumActions.click_element(web_driver, web_element) Tools.sleep(3) element_path = BannerModuleData.GALLERY_BANNER_TITLE web_element = SeleniumActions.find_by_xpath( web_driver, element_path) try: assert (SeleniumActions.element_is_visible( web_driver, web_element)) CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') except: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') except: print("C18521044 Not Tested") e = sys.exc_info()[0] print("<p>Error: %s</p>" % e)
def test_c18521045(self): test_case_number = "18521045" web_driver = self.fetch_webdriver() try: web_element = SeleniumActions.find_by_xpath( web_driver, "//*[contains(@id, 'edit_item-')]") SeleniumActions.click_element(web_driver, web_element) Tools.sleep(3) banner_title = SeleniumActions.fetch_web_element( web_driver, BannerModuleData.BANNER_TITLE) try: assert (SeleniumActions.element_is_visible( web_driver, banner_title)) CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') except: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') except: print("C18521045 Not Tested") e = sys.exc_info()[0] print("<p>Error: %s</p>" % e)
def test_c18521018(self): test_case_number = "18521018" web_driver = self.fetch_webdriver() try: click_add_banner = \ SeleniumActions.fetch_web_element(web_driver, BannerModuleData.BANNER_MODULE_CONTENT_ADD_BANNER_BUTTON) SeleniumActions.click_element(web_driver, click_add_banner) Tools.sleep(5) element_path = BannerModuleData.BANNER_MODULE_CONTENT_ADD_BANNER web_element = SeleniumActions.find_by_xpath( web_driver, element_path) add_banner_text = SeleniumActions.read_web_element_text( web_element) try: assert (add_banner_text == "ADD BANNER") CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') except: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') except: print("C18521018 Not Tested") e = sys.exc_info()[0] print("<p>Error: %s</p>" % e)
def test_c18521173(self): test_case_number = "18521173" web_driver = self.fetch_webdriver() try: click_cta_module = SeleniumActions.fetch_web_element(web_driver, MartindalePageData.MODULE) SeleniumActions.click_element(web_driver, click_cta_module) Tools.sleep(3) click_edit_button = \ SeleniumActions.fetch_web_element(web_driver, MartindalePageData.IFRAME_EDIT_BUTTON) SeleniumActions.click_element(web_driver, click_edit_button) Tools.sleep(5) web_driver.switch_to.default_content() element_path = CtaModuleData.CTA_MODULE_HEADER web_element = SeleniumActions.find_by_xpath(web_driver, element_path) cta_text = SeleniumActions.read_web_element_text(web_element) try: assert(cta_text == "CALL TO ACTION(CTA)") CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') except: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') except: Tools.log("C18521173 Not Tested") e = sys.exc_info()[0] Tools.log("<p>Error: %s</p>" % e)
def test_c18521041(self): test_case_number = "18521041" web_driver = self.fetch_webdriver() try: # CTA Button 1 element_path = BannerModuleData.BANNER_MODULE_CONTENT_ADD_LINK_TYPE web_element = SeleniumActions.find_by_xpath( web_driver, element_path) SeleniumActions.select_by_index(web_element, "1") Tools.sleep(2) element_path = BannerModuleData.BANNER_MODULE_CONTENT_ADD_LINK_PAGE_URL_LABEL web_element = SeleniumActions.find_by_xpath( web_driver, element_path) link_page_element = SeleniumActions.read_web_element_text( web_element) # CTA Button 2 element_path = BannerModuleData.BANNER_MODULE_CONTENT_ADD_LINK_TYPE_TWO web_element = SeleniumActions.find_by_xpath( web_driver, element_path) SeleniumActions.select_by_index(web_element, "1") Tools.sleep(2) element_path = BannerModuleData.BANNER_MODULE_CONTENT_ADD_LINK_PAGE_URL_LABEL_TWO web_element = SeleniumActions.find_by_xpath( web_driver, element_path) link_page_element_two = SeleniumActions.read_web_element_text( web_element) try: assert (link_page_element == "URL *" and link_page_element_two == "URL *") CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') except: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') except: print("C18521041 Not Tested") e = sys.exc_info()[0] print("<p>Error: %s</p>" % e)
def refresh_page(web_driver): """Refreshes the page :param WebDriver web_driver: :rtype: bool :return: boolean """ try: web_driver.navigate().refresh() Tools.sleep(1) return True except Exception as error: return False
def test_select(): web_driver = SeleniumDriver.fetch_chrome_webdriver() url = "http://the-internet.herokuapp.com/dropdown" web_driver.get(url) element_path = "//select[@id='dropdown']" web_element = SeleniumActions.find_by_xpath(web_driver, element_path) Tools.sleep(2) select_1 = Select(web_element) print(len(select_1.options)) select_1.select_by_visible_text('Option 1') Tools.sleep(3) print("**") select_2 = Select(web_element) select_2.select_by_index(2) Tools.sleep(3) print("--") select_3 = Select(web_element) select_3.select_by_value("1") text = select_3.first_selected_option.text print(text) Tools.sleep(5) web_driver.close()
def test_c18521046(self): test_case_number = "18521046" web_driver = self.fetch_webdriver() try: web_element = SeleniumActions.find_by_xpath( web_driver, "//*[contains(@id, 'delete_item-')]") SeleniumActions.click_element(web_driver, web_element) Tools.sleep(2) web_element = SeleniumActions.find_by_xpath( web_driver, BannerModuleData.DELETE_BANNER_CONFIRMATION) SeleniumActions.element_is_visible(web_driver, web_element) web_element = SeleniumActions.find_by_xpath( web_driver, BannerModuleData.DELETE_BANNER_CANCEL_BUTTON) SeleniumActions.click_element(web_driver, web_element) Tools.sleep(2) web_element = SeleniumActions.find_by_xpath( web_driver, "//*[contains(@id, 'item_item-')]") SeleniumActions.element_is_visible(web_driver, web_element) web_element = SeleniumActions.find_by_xpath( web_driver, "//*[contains(@id, 'delete_item-')]") SeleniumActions.click_element(web_driver, web_element) Tools.sleep(2) web_element = SeleniumActions.find_by_xpath( web_driver, BannerModuleData.DELETE_BANNER_OK_BUTTON) SeleniumActions.click_element(web_driver, web_element) Tools.sleep(4) web_element = SeleniumActions.find_by_xpath( web_driver, "//*[contains(@id, 'item_item-')]") new_banner_test = SeleniumActions.read_web_element_text( web_element) try: assert (new_banner_test == "Title: Title\nCaption") CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') except: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') self.case_teardown() except: print("C18521230 Not Tested") e = sys.exc_info()[0] print("<p>Error: %s</p>" % e)
def test_c18527976(self): test_case_number = "18527976" web_driver = self.fetch_webdriver() try: click_blade_module = SeleniumActions.fetch_web_element( web_driver, MartindalePageData.MODULE) SeleniumActions.click_element(web_driver, click_blade_module) Tools.sleep(2) click_edit_button = \ SeleniumActions.fetch_web_element(web_driver, MartindalePageData.IFRAME_EDIT_BUTTON) SeleniumActions.click_element(web_driver, click_edit_button) Tools.sleep(5) web_driver.switch_to.default_content() web_element = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_CONTENT_TITLE) click_module_info = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_CONTENT_MODULE_INFORMATION) SeleniumActions.click_element(web_driver, click_module_info) SeleniumActions.element_is_not_visible(web_element) click_module_info = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_CONTENT_MODULE_INFORMATION) SeleniumActions.click_element(web_driver, click_module_info) try: assert (SeleniumActions.element_is_visible( web_driver, web_element)) CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') except: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') except: print("C18527976 Not Tested") e = sys.exc_info()[0] print("<p>Error: %s</p>" % e)
def module_open(web_driver): web_driver.switch_to.frame( web_driver.find_element_by_xpath( MartindalePageData.MARTINDALE_IFRAME)) add_module = SeleniumActions.fetch_web_element( web_driver, MartindalePageData.ADD_MODULE_BUTTON) SeleniumActions.click_element(web_driver, add_module) # Select module button if CommonSetup.selected_module == "banner": select_banner_module = \ SeleniumActions.fetch_web_element(web_driver, MartindalePageData.BANNER_MODULE_BUTTON) SeleniumActions.click_element(web_driver, select_banner_module) elif CommonSetup.selected_module == "blade": select_blade_module = \ SeleniumActions.fetch_web_element(web_driver, MartindalePageData.BLADE_MODULE_BUTTON) SeleniumActions.click_element(web_driver, select_blade_module) elif CommonSetup.selected_module == "cta": select_cta_module = \ SeleniumActions.fetch_web_element(web_driver, MartindalePageData.CTA_MODULE_BUTTON) SeleniumActions.click_element(web_driver, select_cta_module) elif CommonSetup.selected_module == "featured": select_featured_block_module = \ SeleniumActions.fetch_web_element(web_driver, MartindalePageData.FEATURED_BLOCKS_MODULE_BUTTON) SeleniumActions.click_element(web_driver, select_featured_block_module) else: print("Error: Module not found.") click_module_radio = \ SeleniumActions.fetch_web_element(web_driver, MartindalePageData.SAVED_MODULE_RADIO_BUTTON) SeleniumActions.click_element(web_driver, click_module_radio) element_path = MartindalePageData.MODULE_NAME_DROP_DOWN web_element = SeleniumActions.find_by_xpath(web_driver, element_path) Tools.sleep(2) SeleniumActions.select_by_text(web_element, "automation_only") click_submit_button = \ SeleniumActions.fetch_web_element(web_driver, MartindalePageData.MODULE_SUBMIT_BUTTON) SeleniumActions.click_element(web_driver, click_submit_button) Tools.sleep(5)
def test_c18527977(self): test_case_number = "18527977" web_driver = self.fetch_webdriver() try: web_element = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_CONTENT_SELECT_FROM_GALLERY) click_module_info = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_CONTENT_MANAGE_CONTENT) SeleniumActions.click_element(web_driver, click_module_info) Tools.sleep(2) try: SeleniumActions.element_is_not_visible(web_element) test_one = "Passed" except: test_one = "Failed" click_module_info = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_CONTENT_MANAGE_CONTENT) SeleniumActions.click_element(web_driver, click_module_info) Tools.sleep(2) try: SeleniumActions.element_is_not_visible(web_element) test_two = "Passed" except: test_two = "Failed" if test_one == "Passed" and test_two == "Passed": CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') else: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') except: print("C18527977 Not Tested") e = sys.exc_info()[0] print("<p>Error: %s</p>" % e)
def test_c18521230(self): test_case_number = "18521230" web_driver = self.fetch_webdriver() try: click_blade_module = SeleniumActions.fetch_web_element(web_driver, MartindalePageData.MODULE) SeleniumActions.click_element(web_driver, click_blade_module) Tools.sleep(2) click_edit_button = \ SeleniumActions.fetch_web_element(web_driver, MartindalePageData.IFRAME_EDIT_BUTTON) SeleniumActions.click_element(web_driver, click_edit_button) Tools.sleep(5) web_driver.switch_to.default_content() click_settings_tab = SeleniumActions.fetch_web_element(web_driver, CtaModuleData.CTA_SETTINGS_TAB) SeleniumActions.click_element(web_driver, click_settings_tab) click_cta_settings_button_two = \ SeleniumActions.fetch_web_element(web_driver, CtaModuleData.CTA_SETTINGS_SHOW_BUTTON_TWO) SeleniumActions.click_element(web_driver, click_cta_settings_button_two) click_content_tab = SeleniumActions.fetch_web_element(web_driver, CtaModuleData.CTA_CONTENT_TAB) SeleniumActions.click_element(web_driver, click_content_tab) element_path = CtaModuleData.CTA_MODULE_TWO_LINK_APPEARANCE web_element = SeleniumActions.find_by_xpath(web_driver, element_path) try: assert(SeleniumActions.element_is_visible(web_driver, web_element)) CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') except AssertionError: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') except: print("C18521230 Not Tested") e = sys.exc_info()[0] print("<p>Error: %s</p>" % e)
def test_c18521043(self): test_case_number = "18521043" web_driver = self.fetch_webdriver() try: banner_title = SeleniumActions.fetch_web_element( web_driver, BannerModuleData.BANNER_TITLE) SeleniumActions.clearTextField(web_driver, banner_title) SeleniumActions.write_to_element(web_driver, banner_title, "Automated") banner_caption = SeleniumActions.fetch_web_element( web_driver, BannerModuleData.BANNER_CAPTION) SeleniumActions.clearTextField(web_driver, banner_caption) SeleniumActions.write_to_element(web_driver, banner_caption, "Test") click_save_button = \ SeleniumActions.fetch_web_element(web_driver, BannerModuleData.ADD_BANNER_SAVE_BUTTON) SeleniumActions.click_element(web_driver, click_save_button) Tools.sleep(4) web_element = SeleniumActions.find_by_xpath( web_driver, "//*[contains(@id, 'item_item-')]") new_banner_test = SeleniumActions.read_web_element_text( web_element) try: assert (new_banner_test == "Title: Automated\nTest") CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') except: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') except: print("C18521043 Not Tested") e = sys.exc_info()[0] print("<p>Error: %s</p>" % e)
def test_c18678386(self): test_case_number = "18678386" web_driver = self.fetch_webdriver() try: web_element = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_SETTINGS_SWAP_MEDIA_TEXT) click_blade_settings = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_SETTINGS_SETTINGS) SeleniumActions.click_element(web_driver, click_blade_settings) Tools.sleep(1) SeleniumActions.element_is_not_visible(web_element) click_blade_settings = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_SETTINGS_SETTINGS) SeleniumActions.click_element(web_driver, click_blade_settings) Tools.sleep(1) web_element = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_SETTINGS_SWAP_MEDIA_TEXT) try: assert (SeleniumActions.element_is_visible( web_driver, web_element)) CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') except: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') except: print("C18678386 Not Tested") e = sys.exc_info()[0] print("<p>Error: %s</p>" % e)
def test_c18678387(self): test_case_number = "18678387" web_driver = self.fetch_webdriver() try: web_element = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_SETTINGS_DESKTOP_MODULE) click_module_visibility = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_SETTINGS_MODULE_VISIBILITY) SeleniumActions.click_element(web_driver, click_module_visibility) Tools.sleep(1) SeleniumActions.element_is_not_visible(web_element) click_module_visibility = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_SETTINGS_MODULE_VISIBILITY) SeleniumActions.click_element(web_driver, click_module_visibility) Tools.sleep(1) web_element = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_SETTINGS_DESKTOP_MODULE) try: assert (SeleniumActions.element_is_visible( web_driver, web_element)) CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') except: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') except: print("C18678387 Not Tested") e = sys.exc_info()[0] print("<p>Error: %s</p>" % e)
def test_c18678391(self): test_case_number = "18678391" web_driver = self.fetch_webdriver() try: click_blade_module = SeleniumActions.fetch_web_element( web_driver, MartindalePageData.MODULE) SeleniumActions.click_element(web_driver, click_blade_module) Tools.sleep(2) click_edit_button = \ SeleniumActions.fetch_web_element(web_driver, MartindalePageData.IFRAME_EDIT_BUTTON) SeleniumActions.click_element(web_driver, click_edit_button) Tools.sleep(5) web_driver.switch_to.default_content() click_settings_tab = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_SETTINGS_TAB) SeleniumActions.click_element(web_driver, click_settings_tab) click_show_read_more = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_SETTINGS_SHOW_READ_MORE) SeleniumActions.click_element(web_driver, click_show_read_more) click_show_cta_button_one = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_SETTINGS_SHOW_CTA_ONE) SeleniumActions.click_element(web_driver, click_show_cta_button_one) click_done_button = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_DONE_BUTTON) SeleniumActions.click_element(web_driver, click_done_button) Tools.sleep(5) web_driver.switch_to.frame( web_driver.find_element_by_xpath( MartindalePageData.MARTINDALE_IFRAME)) element_path = BladeModuleData.BLADE_IFRAME_CTA_BUTTON_TWO web_element = SeleniumActions.find_by_xpath( web_driver, element_path) read_cta_button = SeleniumActions.read_web_element_text( web_element) try: assert (read_cta_button == "CTA TWO") CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') except: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') except: print("C18678391 Not Tested") e = sys.exc_info()[0] print("<p>Error: %s</p>" % e)
def test_c18527973(self): test_case_number = "18527973" web_driver = self.fetch_webdriver() try: click_blade_module = SeleniumActions.fetch_web_element( web_driver, MartindalePageData.MODULE) SeleniumActions.click_element(web_driver, click_blade_module) Tools.sleep(2) click_edit_button = \ SeleniumActions.fetch_web_element(web_driver, MartindalePageData.IFRAME_EDIT_BUTTON) SeleniumActions.click_element(web_driver, click_edit_button) Tools.sleep(5) web_driver.switch_to.default_content() element_path = BladeModuleData.BLADE_TITLE web_element = SeleniumActions.find_by_xpath( web_driver, element_path) blade_text = SeleniumActions.read_web_element_text(web_element) try: assert (blade_text == "BLADE MODULE") CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') except: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') except: print("C18527973 Not Tested") e = sys.exc_info()[0] print("<p>Error: %s</p>" % e)
def login_to_app(web_driver): try: # Login login_username = SeleniumActions.fetch_web_element(web_driver, MartindalePageData.MARTINDALE_LOGIN_USERNAME) SeleniumActions.write_to_element(web_driver, login_username, MartindalePageData.MARTINDALE_LOGIN_EMAIL) login_password = SeleniumActions.fetch_web_element(web_driver, MartindalePageData.MARTINDALE_LOGIN_PASSWORD) SeleniumActions.write_to_element(web_driver, login_password, MartindalePageData.MARTINDALE_LOGIN_PASS) button_login = SeleniumActions.fetch_web_element(web_driver, MartindalePageData.MARTINDALE_LOGIN_BUTTON) SeleniumActions.click_element(web_driver, button_login) Tools.sleep(2) click_pages_tab = SeleniumActions.fetch_web_element(web_driver, MartindalePageData.PAGES_TAB_BUTTON) SeleniumActions.click_element(web_driver, click_pages_tab) Tools.sleep(2) if MartindalePageData.MARTINDALE_URL == "http://my.stg-martindalenolo.com/0004973/site/editor/cms": click_automation_edit = \ SeleniumActions.fetch_web_element(web_driver, MartindalePageData.AUTOMATION_PAGE_EDIT_BUTTON) SeleniumActions.click_element(web_driver, click_automation_edit) else: click_automation_edit = \ SeleniumActions.fetch_web_element(web_driver, MartindalePageData.AUTOMATION_PAGE_EDIT_BUTTON_TWO) SeleniumActions.click_element(web_driver, click_automation_edit) Tools.sleep(4) web_driver.close() web_driver.switch_to_window(web_driver.window_handles[0]) except: e = sys.exc_info()[0] print("<p>Error: %s</p>" % e)
def test_c18527975(self): test_case_number = "18527975" web_driver = self.fetch_webdriver() try: click_content_tab = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_CONTENT_TAB) SeleniumActions.click_element(web_driver, click_content_tab) Tools.sleep(2) write_new_title = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_CONTENT_TITLE) SeleniumActions.clearTextField(web_driver, write_new_title) SeleniumActions.write_to_element \ (web_driver, write_new_title, "Blade") write_new_caption = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_CONTENT_CAPTION) SeleniumActions.clearTextField(web_driver, write_new_caption) SeleniumActions.write_to_element \ (web_driver, write_new_caption, "Runner") write_new_alt_text = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_CONTENT_ALT_TEXT) SeleniumActions.clearTextField(web_driver, write_new_alt_text) SeleniumActions.write_to_element \ (web_driver, write_new_alt_text, "alt") write_new_image_title = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_CONTENT_IMAGE_TITLE) SeleniumActions.clearTextField(web_driver, write_new_image_title) SeleniumActions.write_to_element \ (web_driver, write_new_image_title, "image") write_new_cta_one_link_text = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_CONTENT_CTA_ONE_LINK_TEXT) SeleniumActions.clearTextField(web_driver, write_new_cta_one_link_text) SeleniumActions.write_to_element \ (web_driver, write_new_cta_one_link_text, "CTA One") write_new_cta_two_link_text = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_CONTENT_CTA_TWO_LINK_TEXT) SeleniumActions.clearTextField(web_driver, write_new_cta_two_link_text) SeleniumActions.write_to_element \ (web_driver, write_new_cta_two_link_text, "CTA Two") click_done_button = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_DONE_BUTTON) SeleniumActions.click_element(web_driver, click_done_button) Tools.sleep(5) web_driver.switch_to.frame( web_driver.find_element_by_xpath( MartindalePageData.MARTINDALE_IFRAME)) element_path = BladeModuleData.BLADE_IFRAME_TITLE web_element = SeleniumActions.find_by_xpath( web_driver, element_path) blade_iframe_title = SeleniumActions.read_web_element_text( web_element) element_path = BladeModuleData.BLADE_IFRAME_CAPTION web_element = SeleniumActions.find_by_xpath( web_driver, element_path) blade_iframe_caption = SeleniumActions.read_web_element_text( web_element) try: assert (blade_iframe_title == "Blade" and blade_iframe_caption == "Runner") CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') except: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') except: print("C18527975 Not Tested") e = sys.exc_info()[0] print("<p>Error: %s</p>" % e)
def test_c18521180(self): test_case_number = "18521180" web_driver = self.fetch_webdriver() try: # CTA Button One element_path = CtaModuleData.CTA_MODULE_ONE_LINK_APPEARANCE web_element = SeleniumActions.find_by_xpath(web_driver, element_path) SeleniumActions.select_by_index(web_element, "1") Tools.sleep(1) element_path = CtaModuleData.CTA_MODULE_BUTTON_TEXT_BOX_ONE button_text_box_one = SeleniumActions.find_by_xpath(web_driver, element_path) try: assert(SeleniumActions.element_is_visible(web_driver, button_text_box_one)) test_one = "Passed" except AssertionError: test_one = "Failed" print("<p>Error: %s</p>") element_path = CtaModuleData.CTA_MODULE_ONE_LINK_APPEARANCE web_element = SeleniumActions.find_by_xpath(web_driver, element_path) SeleniumActions.select_by_index(web_element, "2") Tools.sleep(1) element_path = CtaModuleData.CTA_MODULE_SELECT_ICON_ONE select_icon_one = SeleniumActions.find_by_xpath(web_driver, element_path) try: assert(SeleniumActions.element_is_visible(web_driver, select_icon_one)) test_two = "Passed" except AssertionError: test_two = "Failed" print("<p>Error: %s</p>") element_path = CtaModuleData.CTA_MODULE_ONE_LINK_APPEARANCE web_element = SeleniumActions.find_by_xpath(web_driver, element_path) SeleniumActions.select_by_index(web_element, "3") Tools.sleep(1) element_path = CtaModuleData.CTA_MODULE_BUTTON_TEXT_BOX_ONE link_text_one = SeleniumActions.find_by_xpath(web_driver, element_path) element_path = CtaModuleData.CTA_MODULE_SELECT_ICON_ONE select_icon_one = SeleniumActions.find_by_xpath(web_driver, element_path) try: assert(SeleniumActions.element_is_visible(web_driver, link_text_one) and SeleniumActions.element_is_visible(web_driver, select_icon_one)) test_three = "Passed" except AssertionError: test_three = "Failed" print("<p>Error: %s</p>") element_path = CtaModuleData.CTA_MODULE_ONE_LINK_APPEARANCE web_element = SeleniumActions.find_by_xpath(web_driver, element_path) SeleniumActions.select_by_index(web_element, "0") Tools.sleep(1) element_path = CtaModuleData.CTA_MODULE_BUTTON_TEXT_BOX_ONE link_text_one = SeleniumActions.find_by_xpath(web_driver, element_path) try: assert(SeleniumActions.element_is_visible(web_driver, link_text_one)) test_four = "Passed" except AssertionError: test_four = "Failed" print("<p>Error: %s</p>") # CTA Button Two element_path = CtaModuleData.CTA_MODULE_TWO_LINK_APPEARANCE web_element = SeleniumActions.find_by_xpath(web_driver, element_path) SeleniumActions.select_by_index(web_element, "1") Tools.sleep(1) element_path = CtaModuleData.CTA_MODULE_BUTTON_TEXT_BOX_TWO button_text_box_two = SeleniumActions.find_by_xpath(web_driver, element_path) try: assert(SeleniumActions.element_is_visible(web_driver, button_text_box_two)) test_five = "Passed" except AssertionError: test_five = "Failed" print("<p>Error: %s</p>") element_path = CtaModuleData.CTA_MODULE_TWO_LINK_APPEARANCE web_element = SeleniumActions.find_by_xpath(web_driver, element_path) SeleniumActions.select_by_index(web_element, "2") Tools.sleep(1) element_path = CtaModuleData.CTA_MODULE_SELECT_ICON_TWO select_icon_two = SeleniumActions.find_by_xpath(web_driver, element_path) try: assert(SeleniumActions.element_is_visible(web_driver, select_icon_two)) test_six = "Passed" except AssertionError: test_six = "Failed" print("<p>Error: %s</p>") element_path = CtaModuleData.CTA_MODULE_TWO_LINK_APPEARANCE web_element = SeleniumActions.find_by_xpath(web_driver, element_path) SeleniumActions.select_by_index(web_element, "3") Tools.sleep(2) element_path = CtaModuleData.CTA_MODULE_BUTTON_TEXT_BOX_TWO button_text_box_two = SeleniumActions.find_by_xpath(web_driver, element_path) element_path = CtaModuleData.CTA_MODULE_SELECT_ICON_TWO select_icon_two = SeleniumActions.find_by_xpath(web_driver, element_path) try: assert(SeleniumActions.element_is_visible(web_driver, button_text_box_two) and SeleniumActions.element_is_visible(web_driver, select_icon_two)) test_seven = "Passed" except AssertionError: test_seven = "Failed" print("<p>Error: %s</p>") element_path = CtaModuleData.CTA_MODULE_TWO_LINK_APPEARANCE web_element = SeleniumActions.find_by_xpath(web_driver, element_path) SeleniumActions.select_by_index(web_element, "0") Tools.sleep(1) element_path = CtaModuleData.CTA_MODULE_LINK_TEXT_BOX_TWO link_text_two = SeleniumActions.find_by_xpath(web_driver, element_path) try: assert(SeleniumActions.element_is_visible(web_driver, link_text_two)) test_eight = "Passed" except AssertionError: test_eight = "Failed" print("<p>Error: %s</p>") if test_one == "Passed" and test_two == "Passed" and test_three == "Passed" and test_four == "Passed" and \ test_five == "Passed" and test_six == "Passed" and test_seven == "Passed" and test_eight == "Passed": CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') else: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') except: print("C18521180 Not Tested") e = sys.exc_info()[0] print("<p>Error: %s</p>" % e)
def test_c18521178(self): test_case_number = "18521178" web_driver = self.fetch_webdriver() try: click_blade_module = SeleniumActions.fetch_web_element(web_driver, MartindalePageData.MODULE) SeleniumActions.click_element(web_driver, click_blade_module) Tools.sleep(2) click_edit_button = \ SeleniumActions.fetch_web_element(web_driver, MartindalePageData.IFRAME_EDIT_BUTTON) SeleniumActions.click_element(web_driver, click_edit_button) Tools.sleep(5) web_driver.switch_to.default_content() # CTA Button One element_path = CtaModuleData.CTA_MODULE_BUTTON_ONE_LINK_TYPE web_element = SeleniumActions.find_by_xpath(web_driver, element_path) SeleniumActions.select_by_index(web_element, "0") Tools.sleep(1) element_path = CtaModuleData.CTA_MODULE_LINK_PAGE_ONE_DROP_DOWN link_page_one_drop_down = SeleniumActions.find_by_xpath(web_driver, element_path) try: assert(SeleniumActions.element_is_visible(web_driver, link_page_one_drop_down)) test_one = "Passed" except AssertionError: test_one = "Failed" print("<p>Error: %s</p>") element_path = CtaModuleData.CTA_MODULE_BUTTON_ONE_LINK_TYPE web_element = SeleniumActions.find_by_xpath(web_driver, element_path) SeleniumActions.select_by_index(web_element, "1") Tools.sleep(1) element_path = CtaModuleData.CTA_MODULE_EXTERNAL_URL_ONE url_one = SeleniumActions.find_by_xpath(web_driver, element_path) try: assert(SeleniumActions.element_is_visible(web_driver, url_one)) test_two = "Passed" except AssertionError: test_two = "Failed" print("<p>Error: %s</p>") element_path = CtaModuleData.CTA_MODULE_BUTTON_ONE_LINK_TYPE web_element = SeleniumActions.find_by_xpath(web_driver, element_path) SeleniumActions.select_by_index(web_element, "2") Tools.sleep(1) element_path = CtaModuleData.CTA_MODULE_PHONE_NUMBER_ONE phone_number = SeleniumActions.find_by_xpath(web_driver, element_path) try: assert(SeleniumActions.element_is_visible(web_driver, phone_number)) test_three = "Passed" except AssertionError: test_three = "Failed" print("<p>Error: %s</p>") element_path = CtaModuleData.CTA_MODULE_BUTTON_ONE_LINK_TYPE web_element = SeleniumActions.find_by_xpath(web_driver, element_path) SeleniumActions.select_by_index(web_element, "3") Tools.sleep(1) try: assert(SeleniumActions.element_is_not_visible(link_page_one_drop_down) and SeleniumActions.element_is_not_visible(url_one) and SeleniumActions.element_is_not_visible(phone_number)) test_four = "Passed" except AssertionError: test_four = "Failed" print("<p>Error: %s</p>") # CTA Button Two element_path = CtaModuleData.CTA_MODULE_TWO_BUTTON_LINK_TYPE web_element = SeleniumActions.find_by_xpath(web_driver, element_path) SeleniumActions.select_by_index(web_element, "0") Tools.sleep(1) element_path = CtaModuleData.CTA_MODULE_LINK_PAGE_TWO_DROP_DOWN link_page_two_drop_down = SeleniumActions.find_by_xpath(web_driver, element_path) try: assert(SeleniumActions.element_is_visible(web_driver, link_page_two_drop_down)) test_five = "Passed" except AssertionError: test_five = "Failed" print("<p>Error: %s</p>") element_path = CtaModuleData.CTA_MODULE_TWO_BUTTON_LINK_TYPE web_element = SeleniumActions.find_by_xpath(web_driver, element_path) SeleniumActions.select_by_index(web_element, "1") Tools.sleep(1) element_path = CtaModuleData.CTA_MODULE_EXTERNAL_URL_TWO url_two = SeleniumActions.find_by_xpath(web_driver, element_path) try: assert(SeleniumActions.element_is_visible(web_driver, url_two)) test_six = "Passed" except AssertionError: test_six = "Failed" print("<p>Error: %s</p>") element_path = CtaModuleData.CTA_MODULE_TWO_BUTTON_LINK_TYPE web_element = SeleniumActions.find_by_xpath(web_driver, element_path) SeleniumActions.select_by_index(web_element, "2") Tools.sleep(1) element_path = CtaModuleData.CTA_MODULE_PHONE_NUMBER_TWO phone_number_two = SeleniumActions.find_by_xpath(web_driver, element_path) try: assert(SeleniumActions.element_is_visible(web_driver, phone_number_two)) test_seven = "Passed" except AssertionError: test_seven = "Failed" print("<p>Error: %s</p>") element_path = CtaModuleData.CTA_MODULE_TWO_BUTTON_LINK_TYPE web_element = SeleniumActions.find_by_xpath(web_driver, element_path) SeleniumActions.select_by_index(web_element, "3") Tools.sleep(1) try: assert(SeleniumActions.element_is_not_visible(link_page_two_drop_down) and SeleniumActions.element_is_not_visible(url_two) and SeleniumActions.element_is_not_visible(phone_number_two)) test_eight = "Passed" except AssertionError: test_eight = "Failed" print("<p>Error: %s</p>") if test_one == "Passed" and test_two == "Passed" and test_three == "Passed" and test_four == "Passed" and \ test_five == "Passed" and test_six == "Passed" and test_seven == "Passed" and test_eight == "Passed": CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') else: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') except: print("C18521178 Not Tested") e = sys.exc_info()[0] print("<p>Error: %s</p>" % e)
def test_c18521182(self): test_case_number = "18521182" web_driver = self.fetch_webdriver() try: # Link One click_cta_settings_button_one = \ SeleniumActions.fetch_web_element(web_driver, CtaModuleData.CTA_SETTINGS_SHOW_BUTTON_ONE) SeleniumActions.click_element(web_driver, click_cta_settings_button_one) click_done_button = \ SeleniumActions.fetch_web_element(web_driver, CtaModuleData.CTA_MODULE_DONE_BUTTON) SeleniumActions.click_element(web_driver, click_done_button) web_driver.switch_to.frame(web_driver.find_element_by_xpath(MartindalePageData.MARTINDALE_IFRAME)) Tools.sleep(5) element_path = CtaModuleData.CTA_MODULE_LINK_DISPLAY link_display_one = SeleniumActions.find_by_xpath(web_driver, element_path) try: assert(SeleniumActions.element_is_visible(web_driver, link_display_one)) test_one = "Passed" except AssertionError: test_one = "Failed" print("<p>Error: %s</p>") # Link Two click_blade_module = SeleniumActions.fetch_web_element(web_driver, MartindalePageData.MODULE) SeleniumActions.click_element(web_driver, click_blade_module) Tools.sleep(2) click_edit_button = \ SeleniumActions.fetch_web_element(web_driver, MartindalePageData.IFRAME_EDIT_BUTTON) SeleniumActions.click_element(web_driver, click_edit_button) Tools.sleep(5) web_driver.switch_to.default_content() click_settings_tab = SeleniumActions.fetch_web_element(web_driver, CtaModuleData.CTA_SETTINGS_TAB) SeleniumActions.click_element(web_driver, click_settings_tab) click_cta_settings_button_one = \ SeleniumActions.fetch_web_element(web_driver, CtaModuleData.CTA_SETTINGS_SHOW_BUTTON_ONE) SeleniumActions.click_element(web_driver, click_cta_settings_button_one) click_cta_settings_button_two = \ SeleniumActions.fetch_web_element(web_driver, CtaModuleData.CTA_SETTINGS_SHOW_BUTTON_TWO) SeleniumActions.click_element(web_driver, click_cta_settings_button_two) click_done_button = \ SeleniumActions.fetch_web_element(web_driver, CtaModuleData.CTA_MODULE_DONE_BUTTON) SeleniumActions.click_element(web_driver, click_done_button) web_driver.switch_to.frame(web_driver.find_element_by_xpath(MartindalePageData.MARTINDALE_IFRAME)) Tools.sleep(5) element_path = CtaModuleData.CTA_MODULE_LINK_DISPLAY link_display_one = SeleniumActions.find_by_xpath(web_driver, element_path) try: assert(SeleniumActions.element_is_visible(web_driver, link_display_one)) test_two = "Passed" except AssertionError: test_two = "Failed" print("<p>Error: %s</p>") if test_one == "Passed" and test_two == "Passed": CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') else: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') except: print("C18521182 Not Tested") e = sys.exc_info()[0] print("<p>Error: %s</p>" % e)
def test_c18678393(self): test_case_number = "18678393" web_driver = self.fetch_webdriver() try: click_swap_setting = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_SETTINGS_SWAP_MEDIA_TEXT) SeleniumActions.click_element(web_driver, click_swap_setting) click_done_button = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_DONE_BUTTON) SeleniumActions.click_element(web_driver, click_done_button) Tools.sleep(5) web_driver.switch_to.frame( web_driver.find_element_by_xpath( MartindalePageData.MARTINDALE_IFRAME)) web_element = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_IFRAME_IMAGE_LEFT) SeleniumActions.element_is_visible(web_driver, web_element) click_blade_module = SeleniumActions.fetch_web_element( web_driver, MartindalePageData.MODULE) SeleniumActions.click_element(web_driver, click_blade_module) Tools.sleep(2) click_edit_button = \ SeleniumActions.fetch_web_element(web_driver, MartindalePageData.IFRAME_EDIT_BUTTON) SeleniumActions.click_element(web_driver, click_edit_button) Tools.sleep(5) web_driver.switch_to.default_content() click_settings_tab = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_SETTINGS_TAB) SeleniumActions.click_element(web_driver, click_settings_tab) click_swap_setting = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_SETTINGS_SWAP_MEDIA_TEXT) SeleniumActions.click_element(web_driver, click_swap_setting) click_done_button = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_DONE_BUTTON) SeleniumActions.click_element(web_driver, click_done_button) Tools.sleep(5) web_driver.switch_to.frame( web_driver.find_element_by_xpath( MartindalePageData.MARTINDALE_IFRAME)) web_element = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_IFRAME_IMAGE_RIGHT) try: assert (SeleniumActions.element_is_visible( web_driver, web_element)) CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') except: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') except: print("C18678393 Not Tested") e = sys.exc_info()[0] print("<p>Error: %s</p>" % e)
def test_c18527993(self): test_case_number = "18527993" web_driver = self.fetch_webdriver() try: # CTA Button One element_path = BladeModuleData.BLADE_CONTENT_CTA_ONE_LINK_TYPE web_element = SeleniumActions.find_by_xpath( web_driver, element_path) SeleniumActions.select_by_index(web_element, "1") Tools.sleep(2) url_text_clear = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_CONTENT_CTA_ONE_URL) SeleniumActions.write_to_element(web_driver, url_text_clear, "blackvinyl45") click_done_button = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_DONE_BUTTON) SeleniumActions.click_element(web_driver, click_done_button) url_error_msg = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_CONTENT_CTA_ONE_URL_ERROR) url_one_error_text = SeleniumActions.read_web_element_text( url_error_msg) if url_one_error_text == "Please enter a valid URL.": test_one = "Passed" else: test_one = "Failed" url_text_clear = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_CONTENT_CTA_ONE_URL) SeleniumActions.clearTextField(web_driver, url_text_clear) SeleniumActions.write_to_element(web_driver, url_text_clear, "blackvinyl45.com") click_done_button = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_DONE_BUTTON) SeleniumActions.click_element(web_driver, click_done_button) url_error_msg = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_CONTENT_CTA_ONE_URL_ERROR) url_one_error_text = SeleniumActions.read_web_element_text( url_error_msg) if url_one_error_text == "Please enter a valid URL.": test_two = "Passed" else: test_two = "Failed" url_text_clear = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_CONTENT_CTA_ONE_URL) SeleniumActions.clearTextField(web_driver, url_text_clear) SeleniumActions.write_to_element(web_driver, url_text_clear, "http://www.blackvinyl45.com") url_error_msg = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_CONTENT_CTA_ONE_URL_ERROR) if SeleniumActions.element_is_visible(web_driver, url_error_msg): test_three = "Failed" else: test_three = "Passed" # CTA Button Two element_path = BladeModuleData.BLADE_CONTENT_CTA_TWO_LINK_TYPE web_element = SeleniumActions.find_by_xpath( web_driver, element_path) SeleniumActions.select_by_index(web_element, "1") Tools.sleep(2) url_text_clear = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_CONTENT_CTA_TWO_URL) SeleniumActions.write_to_element(web_driver, url_text_clear, "blackvinyl45") click_done_button = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_DONE_BUTTON) SeleniumActions.click_element(web_driver, click_done_button) url_error_msg = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_CONTENT_CTA_TWO_URL_ERROR) url_one_error_text = SeleniumActions.read_web_element_text( url_error_msg) if url_one_error_text == "Please enter a valid URL.": test_four = "Passed" else: test_four = "Failed" url_text_clear = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_CONTENT_CTA_TWO_URL) SeleniumActions.clearTextField(web_driver, url_text_clear) SeleniumActions.write_to_element(web_driver, url_text_clear, "blackvinyl45.com") url_error_msg = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_CONTENT_CTA_TWO_URL_ERROR) url_one_error_text = SeleniumActions.read_web_element_text( url_error_msg) if url_one_error_text == "Please enter a valid URL.": test_five = "Passed" else: test_five = "Failed" url_text_clear = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_CONTENT_CTA_TWO_URL) SeleniumActions.clearTextField(web_driver, url_text_clear) SeleniumActions.write_to_element(web_driver, url_text_clear, "http://www.blackvinyl45.com") click_done_button = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_DONE_BUTTON) SeleniumActions.click_element(web_driver, click_done_button) url_error_msg = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_CONTENT_CTA_TWO_URL_ERROR) if SeleniumActions.element_is_visible(web_driver, url_error_msg): test_six = "Failed" else: test_six = "Passed" try: assert (test_one == "Passed" and test_two == "Passed" and test_three == "Passed" and test_four == "Passed" and test_five == "Passed" and test_six == "Passed") CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') except: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') self.case_teardown() except: print("C18527993 Not Tested") e = sys.exc_info()[0] print("<p>Error: %s</p>" % e)
def navigate_to_forgotten_password(web_driver): # nav to login web_driver.get("http://www.google.com") Tools.sleep(3)
def test_c18678385(self): test_case_number = "18678385" web_driver = self.fetch_webdriver() try: click_blade_module = SeleniumActions.fetch_web_element( web_driver, MartindalePageData.MODULE) SeleniumActions.click_element(web_driver, click_blade_module) Tools.sleep(2) click_edit_button = \ SeleniumActions.fetch_web_element(web_driver, MartindalePageData.IFRAME_EDIT_BUTTON) SeleniumActions.click_element(web_driver, click_edit_button) Tools.sleep(5) web_driver.switch_to.default_content() click_settings_tab = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_SETTINGS_TAB) SeleniumActions.click_element(web_driver, click_settings_tab) click_show_cta_button_two = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_SETTINGS_SHOW_CTA_TWO) SeleniumActions.click_element(web_driver, click_show_cta_button_two) web_element = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_SETTINGS_SHOW_BLADE_TITLE) click_element_visibility = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_SETTINGS_ELEMENT_VISIBILITY) SeleniumActions.click_element(web_driver, click_element_visibility) Tools.sleep(1) SeleniumActions.element_is_not_visible(web_element) click_element_visibility = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_SETTINGS_ELEMENT_VISIBILITY) SeleniumActions.click_element(web_driver, click_element_visibility) Tools.sleep(1) web_element = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_SETTINGS_SHOW_BLADE_TITLE) try: assert (SeleniumActions.element_is_visible( web_driver, web_element)) CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') except: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') except: print("C18678385 Not Tested") e = sys.exc_info()[0] print("<p>Error: %s</p>" % e)
def test_c18527974(self): test_case_number = "18527974" web_driver = self.fetch_webdriver() try: click_settings_tab = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_SETTINGS_TAB) SeleniumActions.click_element(web_driver, click_settings_tab) Tools.sleep(2) element_path = BladeModuleData.BLADE_SETTINGS_ELEMENT_VISIBILITY web_element = SeleniumActions.find_by_xpath( web_driver, element_path) settings_element_visibility = SeleniumActions.read_web_element_text( web_element) element_path = BladeModuleData.BLADE_SETTINGS_SETTINGS web_element = SeleniumActions.find_by_xpath( web_driver, element_path) settings_settings = SeleniumActions.read_web_element_text( web_element) element_path = BladeModuleData.BLADE_SETTINGS_MODULE_VISIBILITY web_element = SeleniumActions.find_by_xpath( web_driver, element_path) settings_module_visibility = SeleniumActions.read_web_element_text( web_element) try: assert (settings_element_visibility == "ELEMENT VISIBILITY" and settings_settings == "BLADE SETTINGS" and settings_module_visibility == "MODULE VISIBILITY") CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') except: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') test_case_number = "18527997" try: assert (settings_element_visibility == "ELEMENT VISIBILITY" and settings_settings == "BLADE SETTINGS" and settings_module_visibility == "MODULE VISIBILITY") CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') except: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') except: print("C18527974 Not Tested") print("C18527997 Not Tested") e = sys.exc_info()[0] print("<p>Error: %s</p>" % e)
def test_c18678390(self): test_case_number = "18678390" web_driver = self.fetch_webdriver() try: click_blade_module = SeleniumActions.fetch_web_element( web_driver, MartindalePageData.MODULE) SeleniumActions.click_element(web_driver, click_blade_module) Tools.sleep(2) click_edit_button = \ SeleniumActions.fetch_web_element(web_driver, MartindalePageData.IFRAME_EDIT_BUTTON) SeleniumActions.click_element(web_driver, click_edit_button) Tools.sleep(5) web_driver.switch_to.default_content() click_settings_tab = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_SETTINGS_TAB) SeleniumActions.click_element(web_driver, click_settings_tab) click_show_banner_caption = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_SETTINGS_SHOW_BLADE_CAPTION) SeleniumActions.click_element(web_driver, click_show_banner_caption) click_show_read_more = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_SETTINGS_SHOW_READ_MORE) SeleniumActions.click_element(web_driver, click_show_read_more) click_done_button = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_DONE_BUTTON) SeleniumActions.click_element(web_driver, click_done_button) Tools.sleep(5) web_driver.switch_to.frame( web_driver.find_element_by_xpath( MartindalePageData.MARTINDALE_IFRAME)) if SeleniumActions.check_element_exists \ (web_driver, "//*[@id=\"ple_column-0\"]/div[3]/div/div/div/div/div[1]/div[2]/a"): blade_title_existence = "true" else: blade_title_existence = "false" try: assert (blade_title_existence == "false") CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') except: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') except: print("C18678390 Not Tested") e = sys.exc_info()[0] print("<p>Error: %s</p>" % e)
def test_c18678389(self): test_case_number = "18678389" web_driver = self.fetch_webdriver() try: click_blade_module = SeleniumActions.fetch_web_element( web_driver, MartindalePageData.MODULE) SeleniumActions.click_element(web_driver, click_blade_module) Tools.sleep(2) click_edit_button = \ SeleniumActions.fetch_web_element(web_driver, MartindalePageData.IFRAME_EDIT_BUTTON) SeleniumActions.click_element(web_driver, click_edit_button) Tools.sleep(5) web_driver.switch_to.default_content() click_settings_tab = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_SETTINGS_TAB) SeleniumActions.click_element(web_driver, click_settings_tab) click_show_banner_title = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_SETTINGS_SHOW_BLADE_TITLE) SeleniumActions.click_element(web_driver, click_show_banner_title) click_show_banner_caption = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_SETTINGS_SHOW_BLADE_CAPTION) SeleniumActions.click_element(web_driver, click_show_banner_caption) click_done_button = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_DONE_BUTTON) SeleniumActions.click_element(web_driver, click_done_button) Tools.sleep(5) web_driver.switch_to.frame( web_driver.find_element_by_xpath( MartindalePageData.MARTINDALE_IFRAME)) try: assert (SeleniumActions.check_element_exists( web_driver, "//*[@id=\"ple_column-0\"]/div[3]/div/div/div/div/div[1]/div[1]/h4" )) test_one = "Failed" except: test_one = "Passed" click_blade_module = SeleniumActions.fetch_web_element( web_driver, MartindalePageData.MODULE) SeleniumActions.click_element(web_driver, click_blade_module) Tools.sleep(2) click_edit_button = \ SeleniumActions.fetch_web_element(web_driver, MartindalePageData.IFRAME_EDIT_BUTTON) SeleniumActions.click_element(web_driver, click_edit_button) Tools.sleep(5) web_driver.switch_to.default_content() click_settings_tab = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_SETTINGS_TAB) SeleniumActions.click_element(web_driver, click_settings_tab) click_show_banner_title = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_SETTINGS_SHOW_BLADE_TITLE) SeleniumActions.click_element(web_driver, click_show_banner_title) click_show_banner_caption = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_SETTINGS_SHOW_BLADE_CAPTION) SeleniumActions.click_element(web_driver, click_show_banner_caption) click_done_button = SeleniumActions.fetch_web_element( web_driver, BladeModuleData.BLADE_DONE_BUTTON) SeleniumActions.click_element(web_driver, click_done_button) Tools.sleep(5) web_driver.switch_to.frame( web_driver.find_element_by_xpath( MartindalePageData.MARTINDALE_IFRAME)) Tools.sleep(2) web_element = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_IFRAME_CAPTION) try: assert (SeleniumActions.element_is_visible( web_driver, web_element)) test_two = "Passed" except: test_two = "Failed" if test_one == "Passed" and test_two == "Passed": CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') else: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') except: print("C18678389 Not Tested") e = sys.exc_info()[0] print("<p>Error: %s</p>" % e)
def test_c18521175(self): test_case_number = "18521175" web_driver = self.fetch_webdriver() try: write_cta_title = \ SeleniumActions.fetch_web_element(web_driver, CtaModuleData.CTA_MODULE_TITLE) SeleniumActions.clearTextField(web_driver, write_cta_title) SeleniumActions.write_to_element(web_driver, write_cta_title, "Automated Title") write_cta_caption = \ SeleniumActions.fetch_web_element(web_driver, CtaModuleData.CTA_MODULE_CAPTION) SeleniumActions.clearTextField(web_driver, write_cta_caption) SeleniumActions.write_to_element(web_driver, write_cta_caption, "Automated Caption") click_done_button = \ SeleniumActions.fetch_web_element(web_driver, CtaModuleData.CTA_MODULE_DONE_BUTTON) SeleniumActions.click_element(web_driver, click_done_button) web_driver.switch_to.frame(web_driver.find_element_by_xpath(MartindalePageData.MARTINDALE_IFRAME)) Tools.sleep(4) element_path = CtaModuleData.CTA_MODULE_TITLE_DISPLAY web_element = SeleniumActions.find_by_xpath(web_driver, element_path) cta_title_text = SeleniumActions.read_web_element_text(web_element) element_path = CtaModuleData.CTA_MODULE_CAPTION_DISPLAY web_element = SeleniumActions.find_by_xpath(web_driver, element_path) cta_caption_text = SeleniumActions.read_web_element_text(web_element) click_blade_module = SeleniumActions.fetch_web_element(web_driver, MartindalePageData.MODULE) SeleniumActions.click_element(web_driver, click_blade_module) Tools.sleep(2) click_edit_button = \ SeleniumActions.fetch_web_element(web_driver, MartindalePageData.IFRAME_EDIT_BUTTON) SeleniumActions.click_element(web_driver, click_edit_button) Tools.sleep(5) web_driver.switch_to.default_content() write_cta_title = \ SeleniumActions.fetch_web_element(web_driver, CtaModuleData.CTA_MODULE_TITLE) SeleniumActions.clearTextField(web_driver, write_cta_title) SeleniumActions.write_to_element(web_driver, write_cta_title, "Test Title") write_cta_caption = \ SeleniumActions.fetch_web_element(web_driver, CtaModuleData.CTA_MODULE_CAPTION) SeleniumActions.clearTextField(web_driver, write_cta_caption) SeleniumActions.write_to_element(web_driver, write_cta_caption, "Test Caption") click_done_button = \ SeleniumActions.fetch_web_element(web_driver, CtaModuleData.CTA_MODULE_DONE_BUTTON) SeleniumActions.click_element(web_driver, click_done_button) web_driver.switch_to.frame(web_driver.find_element_by_xpath(MartindalePageData.MARTINDALE_IFRAME)) Tools.sleep(4) try: assert(cta_title_text == "Automated Title" and cta_caption_text == "Automated Caption") CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') except: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') except: print("C18521175 Not Tested") e = sys.exc_info()[0] print("<p>Error: %s</p>" % e)