Skip to content

Commit

Permalink
SHIBUI-1281
Browse files Browse the repository at this point in the history
BaseURL edits to get tests to behave.
  • Loading branch information
Bill Smith committed Jul 2, 2019
1 parent 440c5f4 commit bda0072
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import spock.lang.Unroll
import java.nio.file.Paths

//TODO: make config configurable
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT, classes = [ShibbolethUiApplication])
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = [ShibbolethUiApplication])
@ActiveProfiles(['dev'])
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD, methodMode = DirtiesContext.MethodMode.AFTER_METHOD)
class SeleniumSIDETest extends Specification {
Expand All @@ -34,7 +34,11 @@ class SeleniumSIDETest extends Specification {
it.remoteUrl = 'http://selenium-hub:4444/wd/hub'
it.remoteBrowser = 'firefox'
}
it.baseurl = "http://jenkins:${this.randomPort}"
if (System.properties.getProperty('selenium.host')) {
it.baseurl = "http://${System.properties.getProperty('selenium.host')}:${this.randomPort}"
} else {
it.baseurl = "http://localhost:${this.randomPort}"
}
it
}
def runner = new Runner()
Expand All @@ -61,9 +65,9 @@ class SeleniumSIDETest extends Specification {
it.remoteBrowser = 'firefox'
}
if (System.properties.getProperty('selenium.host')) {
it.baseurl = System.properties.getProperty('selenium.host')
it.baseurl = "http://${System.properties.getProperty('selenium.host')}:${this.randomPort}"
} else {
it.baseurl = "http://jenkins:${this.randomPort}"
it.baseurl = "http://localhost:${this.randomPort}"
}
it
}
Expand Down

0 comments on commit bda0072

Please sign in to comment.