Exemple #1
0
 def setUp(self):
     if sys.platform == 'darwin':
         #project_root = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
         #repo_root = os.path.dirname(project_root)
         #sys.path.append(os.path.join(repo_root, 'dev'))
         from download_chromedriver import get_chromedriver_path
         chrome_path = get_chromedriver_path()
         if chrome_path is False:
             raise SystemExit
         self.browser = webdriver.Chrome(chrome_path)
     else:
         self.browser = webdriver.Firefox()
Exemple #2
0
def browser():
    print("loading browser")
    if sys.platform == 'darwin':
        project_root = os.path.dirname(
            os.path.dirname(os.path.realpath(__file__)))
        repo_root = os.path.dirname(project_root)
        sys.path.append(os.path.join(repo_root, 'dev'))
        import download_chromedriver
        download_chromedriver.download()
        chrome_path = download_chromedriver.get_chromedriver_path()
        if chrome_path is False:
            raise SystemExit
        driver = webdriver.Chrome(chrome_path)
    else:
        driver = webdriver.Firefox()
    return driver
Exemple #3
0
    def setUp(self):
        settings.PIPELINE['PIPELINE_ENABLED'] = False
        if sys.platform == 'darwin':
            project_root = os.path.dirname(
                os.path.dirname(os.path.realpath(__file__)))
            repo_root = os.path.dirname(project_root)
            sys.path.append(os.path.join(repo_root, 'dev'))
            from download_chromedriver import get_chromedriver_path
            chrome_path = get_chromedriver_path()
            if chrome_path is False:
                raise SystemExit
            self.browser = webdriver.Chrome(chrome_path)
        else:
            self.browser = webdriver.Firefox()

        self.test_user = Account.objects.get(username='******')
def browser():
    if sys.platform == 'darwin':
        project_root = os.path.dirname(os.path.dirname(
            os.path.realpath(__file__)))
        repo_root = os.path.dirname(project_root)
        sys.path.append(os.path.join(repo_root, 'dev'))
        import download_chromedriver
        download_chromedriver.download()
        chrome_path = download_chromedriver.get_chromedriver_path()
        if chrome_path is False:
            raise SystemExit
        driver = webdriver.Chrome(chrome_path)
    else:
        driver = webdriver.Firefox()
    yield driver
    if 'CIRCLE_ARTIFACTS' in os.environ:
        driver.get_screenshot_as_file(os.environ['CIRCLE_ARTIFACTS'] + '/test.png')
    driver.close()