示例#1
0
def init_login():
    driver=Chrome()
    # chrome_options = Options()
    # chrome_options.add_argument('--headless')
    # driver = Chrome(chrome_options=chrome_options)
    driver.implicitly_wait(30)
    # 初始化登录页面
    login = LoginPage(driver)
    yield driver, login
    driver.quit()
示例#2
0
def init_bid():
    # driver=Chrome()
    chrome_options = Options()
    chrome_options.add_argument('--headless')
    driver = Chrome(chrome_options=chrome_options)
    driver.implicitly_wait(30)
    # 初始化登录页面
    login = LoginPage(driver)
    # 首页
    home = HomePage(driver)
    # 投资页面
    bid = BidPage(driver)
    # 个人页面
    personal = PersonalPage(driver)
    # 登录
    login.register(bid_data.login_data['user_name'], bid_data.login_data['password'])
    # 选择投标项目
    home.get_bid_project()
    yield bid, personal
    driver.quit()
示例#3
0
def init_login():
    chrome_options = ChromeOptions()
    chrome_options.binary_location = r'C:\Users\Administrator\AppData\Local\Google\Chrome\Application\chrome.exe'
    chrome_options.add_argument('--headless')
    driver = Chrome(executable_path=r"C:\Python\Scripts\chromedriver.exe",
                    options=chrome_options)
    driver.implicitly_wait(30)
    # 初始化登录页面
    login = LoginPage(driver)
    yield driver, login
    driver.quit()
示例#4
0
def init_bid():
    # driver=Chrome()
    chrome_options = ChromeOptions()
    chrome_options.add_argument('--headless')
    chrome_options.binary_location = r'C:\Users\Administrator\AppData\Local\Google\Chrome\Application\chrome.exe'
    driver = Chrome(executable_path=r"C:\Python\Scripts\chromedriver.exe",
                    options=chrome_options)
    driver.implicitly_wait(30)
    # 初始化登录页面
    login = LoginPage(driver)
    # 首页
    home = HomePage(driver)
    # 投资页面
    bid = BidPage(driver)
    # 个人页面
    personal = PersonalPage(driver)
    # 登录
    login.register(bid_data.login_data['user_name'],
                   bid_data.login_data['password'])
    # 选择投标项目
    home.get_bid_project()
    yield bid, personal
    driver.quit()
示例#5
0
 def setUpClass(cls) -> None:
     cls.driver = Chrome()
     # 登录页面
     cls.login = LoginPage(cls.driver)
     # 首页
     cls.home = HomePage(cls.driver)
     # 投资页面
     cls.bid = BidPage(cls.driver)
     # 个人页面
     cls.personal = PersonalPage(cls.driver)
     # 登录
     cls.login.register(bid_data.login_data['user_name'],
                        bid_data.login_data['password'])
     # 选择投标项目“先借一个亿”
     cls.home.get_bid_project()
     # 滚动滑动条
     cls.bid.scroll()
示例#6
0
 def setUpClass(cls) -> None:
     cls.driver = Chrome()
     # chrome_options = Options()
     # chrome_options.add_argument('--headless')
     # cls.driver = Chrome(chrome_options=chrome_options)
     cls.login = LoginPage(cls.driver)