Пример #1
0
def test_ie_manager_with_selenium(version, use_cache):
    delete_cache()
    if use_cache:
        IEDriverManager(version).install()
    driver_path = IEDriverManager(version).install()
    dr = webdriver.Ie(driver_path)
    dr.quit()
Пример #2
0
def test_ie_driver_binary(version, use_cache):
    delete_cache()
    ie_driver = IEDriver(version, "win32")
    if use_cache:
        cache.download_driver(ie_driver)
    ie_driver_bin = cache.download_driver(ie_driver)
    assert ie_driver_bin.name == u'IEDriverServer'
    assert os.path.exists(ie_driver_bin.path)
def delete_old_install(path=None):
    if path is None:
        delete_cache()
    else:
        path = os.path.abspath(path)
        try:
            os.remove(os.path.join(path, 'IEDriverServer.exe'))
            os.remove(os.path.join(path, 'IEDriverServer.zip'))
        except:
            pass
Пример #4
0
def delete_old_install(path=None):
    if path is None:
        delete_cache()
    else:
        path = os.path.abspath(path)
        for f in os.listdir(path):
            if f.startswith("phantomjs-"):
                try:
                    os.remove(os.path.join(path, f))
                except:
                    pass
Пример #5
0
def delete_old_install(path=None):
    if path is None:
        delete_cache()
    else:
        path = os.path.abspath(path)
        try:
            os.remove(os.path.join(path, 'phantomjs.exe'))
            print(os.path.join(path, 'phantomjs.exe'))
            for file in os.listdir(path):
                if 'phantomjs' in file and not os.path.isfile(file):
                    if 'phantomjs.exe' in os.listdir(
                            os.path.join(path, file, 'bin')):
                        shutil.rmtree(os.path.join(path, file))
                        print(os.path.join(path, file))
                elif 'phantomjs' in file and file.endswith('.zip'):
                    os.remove(os.path.join(path, file))
                    print(os.path.join(path, file))
        except:
            pass
def test_can_get_driver_from_cache(os_type):
    delete_cache()
    GeckoDriverManager(os_type=os_type).install()
    driver_path = GeckoDriverManager(os_type=os_type).install()
    assert os.path.exists(driver_path)
def test_can_download_ff_x64():
    delete_cache()
    driver_path = GeckoDriverManager(os_type="win64").install()
    print(driver_path)
def test_can_get_chrome_for_win(os_type):
    delete_cache()
    path = ChromeDriverManager(os_type=os_type).install()
    assert os.path.exists(path)
Пример #9
0
def test_can_phantom_with_selenium():
    delete_cache()
    webdriver.PhantomJS(executable_path=PhantomJsDriverManager().install())
Пример #10
0
def test_can_user_phantom_driver_from_cache():
    delete_cache()
    PhantomJsDriverManager(os_type="linux").install()
    path = PhantomJsDriverManager(os_type="linux").install()
    assert path.endswith("phantomjs")
Пример #11
0
def test_can_download_phantom_for_linux():
    delete_cache()
    path = PhantomJsDriverManager(os_type="linux").install()
    assert path.endswith("phantomjs")
Пример #12
0
def test_can_download_phantom_for_windows():
    delete_cache()
    path = PhantomJsDriverManager(os_type="win").install()
    assert path.endswith("phantomjs.exe")
Пример #13
0
def test_can_get_phantomjs_for_linux(os_type):
    delete_cache()
    path = PhantomJsDriverManager(os_type=os_type).install()
    assert os.path.exists(path)
Пример #14
0
def test_can_get_latest_ie_driver_for_x64():
    delete_cache()
    IEDriverManager(os_type="win64").install()