本文整理匯總了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));
}