Skip to content

Commit

Permalink
Minor tweaks to OAuth2 WireMock login test
Browse files Browse the repository at this point in the history
  • Loading branch information
tomakehurst committed Mar 10, 2020
1 parent 94266ce commit 20a3f47
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ dependencies {
testCompile("org.springframework.boot:spring-boot-starter-test")
testCompile("org.seleniumhq.selenium:selenium-api")
testCompile 'org.seleniumhq.selenium:selenium-chrome-driver'
testCompile('com.github.tomakehurst:wiremock:2.26.3')
testCompile('com.github.tomakehurst:wiremock-jre8:2.26.3')

testCompile("junit:junit")
testCompile('org.assertj:assertj-core:3.8.0')
}
Expand Down
4 changes: 1 addition & 3 deletions src/test/java/mocklab/demo/OAuth2LoginTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,11 @@ public void logs_in_via_wiremock_sso() throws Exception {
webDriver.findElement(By.name("password")).sendKeys("pass123");
webDriver.findElement(By.id("submit")).click();

Thread.sleep(2000);

assertThat(webDriver.getCurrentUrl()).contains("/user");
assertThat(webDriver.findElement(By.tagName("h1")).getText()).contains("Hello [email protected]!");
}

static {
System.setProperty("webdriver.chrome.driver", "lib/chromedriver");
System.setProperty("webdriver.chrome.driver", "lib/chromedriver"); // This is the OSX driver. You'll need to tweak this if you want to run on Windows or Linux.
}
}

0 comments on commit 20a3f47

Please sign in to comment.