Beispiel #1
0
    def test_create_bot(self):
        """Create a bot."""
        config.ready = True
        from dallinger.bots import BotBase

        bot = BotBase("http://dallinger.io")
        assert bot
Beispiel #2
0
 def test_bot_using_phantomjs(self):
     """Create a bot."""
     config.ready = True
     config.extend({'webdriver_type': u'phantomjs'})
     from dallinger.bots import BotBase
     bot = BotBase("http://dallinger.io")
     assert isinstance(bot.driver, webdriver.PhantomJS)
Beispiel #3
0
    def test_bot_using_chrome(self, active_config):
        """Create a bot."""
        active_config.extend({"webdriver_type": u"chrome"})
        from dallinger.bots import BotBase

        bot = BotBase("http://dallinger.io")
        assert isinstance(bot.driver, webdriver.Chrome)
Beispiel #4
0
 def test_bot_using_chrome(self):
     """Create a bot."""
     return
     config.ready = True
     config.extend({'webdriver_type': u'chrome'})
     from dallinger.bots import BotBase
     bot = BotBase("http://dallinger.io")
     assert isinstance(bot.driver, webdriver.Chrome)
Beispiel #5
0
    def test_bot_using_phantomjs(self, active_config):
        """Create a bot."""
        active_config.extend({"webdriver_type": u"phantomjs"})
        from dallinger.bots import BotBase

        bot = BotBase("http://dallinger.io")
        assert isinstance(bot.driver, webdriver.PhantomJS)
        bot.driver.quit()
Beispiel #6
0
    def test_bot_using_firefox(self):
        """Create a bot."""
        return
        config.ready = True
        config.extend({"webdriver_type": u"firefox"})
        from dallinger.bots import BotBase

        bot = BotBase("http://dallinger.io")
        assert isinstance(bot.driver, webdriver.Firefox)
Beispiel #7
0
 def test_bot_using_webdriver_chrome(self):
     """Create a bot."""
     config.ready = True
     config.extend({
         'webdriver_type':
         u'chrome',
         'webdriver_url':
         pytest.config.getvalue("webdriver").decode("ascii")
     })
     from dallinger.bots import BotBase
     bot = BotBase("http://dallinger.io")
     assert isinstance(bot.driver, webdriver.Remote)
     assert bot.driver.capabilities['browserName'] == 'chrome'
Beispiel #8
0
    def test_bot_using_webdriver_chrome(self, active_config):
        """Create a bot."""
        active_config.extend({
            "webdriver_type":
            u"chrome",
            "webdriver_url":
            self._config.getvalue("webdriver").decode("ascii"),
        })
        from dallinger.bots import BotBase

        bot = BotBase("http://dallinger.io")
        assert isinstance(bot.driver, webdriver.Remote)
        assert bot.driver.capabilities["browserName"] == "chrome"
Beispiel #9
0
    def test_bot_using_webdriver_firefox(self):
        """Create a bot."""
        config.ready = True
        config.extend({
            "webdriver_type":
            u"firefox",
            "webdriver_url":
            pytest.config.getvalue("webdriver").decode("ascii"),
        })
        from dallinger.bots import BotBase

        bot = BotBase("http://dallinger.io")
        assert isinstance(bot.driver, webdriver.Remote)
        assert bot.driver.capabilities["browserName"] == "firefox"
Beispiel #10
0
    def test_bot_driver_default_is_phantomjs(self, active_config):
        from dallinger.bots import BotBase

        bot = BotBase("http://dallinger.io")
        assert isinstance(bot.driver, webdriver.PhantomJS)
        bot.driver.quit()
Beispiel #11
0
    def test_create_bot(self, active_config):
        """Create a bot."""
        from dallinger.bots import BotBase

        bot = BotBase("http://dallinger.io")
        assert bot