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_c18527978(self): test_case_number = "18527978" web_driver = self.fetch_webdriver() try: web_element = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_CONTENT_CTA_ONE_LINK_TEXT) click_module_info = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_CONTENT_MANAGE_CTA_BUTTONS) 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_MANAGE_CTA_BUTTONS) 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("C18527978 Not Tested") e = sys.exc_info()[0] print("<p>Error: %s</p>" % e)
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_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_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_c18521174(self): test_case_number = "18521174" web_driver = self.fetch_webdriver() try: write_link_text_two = \ SeleniumActions.fetch_web_element(web_driver, CtaModuleData.CTA_MODULE_LINK_TEXT_BOX_TWO) SeleniumActions.clearTextField(web_driver, write_link_text_two) SeleniumActions.write_to_element(web_driver, write_link_text_two, "Legalize Ferrets") click_settings_tab = SeleniumActions.fetch_web_element(web_driver, CtaModuleData.CTA_SETTINGS_TAB) SeleniumActions.click_element(web_driver, click_settings_tab) cta_settings_button_one = \ SeleniumActions.fetch_web_element(web_driver, CtaModuleData.CTA_SETTINGS_SHOW_BUTTON_ONE) try: assert(SeleniumActions.element_is_visible(web_driver, cta_settings_button_one)) CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') except: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') except: print("C18521174 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_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_c18513008(self): test_case_number = "18513008" web_driver = self.fetch_webdriver() try: click_settings_tab = \ SeleniumActions.fetch_web_element(web_driver, BannerModuleData.BANNER_MODULE_SETTINGS_TAB) SeleniumActions.click_element(web_driver, click_settings_tab) element_path = BannerModuleData.BANNER_MODULE_SETTINGS_ELEMENT_VISIBILITY web_element = SeleniumActions.find_by_xpath( web_driver, element_path) element_visibility_text = SeleniumActions.read_web_element_text( web_element) click_layout_tab = \ SeleniumActions.fetch_web_element(web_driver, BannerModuleData.BANNER_MODULE_LAYOUT_TAB) SeleniumActions.click_element(web_driver, click_layout_tab) element_path = BannerModuleData.BANNER_MODULE_LAYOUT_TYPE web_element = SeleniumActions.find_by_xpath( web_driver, element_path) layout_type_text = SeleniumActions.read_web_element_text( web_element) click_content_tab = \ SeleniumActions.fetch_web_element(web_driver, BannerModuleData.BANNER_MODULE_CONTENT_TAB) SeleniumActions.click_element(web_driver, click_content_tab) element_path = BannerModuleData.BANNER_MODULE_CONENT_MANAGE_CONTENT web_element = SeleniumActions.find_by_xpath( web_driver, element_path) manage_content_text = SeleniumActions.read_web_element_text( web_element) try: assert (element_visibility_text == "ELEMENT VISIBILITY" and layout_type_text == "LAYOUT TYPE" and manage_content_text == "Manage Content") CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') except: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') except: print("C18513008 Not Tested") e = sys.exc_info()[0] print("<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 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 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_c18513007(self): test_case_number = "18513007" web_driver = self.fetch_webdriver() try: click_banner_module = SeleniumActions.fetch_web_element( web_driver, MartindalePageData.MODULE) SeleniumActions.click_element(web_driver, click_banner_module) Tools.sleep(2) click_banner_name = \ SeleniumActions.fetch_web_element(web_driver, BannerModuleData.BANNER_MODULE_HEADER) SeleniumActions.click_element(web_driver, click_banner_name) 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 = BannerModuleData.GALLERY_BANNER_TITLE web_element = SeleniumActions.find_by_xpath( web_driver, element_path) banner_text = SeleniumActions.read_web_element_text(web_element) try: assert (banner_text == "BANNER MODULE") CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') except: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') except: print("C18513007 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_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_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_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_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_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_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_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 test_c18521042(self): test_case_number = "18521042" web_driver = self.fetch_webdriver() try: click_save_button = \ SeleniumActions.fetch_web_element(web_driver, BannerModuleData.ADD_BANNER_SAVE_BUTTON) SeleniumActions.click_element(web_driver, click_save_button) element_path = BannerModuleData.BANNER_TITLE_ERROR web_element = SeleniumActions.find_by_xpath( web_driver, element_path) banner_title_error = SeleniumActions.read_web_element_text( web_element) element_path = BannerModuleData.BANNER_CAPTION_ERROR web_element = SeleniumActions.find_by_xpath( web_driver, element_path) banner_caption_error = SeleniumActions.read_web_element_text( web_element) banner_title = SeleniumActions.fetch_web_element( web_driver, BannerModuleData.BANNER_TITLE) SeleniumActions.write_to_element \ (web_driver, banner_title, "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ012") banner_caption = SeleniumActions.fetch_web_element( web_driver, BannerModuleData.BANNER_CAPTION) SeleniumActions.write_to_element \ (web_driver, banner_caption, "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ012ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ012") click_save_button = \ SeleniumActions.fetch_web_element(web_driver, BannerModuleData.ADD_BANNER_SAVE_BUTTON) SeleniumActions.click_element(web_driver, click_save_button) element_path = BannerModuleData.BANNER_TITLE_ERROR web_element = SeleniumActions.find_by_xpath( web_driver, element_path) banner_title_error_two = SeleniumActions.read_web_element_text( web_element) element_path = BannerModuleData.BANNER_CAPTION_ERROR web_element = SeleniumActions.find_by_xpath( web_driver, element_path) banner_caption_error_two = SeleniumActions.read_web_element_text( web_element) try: assert (banner_title_error == "This field is required." and banner_caption_error == "This field is required." and banner_title_error_two == "Please enter no more than 100 characters." and banner_caption_error_two == "Please enter no more than 200 characters.") CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') except: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') except: print("C18521042 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_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)
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_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_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_c18527998(self): test_case_number = "18527998" 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, "0") link_page_text = SeleniumActions.read_select_text(web_element) link_page = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_CONTENT_CTA_ONE_LINK_PAGE) SeleniumActions.element_is_visible(web_driver, web_element) SeleniumActions.select_by_index(web_element, "1") url_text = SeleniumActions.read_select_text(web_element) url_text_box = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_CONTENT_CTA_ONE_URL) SeleniumActions.element_is_visible(web_driver, web_element) SeleniumActions.select_by_index(web_element, "2") no_link = SeleniumActions.read_select_text(web_element) SeleniumActions.element_is_not_visible(link_page) SeleniumActions.element_is_not_visible(url_text_box) #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, "0") link_page_text_two = SeleniumActions.read_select_text(web_element) link_page = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_CONTENT_CTA_TWO_LINK_PAGE) SeleniumActions.element_is_visible(web_driver, web_element) SeleniumActions.select_by_index(web_element, "1") url_text_two = SeleniumActions.read_select_text(web_element) url_text_box = \ SeleniumActions.fetch_web_element(web_driver, BladeModuleData.BLADE_CONTENT_CTA_TWO_URL) SeleniumActions.element_is_visible(web_driver, web_element) SeleniumActions.select_by_index(web_element, "2") no_link_two = SeleniumActions.read_select_text(web_element) SeleniumActions.element_is_not_visible(link_page) SeleniumActions.element_is_not_visible(url_text_box) try: assert (link_page_text == "My Pages" and url_text == "External Link" and no_link == "No Link" and link_page_text_two == "My Pages" and url_text_two == "External Link" and no_link_two == "No Link") CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') except: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') test_case_number = "18527999" try: assert (link_page_text == "My Pages" and url_text == "External Link" and no_link == "No Link" and link_page_text_two == "My Pages" and url_text_two == "External Link" and no_link_two == "No Link") CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().PASS, '') except: CommonSetup.report_test_rail(self, test_case_number, TestRailStatus().FAIL, '') except: print("C18527999 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)