Exemplo n.º 1
0
def cronjob3_run(common, driver, home_lnk_page, Admin_lnk, cron2_lnk, view_lnk,
                 run):
    """This Function helps to run from the Cron tab 3"""
    print "Returning Home page"
    common.gotoPage(home_lnk_page, driver)
    common.pageLoadTime(10, driver)
    print "Clicking on Admin page"
    common.gotoPage(Admin_lnk, driver)
    common.pageLoadTime(10, driver)
    print "Clicking on View page"
    common.gotoPage(view_lnk, driver)
    common.pageLoadTime(10, driver)
    print "Clicking on Cron3 Tab"
    common.gotoPage(cron2_lnk, driver)
    print "Running Cron"
    job_id = int(common.find_element(By.XPATH, "//tr[1]/td[1]", driver).text)
    common.gotoPage(run, driver)
    common.pageLoadTime(10, driver)
    alert_msg = common.alert_present(driver)
    print "New JoB Id has been created"
    job_id_new = job_id + 1
    print "After Running cron looks for the text"
    cron3_txt = common.find_element(By.XPATH, "//tr[1]/td[2]", driver).text

    print "After CronRun looks for the message"
    afterrun_message_txt = common.find_element(By.XPATH, "//tr[1]/td[5]",
                                               driver).text

    if (job_id != job_id_new
            and cron3_txt == "AUP Upgrade Site Creation ('Job 3')"
            and "Total Sites forecasted on" in afterrun_message_txt):
        return "Finished"

    else:
        return "Failed"
Exemplo n.º 2
0
def deletePreference(common, firstSiteName, delete, confirm_del, driver):
    """Delete the table Content"""

    print "Click on Delete button"
    delButton = common.find_element(By.XPATH, delete, driver)
    delButton.click()
    # Confirm the delete operation
    print "Confirm the delete operation"
    common.find_element(By.XPATH, confirm_del, driver).click()
    driver.set_page_load_timeout(10)
Exemplo n.º 3
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
Exemplo n.º 4
0
def cronjob2_run(common, driver, home_lnk_page, Admin_lnk, cron2_lnk, view_lnk,
                 run):

    print "Returning Home page"
    common.gotoPage(home_lnk_page, driver)
    common.pageLoadTime(10, driver)
    print "Clicking on Admin page"
    common.gotoPage(Admin_lnk, driver)
    common.pageLoadTime(10, driver)
    print "Clicking on View page"
    common.gotoPage(view_lnk, driver)
    common.pageLoadTime(10, driver)
    print "Clicking on Cron2 Tab"
    common.gotoPage(cron2_lnk, driver)
    time.sleep(10)

    print "Running Cron"
    job_id = int(common.find_element(By.XPATH, "//tr[1]/td[1]", driver).text)
    common.gotoPage(run, driver)
    time.sleep(10)
    alert_msg = common.alert_present(driver)
    time.sleep(10)

    print "JoB Id"
    job_id_new = job_id + 1
    time.sleep(10)
    print job_id_new
    print "After Running cron looks for the text"
    time.sleep(10)
    cron2_txt = common.find_element(By.XPATH, "//tr[1]/td[2]", driver).text
    print cron2_txt
    print "After CronRun looks for the message"
    afterrun_message_txt = common.find_element(By.XPATH, "//tr[1]/td[5]",
                                               driver).text
    #         print afterrun_message_txt
    #         print cron2_txt
    time.sleep(10)

    if (job_id != job_id_new
            and cron2_txt == "AUP Forecast Date Generation('Job 2')"
            and "Forecast Date generated for sites:" in afterrun_message_txt):
        return "Finished"

    else:
        return "Failed"
Exemplo n.º 5
0
def message_split(common, driver):
    """Spliting the Messages"""
    message_detail = common.find_element(By.XPATH, "//*[@id='aup_pref_info']",
                                         driver).text

    data = message_detail.split()  #split string into a list

    count = int(data[5])
    return count
def cronjob4_run(common, driver, home_lnk_page, Admin_lnk, cron4_lnk, view_lnk,
                 run):
    """This Function helps to run from the Cron tab 4"""

    print "Clicking on Admin page"
    common.gotoPage(Admin_lnk, driver)
    common.pageLoadTime(10, driver)
    print "Clicking on View page"
    common.gotoPage(view_lnk, driver)
    common.pageLoadTime(10, driver)
    print "Clicking on Cron4 Tab"
    common.gotoPage(cron4_lnk, driver)
    print "Running Cron"
    job_id = int(common.find_element(By.XPATH, "//tr[1]/td[1]", driver).text)
    common.gotoPage(run, driver)
    common.pageLoadTime(10, driver)
    alert_msg = common.alert_present(driver)
    print "New JoB Id has been created"
    job_id_new = job_id + 1
    print job_id
    print "After Running cron looks for the text"

    cron4_txt = common.find_element(By.XPATH, "//tr[1]/td[2]", driver).text
    print job_id_new
    print "After CronRun looks for the message"
    afterrun_message_txt = common.find_element(By.XPATH, "//tr[1]/td[5]",
                                               driver).text
    print afterrun_message_txt
    if (job_id != job_id_new
            and cron4_txt == "Crux CX Rest Integration ('Job 4')"
            and afterrun_message_txt
            == "There were no forecast dates to be synched to CX"):
        return "Finished"

    else:
        return "Failed"
Exemplo n.º 7
0
def populatesite(common, driver):
    """Populating the site"""
    common.find_element(By.XPATH, "//*[@id='new_aup_preferences_info']",
                        driver).click()
    common.find_element(By.XPATH, "//span[text()='Add']", driver).click()
Exemplo n.º 8
0
def prodcut_release_info(driver, common, prod_release_date, patch_date,
                         addbutton, siteSearchText, form_string):
    print "Select Current Date"
    cdate = common.currentdate()
    time.sleep(10)
    print cdate
    common.find_element(By.XPATH, prod_release_date, driver).send_keys(cdate)
    common.pageLoadTime(10, driver)
    common.find_element(By.XPATH, prod_release_date,
                        driver).send_keys(Keys.ENTER)
    time.sleep(10)
    print "Select Next Date"
    patchdate = common.nextdate()
    time.sleep(10)
    print patchdate
    #         patch_xpath="//a[text()='"+patch+"']"
    #         print patch_xpath
    common.pageLoadTime(10, driver)
    common.find_element(By.XPATH, patch_date, driver).send_keys(patchdate)
    #         common.find_element(By.XPATH,patch_date, driver).send_keys(Keys.ENTER)
    common.pageLoadTime(10, driver)
    print "Clicking on the Add Date"
    common.find_element(By.XPATH, addbutton, driver).click()
    print "searching for the Product release Version"
    common.find_element(By.XPATH, siteSearchText,
                        driver).send_keys(form_string)
    common.find_element(By.XPATH, siteSearchText, driver).send_keys(Keys.ENTER)
    text_td = "//td[text()='" + form_string + "']"
    Actual_prod = common.find_element(By.XPATH, text_td, driver).text
    return Actual_prod