本文整理汇总了Java中org.openqa.selenium.opera.OperaOptions类的典型用法代码示例。如果您正苦于以下问题:Java OperaOptions类的具体用法?Java OperaOptions怎么用?Java OperaOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OperaOptions类属于org.openqa.selenium.opera包,在下文中一共展示了OperaOptions类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: settingBrowserSize
import org.openqa.selenium.opera.OperaOptions; //导入依赖的package包/类
@Test
public void settingBrowserSize() {
// given
WebDriverProperties properties = new WebDriverProperties();
properties.setProperty("browserSize", "1690x1000");
// when
Capabilities convertedCapabilities = operaCapabilitiesConverter.convert(properties);
// then
// expected safari options
OperaOptions expectedOperaOptions = new OperaOptions();
expectedOperaOptions.setCapability(CAPABILITY_AUTOCLOSE, false);
expectedOperaOptions.setCapability(CAPABILITY_BROWSER_SIZE, "1690x1000");
assertThat(convertedCapabilities.asMap()).isEqualTo(expectedOperaOptions.asMap());
}
开发者ID:isgarlo,项目名称:givemeadriver,代码行数:19,代码来源:OperaCapabilitiesConverterTest.java
示例2: resolve
import org.openqa.selenium.opera.OperaOptions; //导入依赖的package包/类
@Override
public void resolve() {
try {
Optional<Object> testInstance = context.getTestInstance();
Optional<Capabilities> capabilities = annotationsReader
.getCapabilities(parameter, testInstance);
OperaOptions operaOptions = (OperaOptions) getOptions(parameter,
testInstance);
if (capabilities.isPresent()) {
operaOptions.merge(capabilities.get());
}
object = new OperaDriver(operaOptions);
} catch (Exception e) {
handleException(e);
}
}
开发者ID:bonigarcia,项目名称:selenium-jupiter,代码行数:17,代码来源:OperaDriverHandler.java
示例3: setupTest
import org.openqa.selenium.opera.OperaOptions; //导入依赖的package包/类
@Before
public void setupTest() {
File operaBinary = IS_OS_WINDOWS
? new File("C:\\Program Files\\Opera\\launcher.exe")
: new File("/usr/bin/opera");
assumeTrue(operaBinary.exists());
OperaOptions options = new OperaOptions();
options.setBinary(operaBinary);
driver = new OperaDriver(options);
}
开发者ID:bonigarcia,项目名称:webdrivermanager,代码行数:12,代码来源:OperaTest.java
示例4: convert
import org.openqa.selenium.opera.OperaOptions; //导入依赖的package包/类
@Override
public Capabilities convert(WebDriverProperties properties) {
OperaOptions operaOptions = new OperaOptions();
// general options for logging purpose
operaOptions.setCapability(CAPABILITY_AUTOCLOSE, properties.isAutoClose());
addToOperaOptionsIfNoEmptyValue(operaOptions, CAPABILITY_DRIVER_VERSION, properties.getDriverVersion());
addToOperaOptionsIfNoEmptyValue(operaOptions, CAPABILITY_BROWSER_SIZE, properties.getBrowserSize());
return operaOptions;
}
开发者ID:isgarlo,项目名称:givemeadriver,代码行数:12,代码来源:OperaCapabilitiesConverter.java
示例5: getCapabilities
import org.openqa.selenium.opera.OperaOptions; //导入依赖的package包/类
private DesiredCapabilities getCapabilities(BrowserType browser,
boolean enableVnc) throws IllegalAccessException, IOException {
DesiredCapabilities capabilities = browser.getCapabilities();
if (enableVnc) {
capabilities.setCapability("enableVNC", true);
capabilities.setCapability("screenResolution",
getString("sel.jup.vnc.screen.resolution"));
}
if (recording) {
capabilities.setCapability("enableVideo", true);
capabilities.setCapability("videoScreenSize",
getString("sel.jup.recording.video.screen.size"));
capabilities.setCapability("videoFrameRate",
getInt("sel.jup.recording.video.frame.rate"));
}
Optional<Capabilities> optionalCapabilities = annotationsReader
.getCapabilities(parameter, testInstance);
MutableCapabilities options = browser.getDriverHandler()
.getOptions(parameter, testInstance);
// Due to bug in operablink the binary path must be set
if (browser == OPERA) {
((OperaOptions) options).setBinary("/usr/bin/opera");
}
if (optionalCapabilities.isPresent()) {
options.merge(optionalCapabilities.get());
}
capabilities.setCapability(browser.getOptionsKey(), options);
log.trace("Using capabilities for Docker browser {}", capabilities);
return capabilities;
}
开发者ID:bonigarcia,项目名称:selenium-jupiter,代码行数:35,代码来源:DockerDriverHandler.java
示例6: testOperaOptions
import org.openqa.selenium.opera.OperaOptions; //导入依赖的package包/类
@Test
void testOperaOptions() throws Exception {
Parameter parameter = OperaWithOptionsJupiterTest.class
.getMethod("operaTest", OperaDriver.class).getParameters()[0];
OperaOptions operaOptions = (OperaOptions) annotationsReader
.getOptions(parameter, empty());
assertThat(operaOptions.asMap().get("operaOptions").toString(),
containsString("binary"));
}
开发者ID:bonigarcia,项目名称:selenium-jupiter,代码行数:11,代码来源:OperaAnnotationReaderTest.java
示例7: setupOperaDriver
import org.openqa.selenium.opera.OperaOptions; //导入依赖的package包/类
protected void setupOperaDriver() {
DesiredCapabilities capabilities = DesiredCapabilities.operaBlink();
OperaOptions options = new OperaOptions();
options.setBinary(new File("/usr/bin/opera"));
capabilities.setCapability(OperaOptions.CAPABILITY, options);
setDriver(new OperaDriver(capabilities));
getDriver().manage().window().setSize(
new Dimension(1366, 768));
}
开发者ID:datenhahn,项目名称:componentrenderer,代码行数:11,代码来源:AbstractTestBase.java
示例8: addToOperaOptionsIfNoEmptyValue
import org.openqa.selenium.opera.OperaOptions; //导入依赖的package包/类
private void addToOperaOptionsIfNoEmptyValue(OperaOptions operaOptions, String key, String value) {
if (isNotEmpty(value)) {
operaOptions.setCapability(key, value);
}
}
开发者ID:isgarlo,项目名称:givemeadriver,代码行数:6,代码来源:OperaCapabilitiesConverter.java
示例9: createDriver
import org.openqa.selenium.opera.OperaOptions; //导入依赖的package包/类
@Override
public WebDriver createDriver(Capabilities capabilities) {
String driverVersion = (String) capabilities.getCapability(CAPABILITY_DRIVER_VERSION);
OperaDriverManager.getInstance().version(driverVersion).setup();
return new OperaDriver((OperaOptions) capabilities);
}
开发者ID:isgarlo,项目名称:givemeadriver,代码行数:7,代码来源:OperaDriverFactory.java
示例10: OperaDriver
import org.openqa.selenium.opera.OperaOptions; //导入依赖的package包/类
/**
* Creates a new OperaDriver instance with the specified options.
*
* @param options The options to use.
* @see #OperaDriver(OperaDriverService, OperaOptions)
*/
public OperaDriver(OperaOptions options) {
super(new org.openqa.selenium.opera.OperaDriver(options));
}
开发者ID:KarlGong,项目名称:easyium-java,代码行数:10,代码来源:OperaDriver.java
注:本文中的org.openqa.selenium.opera.OperaOptions类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论