本文整理汇总了Python中toolium.config_driver.ConfigDriver类的典型用法代码示例。如果您正苦于以下问题:Python ConfigDriver类的具体用法?Python ConfigDriver怎么用?Python ConfigDriver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ConfigDriver类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_create_local_driver_edge
def test_create_local_driver_edge(webdriver_mock, config):
config.set('Driver', 'type', 'edge')
config.set('Driver', 'edge_driver_path', '/tmp/driver')
config_driver = ConfigDriver(config)
config_driver._create_local_driver()
webdriver_mock.Edge.assert_called_once_with('/tmp/driver', capabilities=DesiredCapabilities.EDGE)
开发者ID:jframos,项目名称:toolium,代码行数:7,代码来源:test_config_driver.py
示例2: test_create_local_driver_iphone
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'
开发者ID:jframos,项目名称:toolium,代码行数:7,代码来源:test_config_driver.py
示例3: test_create_local_driver_unknown_driver
def test_create_local_driver_unknown_driver(config):
config.set('Driver', 'type', 'unknown')
config_driver = ConfigDriver(config)
with pytest.raises(Exception) as excinfo:
config_driver._create_local_driver()
assert 'Unknown driver unknown' == str(excinfo.value)
开发者ID:jframos,项目名称:toolium,代码行数:7,代码来源:test_config_driver.py
示例4: test_create_local_driver_iexplore
def test_create_local_driver_iexplore(webdriver_mock, config):
config.set('Driver', 'type', 'iexplore')
config.set('Driver', 'explorer_driver_path', '/tmp/driver')
config_driver = ConfigDriver(config)
config_driver._create_local_driver()
webdriver_mock.Ie.assert_called_once_with('/tmp/driver', capabilities=DesiredCapabilities.INTERNETEXPLORER)
开发者ID:jframos,项目名称:toolium,代码行数:7,代码来源:test_config_driver.py
示例5: test_add_firefox_arguments
def test_add_firefox_arguments(config):
config.add_section('FirefoxArguments')
config.set('FirefoxArguments', '-private', '')
config_driver = ConfigDriver(config)
firefox_options = Options()
config_driver._add_firefox_arguments(firefox_options)
assert firefox_options.arguments == ['-private']
开发者ID:jframos,项目名称:toolium,代码行数:8,代码来源:test_config_driver.py
示例6: test_create_local_driver_phantomjs
def test_create_local_driver_phantomjs(webdriver_mock, config):
config.set('Driver', 'type', 'phantomjs')
config.set('Driver', 'phantomjs_driver_path', '/tmp/driver')
config_driver = ConfigDriver(config)
config_driver._create_local_driver()
webdriver_mock.PhantomJS.assert_called_once_with(desired_capabilities=DesiredCapabilities.PHANTOMJS,
executable_path='/tmp/driver')
开发者ID:jframos,项目名称:toolium,代码行数:8,代码来源:test_config_driver.py
示例7: test_create_local_driver_opera
def test_create_local_driver_opera(webdriver_mock, config):
config.set('Driver', 'type', 'opera')
config.set('Driver', 'opera_driver_path', '/tmp/driver')
config_driver = ConfigDriver(config)
config_driver._create_local_driver()
webdriver_mock.Opera.assert_called_once_with(desired_capabilities=DesiredCapabilities.OPERA,
executable_path='/tmp/driver')
开发者ID:jframos,项目名称:toolium,代码行数:8,代码来源:test_config_driver.py
示例8: test_create_local_driver_chrome
def test_create_local_driver_chrome(webdriver_mock, config):
config.set('Driver', 'type', 'chrome')
config.set('Driver', 'chrome_driver_path', '/tmp/driver')
config_driver = ConfigDriver(config)
config_driver._create_chrome_options = lambda: 'chrome options'
config_driver._create_local_driver()
webdriver_mock.Chrome.assert_called_once_with('/tmp/driver', desired_capabilities=DesiredCapabilities.CHROME,
chrome_options='chrome options')
开发者ID:jframos,项目名称:toolium,代码行数:9,代码来源:test_config_driver.py
示例9: test_create_local_driver_firefox
def test_create_local_driver_firefox(webdriver_mock, config):
config.set('Driver', 'type', 'firefox')
config_driver = ConfigDriver(config)
config_driver._create_firefox_profile = lambda: 'firefox profile'
config_driver._create_local_driver()
webdriver_mock.Firefox.assert_called_once_with(capabilities=DesiredCapabilities.FIREFOX,
firefox_profile='firefox profile', executable_path=None,
firefox_options=None)
开发者ID:Telefonica,项目名称:toolium,代码行数:9,代码来源:test_config_driver.py
示例10: test_create_driver_local_not_configured
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'
开发者ID:jframos,项目名称:toolium,代码行数:9,代码来源:test_config_driver.py
示例11: test_create_remote_driver_phantomjs
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)
开发者ID:jframos,项目名称:toolium,代码行数:9,代码来源:test_config_driver.py
示例12: test_create_remote_driver_iexplore
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)
开发者ID:jframos,项目名称:toolium,代码行数:9,代码来源:test_config_driver.py
示例13: test_create_driver_remote
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'
开发者ID:jframos,项目名称:toolium,代码行数:10,代码来源:test_config_driver.py
示例14: test_create_chrome_options_headless
def test_create_chrome_options_headless(webdriver_mock, config):
config.set('Driver', 'headless', 'true')
config_driver = ConfigDriver(config)
config_driver._create_chrome_options()
webdriver_mock.ChromeOptions.assert_called_once_with()
if os.name == 'nt':
webdriver_mock.ChromeOptions().add_argument.assert_has_calls([mock.call('--headless'),
mock.call('--disable-gpu')])
else:
webdriver_mock.ChromeOptions().add_argument.assert_called_once_with('--headless')
开发者ID:jframos,项目名称:toolium,代码行数:11,代码来源:test_config_driver.py
示例15: test_create_remote_driver_opera
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)
开发者ID:jframos,项目名称:toolium,代码行数:12,代码来源:test_config_driver.py
示例16: test_create_remote_driver_version_platform
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)
开发者ID:jframos,项目名称:toolium,代码行数:12,代码来源:test_config_driver.py
示例17: test_create_local_driver_capabilities
def test_create_local_driver_capabilities(webdriver_mock, config):
config.set('Driver', 'type', 'firefox')
config.add_section('Capabilities')
config.set('Capabilities', 'version', '45')
config_driver = ConfigDriver(config)
config_driver._create_firefox_profile = lambda: 'firefox profile'
config_driver._create_local_driver()
capabilities = DesiredCapabilities.FIREFOX.copy()
capabilities['version'] = '45'
webdriver_mock.Firefox.assert_called_once_with(capabilities=capabilities,
firefox_profile='firefox profile', executable_path=None,
firefox_options=None)
开发者ID:Telefonica,项目名称:toolium,代码行数:13,代码来源:test_config_driver.py
示例18: test_create_remote_driver_capabilities
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)
开发者ID:jframos,项目名称:toolium,代码行数:13,代码来源:test_config_driver.py
示例19: test_create_remote_driver_iphone
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)
开发者ID:jframos,项目名称:toolium,代码行数:13,代码来源:test_config_driver.py
示例20: test_create_local_driver_firefox
def test_create_local_driver_firefox(webdriver_mock, options, config):
config.set('Driver', 'type', 'firefox')
config.add_section('Capabilities')
config.set('Capabilities', 'marionette', 'false')
config_driver = ConfigDriver(config)
config_driver._create_firefox_profile = lambda: 'firefox profile'
DriverWrappersPool.output_directory = ''
config_driver._create_local_driver()
expected_capabilities = DesiredCapabilities.FIREFOX.copy()
expected_capabilities['marionette'] = False
webdriver_mock.Firefox.assert_called_once_with(capabilities=expected_capabilities,
firefox_profile='firefox profile', executable_path=None,
firefox_options=options(), log_path='geckodriver.log')
开发者ID:jframos,项目名称:toolium,代码行数:14,代码来源:test_config_driver.py
注:本文中的toolium.config_driver.ConfigDriver类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论