org.openqa.selenium.Platform#is ( )源码实例Demo

下面列出了org.openqa.selenium.Platform#is ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: selenium-api   文件: PlatformMatcher.java
@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 项目: selenium   文件: CommandLine.java
/**
 * @return The platform specific env property name which contains the library path.
 */
public static String getLibraryPathPropertyName() {
  Platform current = Platform.getCurrent();

  if (current.is(WINDOWS)) {
    return "PATH";

  } else if (current.is(MAC)) {
    return "DYLD_LIBRARY_PATH";

  } else {
    return "LD_LIBRARY_PATH";
  }
}
 
源代码3 项目: selenium   文件: InternetExplorerDriver.java
protected void assertOnWindows() {
  Platform current = Platform.getCurrent();
  if (!current.is(Platform.WINDOWS)) {
    throw new WebDriverException(
        String.format(
            "You appear to be running %s. The IE driver only runs on Windows.", current));
  }
}
 
源代码4 项目: selenium   文件: CapabilitiesComparator.java
@Override
public int score(Platform value) {
  if (!currentIsDesired || isNullOrAny(value)) {
    return 0;
  }

  return scoreAgainst.is(value) || value.is(scoreAgainst) ? 1 : -1;
}
 
源代码5 项目: selenium   文件: CapabilitiesComparator.java
@Override
public int score(Platform value) {
  if (isNullOrAny(value)) {
    return 0;
  }

  return value.is(scoreAgainst) || scoreAgainst.is(value) ? 1 : -1;
}
 
源代码6 项目: selenium   文件: CapabilitiesComparator.java
private CurrentPlatformScorer(Platform currentPlatform, Platform desiredPlatform) {
  super(currentPlatform);
  currentIsDesired = !isNullOrAny(currentPlatform)
      && (currentPlatform.is(desiredPlatform) || desiredPlatform.is(currentPlatform));
}
 
源代码7 项目: selenium   文件: DefaultDriverFactory.java
private boolean platformMatches(Platform current, Capabilities caps) {
  return caps.getPlatform() == null
         || caps.getPlatform() == ANY
         || current.is(caps.getPlatform());
}