本文整理汇总了Python中toolium.config_driver.ConfigDriver._create_remote_driver方法的典型用法代码示例。如果您正苦于以下问题:Python ConfigDriver._create_remote_driver方法的具体用法?Python ConfigDriver._create_remote_driver怎么用?Python ConfigDriver._create_remote_driver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toolium.config_driver.ConfigDriver
的用法示例。
在下文中一共展示了ConfigDriver._create_remote_driver方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_create_remote_driver_phantomjs
# 需要导入模块: from toolium.config_driver import ConfigDriver [as 别名]
# 或者: from toolium.config_driver.ConfigDriver import _create_remote_driver [as 别名]
def test_create_remote_driver_phantomjs(webdriver_mock, config):
config.set('Server', 'host', '10.20.30.40')
config.set('Server', 'port', '5555')
config.set('Driver', 'type', 'phantomjs')
config_driver = ConfigDriver(config)
config_driver._create_remote_driver()
webdriver_mock.Remote.assert_called_once_with(command_executor='http://10.20.30.40:5555/wd/hub',
desired_capabilities=DesiredCapabilities.PHANTOMJS)
示例2: test_create_remote_driver_iexplore
# 需要导入模块: from toolium.config_driver import ConfigDriver [as 别名]
# 或者: from toolium.config_driver.ConfigDriver import _create_remote_driver [as 别名]
def test_create_remote_driver_iexplore(webdriver_mock, config):
config.set('Server', 'host', '10.20.30.40')
config.set('Server', 'port', '5555')
config.set('Driver', 'type', 'iexplore')
config_driver = ConfigDriver(config)
config_driver._create_remote_driver()
webdriver_mock.Remote.assert_called_once_with(command_executor='http://10.20.30.40:5555/wd/hub',
desired_capabilities=DesiredCapabilities.INTERNETEXPLORER)
示例3: test_create_remote_driver_version_platform
# 需要导入模块: from toolium.config_driver import ConfigDriver [as 别名]
# 或者: from toolium.config_driver.ConfigDriver import _create_remote_driver [as 别名]
def test_create_remote_driver_version_platform(webdriver_mock, config):
config.set('Server', 'host', '10.20.30.40')
config.set('Server', 'port', '5555')
config.set('Driver', 'type', 'iexplore-11-on-WIN10')
config_driver = ConfigDriver(config)
config_driver._create_remote_driver()
capabilities = DesiredCapabilities.INTERNETEXPLORER
capabilities['version'] = '11'
capabilities['platform'] = 'WIN10'
webdriver_mock.Remote.assert_called_once_with(command_executor='http://10.20.30.40:5555/wd/hub',
desired_capabilities=capabilities)
示例4: test_create_remote_driver_opera
# 需要导入模块: from toolium.config_driver import ConfigDriver [as 别名]
# 或者: from toolium.config_driver.ConfigDriver import _create_remote_driver [as 别名]
def test_create_remote_driver_opera(webdriver_mock, config):
config.set('Server', 'host', '10.20.30.40')
config.set('Server', 'port', '5555')
config.set('Driver', 'type', 'opera')
config_driver = ConfigDriver(config)
config_driver._create_remote_driver()
capabilities = DesiredCapabilities.OPERA
capabilities['opera.autostart'] = True
capabilities['opera.arguments'] = '-fullscreen'
webdriver_mock.Remote.assert_called_once_with(command_executor='http://10.20.30.40:5555/wd/hub',
desired_capabilities=capabilities)
示例5: test_create_remote_driver_capabilities
# 需要导入模块: from toolium.config_driver import ConfigDriver [as 别名]
# 或者: from toolium.config_driver.ConfigDriver import _create_remote_driver [as 别名]
def test_create_remote_driver_capabilities(webdriver_mock, config):
config.set('Server', 'host', '10.20.30.40')
config.set('Server', 'port', '5555')
config.set('Driver', 'type', 'iexplore-11')
config.add_section('Capabilities')
config.set('Capabilities', 'version', '11')
config_driver = ConfigDriver(config)
config_driver._create_remote_driver()
capabilities = DesiredCapabilities.INTERNETEXPLORER.copy()
capabilities['version'] = '11'
webdriver_mock.Remote.assert_called_once_with(command_executor='http://10.20.30.40:5555/wd/hub',
desired_capabilities=capabilities)
示例6: test_create_remote_driver_iphone
# 需要导入模块: from toolium.config_driver import ConfigDriver [as 别名]
# 或者: from toolium.config_driver.ConfigDriver import _create_remote_driver [as 别名]
def test_create_remote_driver_iphone(appiumdriver_mock, config):
config.set('Server', 'host', '10.20.30.40')
config.set('Server', 'port', '5555')
config.set('Driver', 'type', 'iphone')
config.add_section('AppiumCapabilities')
config.set('AppiumCapabilities', 'automationName', 'Appium')
config.set('AppiumCapabilities', 'platformName', 'iOS')
config_driver = ConfigDriver(config)
config_driver._create_remote_driver()
capabilities = {'automationName': 'Appium', 'platformName': 'iOS'}
appiumdriver_mock.Remote.assert_called_once_with(command_executor='http://10.20.30.40:5555/wd/hub',
desired_capabilities=capabilities)
示例7: test_create_remote_driver_chrome_old_selenium
# 需要导入模块: from toolium.config_driver import ConfigDriver [as 别名]
# 或者: from toolium.config_driver.ConfigDriver import _create_remote_driver [as 别名]
def test_create_remote_driver_chrome_old_selenium(webdriver_mock, config):
config.set('Server', 'host', '10.20.30.40')
config.set('Server', 'port', '5555')
config.set('Driver', 'type', 'chrome')
config_driver = ConfigDriver(config)
# Chrome options mock
chrome_options = mock.MagicMock()
chrome_options.to_capabilities.return_value = {'chromeOptions': 'chrome options'}
config_driver._create_chrome_options = mock.MagicMock(return_value=chrome_options)
config_driver._create_remote_driver()
capabilities = DesiredCapabilities.CHROME.copy()
capabilities['chromeOptions'] = 'chrome options'
webdriver_mock.Remote.assert_called_once_with(command_executor='http://10.20.30.40:5555/wd/hub',
desired_capabilities=capabilities)
示例8: test_create_local_driver_iphone
# 需要导入模块: from toolium.config_driver import ConfigDriver [as 别名]
# 或者: from toolium.config_driver.ConfigDriver import _create_remote_driver [as 别名]
def test_create_local_driver_iphone(config):
config.set('Driver', 'type', 'iphone')
config_driver = ConfigDriver(config)
config_driver._create_remote_driver = lambda: 'remote driver mock'
driver = config_driver._create_local_driver()
assert driver == 'remote driver mock'
示例9: test_create_remote_driver_firefox
# 需要导入模块: from toolium.config_driver import ConfigDriver [as 别名]
# 或者: from toolium.config_driver.ConfigDriver import _create_remote_driver [as 别名]
def test_create_remote_driver_firefox(webdriver_mock, config):
config.set('Server', 'host', '10.20.30.40')
config.set('Server', 'port', '5555')
config.set('Driver', 'type', 'firefox')
config_driver = ConfigDriver(config)
# Firefox profile mock
class ProfileMock(object):
encoded = 'encoded profile'
config_driver._create_firefox_profile = mock.MagicMock(return_value=ProfileMock())
config_driver._create_remote_driver()
capabilities = DesiredCapabilities.FIREFOX.copy()
capabilities['firefox_profile'] = 'encoded profile'
webdriver_mock.Remote.assert_called_once_with(command_executor='http://10.20.30.40:5555/wd/hub',
desired_capabilities=capabilities)
示例10: test_create_driver_local_not_configured
# 需要导入模块: from toolium.config_driver import ConfigDriver [as 别名]
# 或者: from toolium.config_driver.ConfigDriver import _create_remote_driver [as 别名]
def test_create_driver_local_not_configured(config):
config.set('Driver', 'type', 'firefox')
config_driver = ConfigDriver(config)
config_driver._create_local_driver = lambda: 'local driver mock'
config_driver._create_remote_driver = lambda: 'remote driver mock'
driver = config_driver.create_driver()
assert driver == 'local driver mock'
示例11: test_create_driver_remote
# 需要导入模块: from toolium.config_driver import ConfigDriver [as 别名]
# 或者: from toolium.config_driver.ConfigDriver import _create_remote_driver [as 别名]
def test_create_driver_remote(config):
config.set('Server', 'enabled', 'true')
config.set('Driver', 'type', 'firefox')
config_driver = ConfigDriver(config)
config_driver._create_local_driver = lambda: 'local driver mock'
config_driver._create_remote_driver = lambda: 'remote driver mock'
driver = config_driver.create_driver()
assert driver == 'remote driver mock'