def customTestFunctions(driver):
    try:
        common.loginToCrux(userName, passWord, usname_Value, password_Value,
                           driver)

    except AssertionError:
        print(" Tese Case Failed ")
        raise AssertionError
        return False
Exemplo n.º 2
0
def customTestFunctions(driver):
    """To Run the Cron2 Job"""

    try:
        common.loginToCrux(userName, passWord, usname_Value, password_Value,
                           driver)
        #             gotoPreferencesview(common,home_lnk,product_release_info,driver)
        print "Clicking scheduler menu in the home page "
        common.gotoPage(home_lnk, driver)
        common.pageLoadTime(10, driver)
        print "Clicking Product Release Information menu Scheduler Page "
        common.gotoPage(product_release_info, driver)
        print "Deleting entire Product release Details"
        bool_Delete = common.delete_table(driver)
        print "If the Forecast date exists Delete"
        if (bool_Delete):
            form_string = add_details(driver, product_release_Addnew)
            bool_value = common.select_by_text(driver, dropdown, form_string)
            common.pageLoadTime(10, driver)
            if (bool_value):
                actual_info = prodcut_release_info(driver, common,
                                                   prod_release_date,
                                                   patch_date, addbutton,
                                                   siteSearchText, form_string)
                alert_mes = cronjob2_run(common, driver, home_lnk_page,
                                         Admin_lnk, cron2_lnk, view_lnk, run)
                assert alert_mes == "Finished"
                return True

        else:
            print "If Forecast date Not exists Create New one"
            form_string = add_details(driver, product_release_Addnew)
            common.pageLoadTime(10, driver)
            bool_value = common.select_by_text(driver, dropdown, form_string)
            prodcut_release_info(driver, common, prod_release_date, patch_date,
                                 addbutton, siteSearchText, form_string)
            alert_mes = cronjob2_run(common, driver, home_lnk_page, Admin_lnk,
                                     cron2_lnk, view_lnk, run)
            assert alert_mes == "Finished"
            return True

    except NoSuchElementException:
        print(" Tese Case Failed ")
        raise NoSuchElementException
        return False

    except AssertionError:
        print(" Tese Case Failed ")
        raise AssertionError
        return False
def customTestFunctions(driver):
    try:
        common.loginToCrux(userName, passWord, usname_Value, password_Value,
                           driver)
        #             gotoPreferencesview(common,home_lnk,aup_shd_lnk,driver)

        alert_mes = cronjob4_run(common, driver, home_lnk_page, Admin_lnk,
                                 cron4_lnk, view_lnk, run)
        return True

    except AssertionError:
        print(" Tese Case Failed ")
        raise AssertionError
        return False
Exemplo n.º 4
0
def customTestFunctions(driver):

    #         print func_name
    """This function will create the object for AUP preferences view controller and triggers the required
     UI test cases via the class methods"""
    try:
        #             print os.path.abspath(os.curdir)
        common.loginToCrux(userName, passWord, usname_Value, password_Value,
                           driver)
        # Navigate to AUP preferences page from Home page.
        gotoPreferencesview(common, home_lnk, aup_shd_lnk, driver)
        message = common.find_element(By.XPATH, norecordMessage, driver).text
        time.sleep(10)
        count = message_split(common, driver)

        if (message == "No data available in table"):
            populatesite(common, driver)
            return True


#             count =self.populatesite(common,self.actualMessage,self.norecordMessage,driver)
        elif (count > 0):
            #             //table/tbody/tr[1]/td[16]/button[2]
            common.find_element(By.XPATH,
                                "//table/tbody/tr[1]/td[16]/button[2]",
                                driver).click()
            driver.set_page_load_timeout(10)
            common.find_element(By.XPATH, "//div[11]/div/button[1]",
                                driver).click()
            driver.set_page_load_timeout(10)
            deletePreference(common, firstSiteName, siteDeleteBtn,
                             siteConfirmDeleteBtn, driver)
            time.sleep(10)
            less_count = message_split(common, driver)
            print less_count
            time.sleep(10)
            populatesite(common, driver)
            actual_count = message_split(common, driver)
            print actual_count
            if (actual_count > less_count):
                return True

    except AssertionError:
        print(" Tese Case Failed ")
        raise AssertionError
        return False