本文整理匯總了Java中org.openqa.selenium.Platform.VISTA屬性的典型用法代碼示例。如果您正苦於以下問題:Java Platform.VISTA屬性的具體用法?Java Platform.VISTA怎麽用?Java Platform.VISTA使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.openqa.selenium.Platform
的用法示例。
在下文中一共展示了Platform.VISTA屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: external
@DataProvider
public Object[][] external() {
return new Object[][]{
{"win7", Platform.VISTA},
{"vista", Platform.VISTA},
{"Vista", Platform.VISTA},
{"win8_1", Platform.WIN8_1},
{"XP", Platform.XP},
{"Win7", Platform.VISTA},
{"win7", Platform.VISTA},
{"Windows Server 2012", Platform.WIN8},
{"windows 8", Platform.WIN8},
{"win8", Platform.WIN8},
{"windows 8.1", Platform.WIN8_1},
{"win8.1", Platform.WIN8_1},
{null, null},
{"w8", null},
{Platform.ANDROID, Platform.ANDROID}
};
}
示例2: 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));
}
示例3: 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},
};
}
示例4: nonMatchParam
@CapabilityFilter(platform = Platform.VISTA)
@Test
public void nonMatchParam() throws Exception {
assertAllAssumed();
}
示例5: createChromeBrowser
private void createChromeBrowser(DesiredCapabilities capabilities) throws MalformedURLException {
if (scope == BrowserScope.LOCAL) {
// Management of chromedriver
ChromeDriverManager.getInstance().setup();
}
// Chrome options
ChromeOptions options = new ChromeOptions();
// Chrome extensions
if (extensions != null && !extensions.isEmpty()) {
for (Map<String, String> extension : extensions) {
InputStream is = getExtensionAsInputStream(extension.values().iterator().next());
if (is != null) {
try {
File crx = File.createTempFile(extension.keySet().iterator().next(), ".crx");
FileUtils.copyInputStreamToFile(is, crx);
options.addExtensions(crx);
} catch (Throwable t) {
log.error("Error loading Chrome extension {} ({} : {})", extension, t.getClass(),
t.getMessage());
}
}
}
}
if (enableScreenCapture) {
// This flag enables the screen sharing
options.addArguments("--enable-usermedia-screen-capturing");
String windowTitle = TEST_SCREEN_SHARE_TITLE_DEFAULT;
if (platform != null
&& (platform == Platform.WINDOWS || platform == Platform.XP || platform == Platform.VISTA
|| platform == Platform.WIN8 || platform == Platform.WIN8_1)) {
windowTitle = TEST_SCREEN_SHARE_TITLE_DEFAULT_WIN;
}
options.addArguments("--auto-select-desktop-capture-source="
+ getProperty(TEST_SCREEN_SHARE_TITLE_PROPERTY, windowTitle));
} else {
// This flag avoids grant the camera
options.addArguments("--use-fake-ui-for-media-stream");
}
// This flag avoids warning in Chrome. See:
// https://code.google.com/p/chromedriver/issues/detail?id=799
options.addArguments("--test-type");
if (protocol == Protocol.FILE) {
// This flag allows reading local files in video tags
options.addArguments("--allow-file-access-from-files");
}
if (!usePhysicalCam) {
// This flag makes using a synthetic video (green with
// spinner) in WebRTC. Or it is needed to combine with
// use-file-for-fake-video-capture to use a file faking the
// cam
options.addArguments("--use-fake-device-for-media-stream=fps=30");
if (video != null && (isLocal() || isDocker())) {
if (!Files.exists(Paths.get(video))) {
throw new RuntimeException("Trying to create a browser using video file " + video
+ ", but this file doesn't exist.");
}
log.debug("Using video {} in browser {}", video, id);
options.addArguments("--use-file-for-fake-video-capture=" + video);
}
}
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
capabilities.setBrowserName(DesiredCapabilities.chrome().getBrowserName());
createDriver(capabilities, options);
}