コード例 #1
0
ファイル: end2end_test.py プロジェクト: karlicoss/promnesia
def _test_helper(tmp_path,
                 indexer,
                 test_url: Optional[str],
                 browser: Browser = FFH,
                 **kwargs):
    tdir = Path(tmp_path)

    indexer(tdir)
    with wserver(db=tdir / 'promnesia.sqlite') as srv, get_webdriver(
            browser=browser) as driver:
        port = srv.port
        configure(driver, port=port, **kwargs)
        sleep(0.5)

        if test_url is not None:
            driver.get(test_url)
            sleep(3)  # todo use some condition...
        else:
            driver.get('about:blank')

        yield TestHelper(driver=driver)
コード例 #2
0
def _test_helper(tmp_path,
                 indexer,
                 test_url: Optional[str],
                 show_dots: bool = False,
                 browser: Browser = FFH):
    tdir = Path(tmp_path)

    indexer(tdir)
    with wserver(db=tdir / 'promnesia.sqlite') as srv, get_webdriver(
            browser=browser) as driver:
        port = srv.port
        configure_extension(driver, port=port, show_dots=show_dots)
        sleep(0.5)

        if test_url is not None:
            driver.get(test_url)
            sleep(3)
        else:
            driver.get('about:blank')

        yield TestHelper(driver=driver)