本文整理汇总了Java中org.openqa.selenium.Platform.is方法的典型用法代码示例。如果您正苦于以下问题:Java Platform.is方法的具体用法?Java Platform.is怎么用?Java Platform.is使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openqa.selenium.Platform
的用法示例。
在下文中一共展示了Platform.is方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: matches
import org.openqa.selenium.Platform; //导入方法依赖的package包/类
@Override
public boolean matches(Object requested, Object provided) {
Platform requestedPlatform = extractPlatform(requested);
if (requestedPlatform != null) {
Platform node = extractPlatform(provided);
if (node == null) {
return false;
}
if (!node.is(requestedPlatform)) {
return false;
}
} else {
LOGGER.warning(String.format("Unable to extract requested platform from '%s'.",requested));
}
return true;
}
示例2: score
import org.openqa.selenium.Platform; //导入方法依赖的package包/类
@Override
public int score(Platform value) {
if (!currentIsDesired || isNullOrAny(value)) {
return 0;
}
return scoreAgainst.is(value) || value.is(scoreAgainst) ? 1 : -1;
}
示例3: registerDefaults
import org.openqa.selenium.Platform; //导入方法依赖的package包/类
private void registerDefaults(Platform current) {
for (Map.Entry<Capabilities, String> entry : defaultDrivers.entrySet()) {
Capabilities caps = entry.getKey();
if (caps.getPlatform() == null || caps.getPlatform() == Platform.ANY || current.is(caps.getPlatform())) {
registerDriver(caps, entry.getValue());
} else {
log.info("Default driver " + entry.getValue() + " registration is skipped: registration capabilities "
+ caps.toString() + " does not match with current platform: " + current.toString());
}
}
}
示例4: registerDriverProviders
import org.openqa.selenium.Platform; //导入方法依赖的package包/类
private void registerDriverProviders(Platform current) {
for (DriverProvider provider : ServiceLoader.load(DriverProvider.class)) {
Capabilities caps = provider.getProvidedCapabilities();
if (caps.getPlatform() == null || caps.getPlatform() == Platform.ANY || current.is(caps.getPlatform())) {
factory.registerDriverProvider(caps, provider);
} else {
log.info("Driver provider " + provider + " registration is skipped: registration capabilities "
+ caps.toString() + " does not match with current platform: " + current.toString());
}
}
}
示例5: CurrentPlatformScorer
import org.openqa.selenium.Platform; //导入方法依赖的package包/类
private CurrentPlatformScorer(Platform currentPlatform, Platform desiredPlatform) {
super(currentPlatform);
currentIsDesired = !isNullOrAny(currentPlatform)
&& (currentPlatform.is(desiredPlatform) || desiredPlatform.is(currentPlatform));
}