From 12e2fa9404ff712b8c20ab232f1c5cc2b88a4bad Mon Sep 17 00:00:00 2001 From: Jj! Date: Tue, 4 Dec 2018 10:03:37 -0600 Subject: [PATCH] [SHIBUI-922] update tests for unique default port --- backend/build.gradle | 6 +-- .../admin/ui/SeleniumSIDETest.groovy | 9 ++++- .../CreateMetaDataSourceFromURL.json | 2 +- backend/src/integration/resources/dhmr.side | 39 ++++++++++++++----- 4 files changed, 41 insertions(+), 15 deletions(-) diff --git a/backend/build.gradle b/backend/build.gradle index 4173c25df..8f0f60b85 100644 --- a/backend/build.gradle +++ b/backend/build.gradle @@ -293,9 +293,9 @@ tasks.dockerRun.dependsOn tasks.docker dockerRun { name 'shibuiint' image 'unicon/shibui' - ports '8080:8080' + ports '10101:8080' daemonize true - command '--spring.profiles.include=no-auth' + command '--spring.profiles.include=no-auth,very-dangerous' clean true } @@ -303,7 +303,7 @@ task runChecker << { def ready = false while (!ready) { try { - ready = 'http://localhost:8080'.toURL().text.length() > 0 + ready = 'http://localhost:10101'.toURL().text.length() > 0 } catch (IOException e) { println 'cannot reach site' sleep 5000 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 6d2013f79..d5348823c 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 @@ -9,14 +9,19 @@ import spock.lang.Unroll class SeleniumSIDETest extends Specification { @Unroll def "#name"() { - expect: + setup: def main = new Main() - def config = new DefaultConfig([] as String[]) + def config = new DefaultConfig([] as String[]).with { + it.baseurl = 'http://localhost:10101' + it + } def runner = new Runner() main.setupRunner(runner, config, [] as String[]) + expect: def result = runner.run(file, this.class.getResourceAsStream(file)) runner.finish() + assert result.level.exitCode == 0 where: diff --git a/backend/src/integration/resources/CreateMetaDataSourceFromURL.json b/backend/src/integration/resources/CreateMetaDataSourceFromURL.json index 57f956f09..eb541a4a1 100644 --- a/backend/src/integration/resources/CreateMetaDataSourceFromURL.json +++ b/backend/src/integration/resources/CreateMetaDataSourceFromURL.json @@ -5,7 +5,7 @@ "steps": [ { "type": "get", - "url": "http://localhost:8080" + "url": "http://localhost:10101" }, { "type": "waitForElementPresent", diff --git a/backend/src/integration/resources/dhmr.side b/backend/src/integration/resources/dhmr.side index 164cff79f..01c783678 100644 --- a/backend/src/integration/resources/dhmr.side +++ b/backend/src/integration/resources/dhmr.side @@ -2,7 +2,7 @@ "id": "67487cd1-1e43-4000-ba49-524002c96fb0", "version": "1.1", "name": "shibui", - "url": "http://localhost:8080", + "url": "http://localhost:10101", "tests": [{ "id": "be39a393-4d08-45ed-b09a-782ec26c9968", "name": "create test-dhmr", @@ -13,6 +13,17 @@ "target": "/api/heheheheheheheWipeout", "targets": [], "value": "" + }, { + "id": "a01fba64-9612-41ec-bd53-f731464a1d52", + "comment": "", + "command": "assertText", + "target": "css=body", + "targets": [ + ["css=body", "css"], + ["css=body", "css:finder"], + ["xpath=//body", "xpath:position"] + ], + "value": "yes, you did it" }, { "id": "ee5fb7bf-b12e-485e-95bd-98bb41ea7072", "comment": "", @@ -307,16 +318,26 @@ ], "value": "" }, { - "id": "03e17d1a-8352-4c55-a4dd-fe06c6fab011", + "id": "8a4e4432-8f5a-41c2-a905-8fac5ce01527", "comment": "", - "command": "verifyText", - "target": "css=div.px-2", + "command": "click", + "target": "css=div.flex-grow-1", "targets": [ - ["css=div.px-2", "css"], - ["css=.px-2", "css:finder"], - ["xpath=//div[2]/div[2]", "xpath:position"] + ["css=div.flex-grow-1", "css"], + ["css=.flex-grow-1", "css:finder"], + ["xpath=//div/div/div[2]", "xpath:position"] ], - "value": "test-dhmr\\nDynamicHttpMetadataResolver" + "value": "" + }, { + "id": "baad0142-b169-4534-b4ad-f3096ded31ad", + "comment": "", + "command": "assertText", + "target": "css=.row:nth-child(1) > .col:nth-child(2)", + "targets": [ + ["css=.row:nth-child(1) > .col:nth-child(2)", "css:finder"], + ["xpath=//div[2]/div/div/div/div/div[2]", "xpath:position"] + ], + "value": "test-dhmr" }] }], "suites": [{ @@ -327,6 +348,6 @@ "timeout": 300, "tests": ["be39a393-4d08-45ed-b09a-782ec26c9968"] }], - "urls": ["http://localhost:8080/"], + "urls": ["http://localhost:8080/", "http://localhost:10101/"], "plugins": [] } \ No newline at end of file