Skip to content

Commit

Permalink
[NOJIRA]
Browse files Browse the repository at this point in the history
Fixed file upload test.
  • Loading branch information
Bill Smith committed Mar 8, 2019
1 parent a0aa20f commit e7424d2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ import spock.lang.Ignore
import spock.lang.Specification
import spock.lang.Unroll

import java.nio.file.Paths

@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 {
@Value('${local.server.port}')
int randomPort

@Ignore
// @Ignore
def "Selenium: just run one"() {
setup:
def file = "/CreateMetadataSourceFromXML.side"
Expand All @@ -32,7 +34,7 @@ class SeleniumSIDETest extends Specification {
}
def runner = new Runner()
main.setupRunner(runner, config, [] as String[])
runner.varsMap.put('xmlUpload', '/Test Upload.xml')
runner.varsMap.put('xmlUpload', Paths.get(this.class.getResource('/TestUpload.xml').toURI()).toString())

expect:
def result = runner.run(file, this.class.getResourceAsStream(file))
Expand Down Expand Up @@ -69,7 +71,7 @@ class SeleniumSIDETest extends Specification {
'Create Filter Entity ID' | '/CreateFilterEntityID.side'
'Create Filter REGEX' | '/CreateFilterREGEX.side'
'Create Filter Script' | '/CreateFilterScript.side'
// 'Create Metadata Source From XML' | '/CreateMetadataSourceFromXML.side' // failing, Selenium "Cannot click <input type=file> elements"
'Create Metadata Source From XML' | '/CreateMetadataSourceFromXML.side'
// 'Create Metadata Source From Copy' | '/CreateMetadataSourceFromCopy.side' // failing, backend returning a 400
'Create Metadata Source from URL' | '/CreateMetadataSourceFromURL.side'
'Delete Entity ID Filter' | '/DeleteEntityIDFilter.side'
Expand Down
22 changes: 9 additions & 13 deletions backend/src/integration/resources/CreateMetadataSourceFromXML.side
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@
],
"value": "Metadata Source Upload XML"
}, {
"id": "d68b5bc2-379e-45ca-ab8d-69361318171f",
"id": "8f268193-87a0-4ae0-b7ba-e7218c6a3728",
"comment": "",
"command": "click",
"command": "type",
"target": "id=fileInput",
"targets": [
["id=fileInput", "id"],
Expand All @@ -155,21 +155,17 @@
["xpath=//input[@id='fileInput']", "xpath:attributes"],
["xpath=//div[2]/div/input", "xpath:position"]
],
"value": ""
"value": "${xmlUpload}"
}, {
"id": "8f268193-87a0-4ae0-b7ba-e7218c6a3728",
"id": "6c7ea04b-663e-45e4-9358-4db02a69a08f",
"comment": "",
"command": "type",
"target": "id=fileInput",
"command": "click",
"target": "css=.next",
"targets": [
["id=fileInput", "id"],
["name=file", "name"],
["css=#fileInput", "css"],
["css=#fileInput", "css:finder"],
["xpath=//input[@id='fileInput']", "xpath:attributes"],
["xpath=//div[2]/div/input", "xpath:position"]
["css=.next", "css:finder"],
["xpath=//li[2]/button", "xpath:position"]
],
"value": "${xmlUpload}"
"value": ""
}, {
"id": "6d638906-6435-496a-bcee-6a55fa33e95e",
"comment": "",
Expand Down

0 comments on commit e7424d2

Please sign in to comment.