Skip to content

Commit

Permalink
picture for screen shot rather than text
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-hammant committed Feb 17, 2011
1 parent 53aeb72 commit f6a545f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 28 deletions.
10 changes: 5 additions & 5 deletions web-selenium/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium</artifactId>
<version>2.0b1</version>
<artifactId>selenium-remote-control</artifactId>
<version>2.0b2</version>
</dependency>
<dependency>
<!--dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-android-client</artifactId>
<version>2.0b1</version>
<version>2.0b2</version>
<optional>true</optional>
</dependency>
</dependency-->
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import org.openqa.selenium.ScreenOrientation;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.android.AndroidDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
Expand All @@ -16,7 +15,7 @@
/**
* Provides WebDriver instances based on system property "browser":
* <ul>
* <li>"android": {@link AndroidDriver}</li>
* <li>"android": AndroidDriver</li>
* <li>"chrome": {@link ChromeDriver}</li>
* <li>"firefox": {@link FirefoxDriver}</li>
* <li>"htmlunit": {@link HtmlUnitDriver}</li>
Expand Down Expand Up @@ -48,7 +47,7 @@ public void initialize() {
private WebDriver createDriver(Browser browser) {
switch (browser) {
case ANDROID:
return createAndroidDriver();
return null; // createAndroidDriver();
case CHROME:
return createChromeDriver();
case FIREFOX:
Expand All @@ -61,18 +60,18 @@ private WebDriver createDriver(Browser browser) {
}
}

protected WebDriver createAndroidDriver() {
try {
String url = System.getProperty("webdriver.android.url", "http://localhost:8080/hub");
ScreenOrientation screenOrientation = ScreenOrientation.valueOf(System.getProperty(
"webdriver.android.screenOrientation", "portrait").toUpperCase(usingLocale()));
AndroidDriver driver = new AndroidDriver(url);
driver.rotate(screenOrientation);
return driver;
} catch (MalformedURLException e) {
throw new UnsupportedOperationException(e);
}
}
// protected WebDriver createAndroidDriver() {
// try {
// String url = System.getProperty("webdriver.android.url", "http://localhost:8080/hub");
// ScreenOrientation screenOrientation = ScreenOrientation.valueOf(System.getProperty(
// "webdriver.android.screenOrientation", "portrait").toUpperCase(usingLocale()));
// AndroidDriver driver = new AndroidDriver(url);
// driver.rotate(screenOrientation);
// return driver;
// } catch (MalformedURLException e) {
// throw new UnsupportedOperationException(e);
// }
// }

protected ChromeDriver createChromeDriver() {
return new ChromeDriver();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public WebDriverHtmlOutput(PrintStream output, Properties outputPatterns, Keywor
private void changeALine() {
super.overwritePattern("failed",
"<div class=\"step failed\">{0} <span class=\"keyword failed\">({1})</span><br/><span class=\"message failed\">{2}</span>" +
"<br/><a color=\"black\" href=\"../screenshots/failed-scenario-{3}.png\">[screen shot]</a></div>\n");
"<br/><a color=\"black\" href=\"../screenshots/failed-scenario-{3}.png\"><img src=\"images/failing_screenshot.png\" alt=\"failing screenshot\"/></a></div>\n");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import org.junit.After;
import org.junit.Ignore;
import org.junit.Test;
import org.openqa.selenium.android.AndroidDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
Expand Down Expand Up @@ -45,12 +44,12 @@ public void shouldSupportHtmlUnitByProperty() {
assertThat(driver.isJavascriptEnabled(), is(true));
}

@Test
@Ignore("Only when Android is available")
public void shouldSupportAndroidByProperty() {
createProviderForProperty("android");
assertThat(provider.get(), instanceOf(AndroidDriver.class));
}
// @Test
// @Ignore("Only when Android is available")
// public void shouldSupportAndroidByProperty() {
// createProviderForProperty("android");
// assertThat(provider.get(), instanceOf(AndroidDriver.class));
// }

@Test
@Ignore("Only when Chrome is available")
Expand Down

0 comments on commit f6a545f

Please sign in to comment.