From bda00728aba12df401f52494ac6bd854a55a4514 Mon Sep 17 00:00:00 2001 From: Bill Smith Date: Tue, 2 Jul 2019 15:22:41 -0700 Subject: [PATCH] SHIBUI-1281 BaseURL edits to get tests to behave. --- .../tier/shibboleth/admin/ui/SeleniumSIDETest.groovy | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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 }