本文整理匯總了Java中org.openqa.selenium.Platform.ANY屬性的典型用法代碼示例。如果您正苦於以下問題:Java Platform.ANY屬性的具體用法?Java Platform.ANY怎麽用?Java Platform.ANY使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.openqa.selenium.Platform
的用法示例。
在下文中一共展示了Platform.ANY屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testEquals_OS
@Test
public void testEquals_OS() {
TestEnvironment left = new TestEnvironment(null, null, Platform.WINDOWS);
TestEnvironment right = new TestEnvironment(null, null, Platform.WINDOWS);
assertTrue(left.matches(right));
right = new TestEnvironment(null, null, Platform.LINUX);
assertFalse(left.matches(right));
right = new TestEnvironment(null, null, Platform.XP);
assertTrue(left.matches(right));
right = new TestEnvironment(null, null, Platform.VISTA);
assertTrue(left.matches(right));
right = new TestEnvironment(null, null, Platform.ANY);
assertTrue(left.matches(right));
}
示例2: createDriver
@BeforeClass public void createDriver() {
JavaProfile profile = new JavaProfile(LaunchMode.JAVA_COMMAND_LINE);
File f = findFile();
profile.addClassPath(f);
profile.setMainClass("com.sun.swingset3.SwingSet3");
DesiredCapabilities caps = new DesiredCapabilities("java", "1.5", Platform.ANY);
driver = new JavaDriver(profile, caps, caps);
}
示例3: createDriver
@BeforeClass public void createDriver() {
JavaProfile profile = new JavaProfile(LaunchMode.COMMAND_LINE);
File f = findFile();
profile.setCommand(f.getAbsolutePath());
profile.addApplicationArguments("Argument1");
DesiredCapabilities caps = new DesiredCapabilities("java", "1.5", Platform.ANY);
driver = new JavaDriver(profile, caps, caps);
}
示例4: createDriver
@BeforeMethod public void createDriver() {
System.setProperty(Constants.PROP_PROJECT_FRAMEWORK, Constants.FRAMEWORK_SWING);
JavaProfile profile = new JavaProfile(LaunchMode.JAVA_COMMAND_LINE);
File f = findFile();
profile.addClassPath(f);
profile.setRecordingPort(startRecordingServer());
profile.setMainClass("com.sun.swingset3.SwingSet3");
DesiredCapabilities caps = new DesiredCapabilities("java", "1.5", Platform.ANY);
driver = new JavaDriver(profile, caps, caps);
}
示例5: createDriver
@BeforeClass public void createDriver() {
System.setProperty(Constants.PROP_PROJECT_FRAMEWORK, Constants.FRAMEWORK_SWING);
JavaProfile profile = new JavaProfile(LaunchMode.COMMAND_LINE);
File f = findFile();
profile.setCommand(f.getAbsolutePath());
profile.setRecordingPort(startRecordingServer());
DesiredCapabilities caps = new DesiredCapabilities("java", "1.5", Platform.ANY);
driver = new JavaDriver(profile, caps, caps);
}
示例6: getTestCaseRunManager
static Queue<RunContext> getTestCaseRunManager() {
Queue<RunContext> execQ = new LinkedList<>();
RunContext exe = new RunContext();
exe.Scenario = globalSettings.getScenario();
exe.TestCase = globalSettings.getTestCase();
exe.Description = "Test Run";
exe.BrowserName = globalSettings.getBrowser();
exe.Browser = Browser.fromString(exe.BrowserName);
exe.Platform = Platform.ANY;
exe.BrowserVersion = "default";
exe.Iteration = "Single";
exe.print();
execQ.add(exe);
return execQ;
}
示例7: createBrowser
@Override
public Browser createBrowser() {
String browserName = configuration.getRemoteBrowserName();
String browserVersion = configuration.getRemoteBrowserVersion();
DesiredCapabilities capabilities = new DesiredCapabilities(browserName, browserVersion, Platform.ANY);
capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
capabilities.setCapability(CapabilityType.HAS_NATIVE_EVENTS, false);
capabilities.setCapability("marionette", configuration.getRemoteFirefoxMarionette());
setOptionalProxyConfiguration(capabilities);
return createBrowser(capabilities);
}
示例8: registerDefaults
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());
}
}
}
示例9: registerDriverProviders
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());
}
}
}
示例10: toPlatformFamily
/**
* {@link Platform#family()}から辿れるPlatformの親一覧を取得します。
*
* @param platform 対象のPlatform
* @return 引數のPlatformと、引數のPlatformの親Platform一覧
*/
private static Collection<Platform> toPlatformFamily(Platform platform) {
Set<Platform> platforms = EnumSet.noneOf(Platform.class);
if (platform == null) {
return platforms;
}
platforms.add(platform);
Platform parent = platform;
while ((parent = parent.family()) != Platform.ANY) {
platforms.add(parent);
}
return platforms;
}
示例11: getPlatform
private static Platform getPlatform(TestSlot slot) {
Object o = slot.getCapabilities().get(CapabilityType.PLATFORM);
if (o == null) {
return Platform.ANY;
} else {
if (o instanceof String) {
return Platform.valueOf((String) o);
} else if (o instanceof Platform) {
return (Platform) o;
} else {
throw new GridException("Cannot cast " + o + " to org.openqa.selenium.Platform");
}
}
}
示例12: getDriverFactory
@Override
public DriverFactory getDriverFactory() {
String gridUrl = getProperty(SELENIUM_GRID_URL);
String browser = getProperty(SELENIUM_BROWSER);
DesiredCapabilities desiredCapabilities = new DesiredCapabilities(browser, "", Platform.ANY);
return new RemoteDriverFactory<>(RemoteWebDriver::new, gridUrl, desiredCapabilities);
}
示例13: platforms
@DataProvider
public Object[][] platforms() {
return new Object[][]{
{"win7", Platform.VISTA, true},
{"win7", "windows 7", true},
{"vista", Platform.VISTA, true},
{"darwin", Platform.MAC, true},
{Platform.ANY, Platform.LINUX, true},
{"linux", Platform.LINUX, true},
{"linux", Platform.UNIX, false},
{null, Platform.XP, true},
};
}
示例14: getPlatform
static Platform getPlatform(String platform) {
if (platform != null && !platform.trim().isEmpty()) {
return Platform.fromString(platform.toUpperCase());
}
return Platform.ANY;
}
示例15: RemoteDriverConfig
/**
* Constructor.
*/
public RemoteDriverConfig() {
super();
this.version = "";
this.platform = Platform.ANY;
}