-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Guillaume Boucherie <[email protected]>
- Loading branch information
Guillaume Boucherie
committed
May 31, 2013
1 parent
6a82848
commit 0ab70cf
Showing
3 changed files
with
138 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/.project | ||
/.settings | ||
/target | ||
/.classpath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>fr.mediametrie.meo.tests</groupId> | ||
<artifactId>saucelabs-test</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<name>saucelabs-test</name> | ||
<dependencies> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.11</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.saucelabs</groupId> | ||
<artifactId>sauce_junit</artifactId> | ||
<version>1.0.19</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.saucelabs.selenium</groupId> | ||
<artifactId>selenium-client-factory</artifactId> | ||
<version>2.8</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.saucelabs.selenium</groupId> | ||
<artifactId>sauce-ondemand-driver</artifactId> | ||
<version>2.8</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.saucelabs.selenium</groupId> | ||
<artifactId>selenium-embedded-rc-driver</artifactId> | ||
<version>2.8</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.seleniumhq.selenium</groupId> | ||
<artifactId>selenium-java</artifactId> | ||
<version>2.32.0</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.seleniumhq.selenium</groupId> | ||
<artifactId>selenium-server</artifactId> | ||
<version>2.32.0</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.0</version> | ||
<configuration> | ||
<source>1.6</source> | ||
<target>1.6</target> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>2.12.4</version> | ||
<configuration> | ||
<redirectTestOutputToFile>true</redirectTestOutputToFile> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<repositories> | ||
<repository> | ||
<id>saucelabs-repository</id> | ||
<url>http://repository-saucelabs.forge.cloudbees.com/release</url> | ||
<releases> | ||
<enabled>true</enabled> | ||
</releases> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
</snapshots> | ||
</repository> | ||
</repositories> | ||
|
||
</project> |
48 changes: 48 additions & 0 deletions
48
src/test/java/fr/mediametrie/meo/saucelabs_test2/SeleniumClientFactoryOnDemandTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package fr.mediametrie.meo.saucelabs_test2; | ||
|
||
import org.junit.After; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.openqa.selenium.By; | ||
import org.openqa.selenium.WebDriver; | ||
import org.openqa.selenium.remote.DesiredCapabilities; | ||
import org.openqa.selenium.remote.RemoteWebDriver; | ||
import org.openqa.selenium.support.ui.Select; | ||
|
||
import com.saucelabs.selenium.client.factory.SeleniumFactory; | ||
|
||
public class SeleniumClientFactoryOnDemandTest { | ||
|
||
private WebDriver driver; | ||
|
||
@Before | ||
public void setUp() throws Exception { | ||
// System.setProperty("SELENIUM_STARTING_URL", "http://dvsaap03.mediametrie.fr:8122/ihm-deploiement"); | ||
driver = SeleniumFactory.createWebDriver(); | ||
DesiredCapabilities capabilities = (DesiredCapabilities)((RemoteWebDriver) driver).getCapabilities(); | ||
capabilities.setCapability("prerun", "http://get.videolan.org/vlc/2.0.6/win32/vlc-2.0.6-win32.exe"); | ||
} | ||
|
||
@After | ||
public void tearDown() throws Exception { | ||
driver.close(); | ||
driver.quit(); | ||
} | ||
|
||
@Test | ||
public void webDriver() throws Exception { | ||
driver.get("http://dvsaap03.mediametrie.fr:8122/ihm-deploiement/app/home.jsf"); | ||
driver.findElement(By.id("home:login")).click(); | ||
driver.findElement(By.id("j_username")).click(); | ||
driver.findElement(By.id("j_username")).clear(); | ||
driver.findElement(By.id("j_username")).sendKeys("admin"); | ||
driver.findElement(By.id("j_password")).click(); | ||
driver.findElement(By.id("j_password")).clear(); | ||
driver.findElement(By.id("j_password")).sendKeys("admin"); | ||
driver.findElement(By.id("j_idt21")).click(); | ||
driver.findElement(By.linkText("Déployer")).click(); | ||
Select select = new Select(driver.findElement(By.name("hometab:deployform:toselect:0:j_idt191"))); | ||
select.selectByValue("0.0.0"); | ||
} | ||
|
||
} |