Example #1
0
 def _create_webdriver(self):
     log_file = open('tests/log/firefox.log', 'a')
     log_file.write('\n\n[%s] Running Functional Tests\n' %
                    str(datetime.now()))
     log_file.flush()
     firefox = firefox_binary.FirefoxBinary(log_file=log_file)
     return webdriver.Firefox(firefox_binary=firefox)
Example #2
0
 def _prepare_webdriver(self):
     log_file = open(join(LOG_DIR, 'firefox.log'), 'a')
     log_file.write(
         '\n\n[%s] Running Functional Tests\n' % str(
             datetime.now()))
     log_file.flush()
     return firefox_binary.FirefoxBinary(log_file=log_file)
Example #3
0
    def _create_firefox_browser(self):
        profile = webdriver.FirefoxProfile()

        xpi_path = os.path.join(thisdir, os.pardir, 'third_party',
                                'r_kiosk-0.9.0-fx.xpi')
        if not self._debug:
            profile.add_extension(xpi_path)

        binary = firefox_binary.FirefoxBinary(firefox_path=self._browser_path)

        return webdriver.Firefox(firefox_profile=profile,
                                 firefox_binary=binary)
Example #4
0
    def setUpClass(cls):
        try:
            firefox_path = getattr(settings, 'SELENIUM_FIREFOX_PATH', None)
            if firefox_path:
                firefox_bin = firefox_binary.FirefoxBinary(
                    firefox_path=firefox_path)
                kwargs = {'firefox_binary': firefox_bin}
            else:
                kwargs = {}
            cls.webdriver = webdriver.Firefox(**kwargs)
        except (RuntimeError, WebDriverException):
            cls.skipme = True

        super(SeleniumTestCase, cls).setUpClass()