Esempio n. 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
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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()
Esempio n. 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)
Esempio n. 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'
Esempio n. 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"
Esempio n. 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"
Esempio n. 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()
Esempio n. 11
0
    def test_create_bot(self, active_config):
        """Create a bot."""
        from dallinger.bots import BotBase

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