diff --git a/backend/src/integration/groovy/edu/internet2/tier/shibboleth/admin/ui/SeleniumSIDETest.groovy b/backend/src/integration/groovy/edu/internet2/tier/shibboleth/admin/ui/SeleniumSIDETest.groovy index aae8797f6..e05e3f498 100644 --- a/backend/src/integration/groovy/edu/internet2/tier/shibboleth/admin/ui/SeleniumSIDETest.groovy +++ b/backend/src/integration/groovy/edu/internet2/tier/shibboleth/admin/ui/SeleniumSIDETest.groovy @@ -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 { @@ -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() @@ -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 }