Exemplo n.º 1
0
def oneTimeSetUp(request, browser):
    print("Running one time setUp")
    wdf = WebDriverFactory(browser)
    driver = wdf.getWebDriverInstance()

    if request.cls is not None:
        request.cls.driver = driver

    yield driver
    driver.quit()
    print("Running one time tearDown")
Exemplo n.º 2
0
def classSetUp(request, browser):
    print("Running class level setup.")
    wf = WebDriverFactory(browser)
    driver = wf.getWebDriverInstance()

    if request.cls is not None:
        request.cls.driver = driver

    yield driver
    driver.quit()
    print("Running class level teardown.")
def oneTimeSetUp(request, browser):
    print("Running one time setUp")
    wb = WebDriverFactory(browser)
    driver = wb.getWebDriverInstance()
    lp = LoginPage(driver)
    lp.click_login_link()
    lp.login("*****@*****.**", "abcabc")
    if request.cls is not None:
        request.cls.driver = driver
    yield driver
    #lp.logout()
    #driver.quit()
    print("Running one time tearDown")
def oneTimeSetUp(request, browser):
    print("Running one time setUp")
    wdf = WebDriverFactory(browser)
    driver = wdf.getWebDriverInstance()
    lp = LoginPage(driver)
    lp.login("*****@*****.**", "letskodeit")

    if request.cls is not None:
        request.cls.driver = driver

    yield driver
    driver.quit()
    print("Running one time tearDown")
Exemplo n.º 5
0
def cSetup(request, browser):
    print("Execute before each class")
    wdf = WebDriverFactory(browser)
    driver = wdf.getWebDriverInstance()

    base_url = "https://letskodeit.teachable.com/"
    driver.get(base_url)

    lp = LoginPage(driver)
    lp.login('*****@*****.**', "abcabc")

    if request.cls is not None:
        request.cls.driver = driver
    yield
    driver.quit()
    print("Execute after each module")
Exemplo n.º 6
0
def oneTimeSetUp(request, browser):
    print("Running one time setUp")
    wdf = WebDriverFactory(browser)
    driver = wdf.getWebDriverInstance()
    lp = login(driver)

    # Give the location of the file
    loc = ("C:\\Users\Sagar\\PycharmProjects\\furnish\\testcases\\login.xls")

    # To open Workbook
    wb = xlrd.open_workbook(loc)
    sheet = wb.sheet_by_index(0)

    # For row 0 and column 0
    username = (sheet.cell_value(1, 0))
    password = (sheet.cell_value(1, 1))
    lp.validloginForm(username, password)

    if request.cls is not None:
        request.cls.driver = driver
    yield driver
    driver.quit()
    print("Running one time tearDown")