forked from swisspost/gateleen
-
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.
swisspost#162: Added most simple Selenium Test with Chrome (do not ex…
…pect successful build)
- Loading branch information
roggerj
committed
Sep 5, 2017
1 parent
2954a10
commit d8d1b69
Showing
6 changed files
with
96 additions
and
41 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
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
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
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
55 changes: 55 additions & 0 deletions
55
gateleen-test/src/test/java/org/swisspush/gateleen/hookjs/HookJsUITest.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,55 @@ | ||
/* | ||
* ------------------------------------------------------------------------------------------------ | ||
* Copyright 2014 by Swiss Post, Information Technology Services | ||
* ------------------------------------------------------------------------------------------------ | ||
* $Id$ | ||
* ------------------------------------------------------------------------------------------------ | ||
*/ | ||
|
||
package org.swisspush.gateleen.hookjs; | ||
|
||
import com.jayway.awaitility.Duration; | ||
import org.junit.*; | ||
import org.openqa.selenium.By; | ||
import org.openqa.selenium.WebDriver; | ||
import org.openqa.selenium.WebElement; | ||
import org.openqa.selenium.chrome.ChromeDriver; | ||
import org.swisspush.gateleen.AbstractTest; | ||
|
||
import static com.jayway.awaitility.Awaitility.await; | ||
import static org.hamcrest.core.IsEqual.equalTo; | ||
|
||
public class HookJsUITest extends AbstractTest { | ||
|
||
private static WebDriver webDriver; | ||
|
||
@Test | ||
public void testSingleHook() throws InterruptedException { | ||
|
||
System.setProperty("webdriver.chrome.driver", "/home/jonas/work/jrepo-local/tools/chromedriver"); | ||
webDriver = new ChromeDriver(); | ||
webDriver.get("http://localhost:" + MAIN_PORT + ROOT + "/hooktest.html"); | ||
|
||
await().atMost(Duration.TWO_SECONDS).until(() -> | ||
webDriver.findElement(By.xpath("/html/body/pre")).getText(), | ||
equalTo("404 Not Found")); | ||
|
||
// WebElement buttonPlaceSingleHook = webDriver.findElement(By.id("psh")); | ||
// buttonPlaceSingleHook.click(); | ||
// await().atMost(Duration.TWO_SECONDS).until(() -> | ||
// webDriver.findElement(By.xpath("//*[@id=\"hjsm\"]/li[1]")).getText(), | ||
// equalTo("Installing listener 1")); | ||
// | ||
// WebElement buttonPutSingle = webDriver.findElement(By.id("ps")); | ||
// buttonPutSingle.click(); | ||
// await().atMost(Duration.TWO_SECONDS).until(() -> | ||
// webDriver.findElement(By.xpath("//*[@id=\"hjsm\"]/li[2]")).getText(), | ||
// equalTo("Listener 1 received:<Message 1>")); | ||
} | ||
|
||
@After | ||
public void afterClass(){ | ||
webDriver.quit(); | ||
} | ||
|
||
} |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Tue Dec 13 09:20:05 CET 2016 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip | ||
#Fri Sep 01 14:26:48 ICT 2017 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip |