Skip to content

Commit

Permalink
[SHIBUI-922]
Browse files Browse the repository at this point in the history
update tests for unique default port
  • Loading branch information
jj committed Dec 4, 2018
1 parent 885478d commit 12e2fa9
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 15 deletions.
6 changes: 3 additions & 3 deletions backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -293,17 +293,17 @@ 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
}

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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"steps": [
{
"type": "get",
"url": "http://localhost:8080"
"url": "http://localhost:10101"
},
{
"type": "waitForElementPresent",
Expand Down
39 changes: 30 additions & 9 deletions backend/src/integration/resources/dhmr.side
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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": "",
Expand Down Expand Up @@ -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": [{
Expand All @@ -327,6 +348,6 @@
"timeout": 300,
"tests": ["be39a393-4d08-45ed-b09a-782ec26c9968"]
}],
"urls": ["http://localhost:8080/"],
"urls": ["http://localhost:8080/", "http://localhost:10101/"],
"plugins": []
}

0 comments on commit 12e2fa9

Please sign in to comment.