Skip to content

Commit

Permalink
[NOJIRA]
Browse files Browse the repository at this point in the history
Modified XML upload to attempt to use the file specified in the map.
However, Selenium refuses to click on the file upload element.
  • Loading branch information
Bill Smith committed Mar 8, 2019
1 parent 857d322 commit 424f852
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class SeleniumSIDETest extends Specification {

def "Selenium: just run one"() {
setup:
def file = "/ModifyFilterOrder.side"
def file = "/CreateMetadataSourceFromXML.side"
def main = new Main()
def config = new DefaultConfig([] as String[]).with {
if (System.properties.getProperty('webdriver.driver')) {
Expand All @@ -31,6 +31,7 @@ class SeleniumSIDETest extends Specification {
}
def runner = new Runner()
main.setupRunner(runner, config, [] as String[])
runner.varsMap.put('xmlUpload', '/Test Upload.xml')

expect:
def result = runner.run(file, this.class.getResourceAsStream(file))
Expand Down Expand Up @@ -67,7 +68,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 (Failure: Cannot click <input type=file> elements)
// 'Create Metadata Source From XML' | '/CreateMetadataSourceFromXML.side' // failing (Failure: Cannot click <input type=file> elements)
'Create Metadata Source From Copy' | '/CreateMetadataSourceFromCopy.side' //failing, error reported to JJ/Ryan
'Create Metadata Source from URL' | '/CreateMetadataSourceFromURL.side'
'Delete Entity ID Filter' | '/DeleteEntityIDFilter.side'
Expand All @@ -81,5 +82,6 @@ class SeleniumSIDETest extends Specification {
'Create and Delete Name ID Format Entity ID Filter' | '/CreateAndDeleteNameIDFormatEntityIDFilter.side'
'Create and Delete Name ID Format Regex Filter' | '/CreateAndDeleteNameIDFormatRegexFilter.side'
'Create and Delete Name ID Format Script Filter' | '/CreateAndDeleteNameIDFormatScriptFilter.side'
'Create and Modify Filter Order' | '/ModifyFilterOrder.side'
}
}
72 changes: 19 additions & 53 deletions backend/src/integration/resources/CreateMetadataSourceFromXML.side
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "16b5f41b-30c1-4cc1-9c9e-bc15e40d1318",
"version": "1.1",
"version": "2.0",
"name": "ShibUI",
"url": "http://localhost:10101/",
"tests": [{
Expand Down Expand Up @@ -169,71 +169,37 @@
["xpath=//input[@id='fileInput']", "xpath:attributes"],
["xpath=//div[2]/div/input", "xpath:position"]
],
"value": "C:\\fakepath\\Test Upload.xml"
"value": "${xmlUpload}"
}, {
"id": "e552d33d-2766-4abe-8d51-c36ad0a3b084",
"id": "6d638906-6435-496a-bcee-6a55fa33e95e",
"comment": "",
"command": "click",
"target": "css=span.direction.pull-right",
"targets": [
["css=span.direction.pull-right", "css"],
["css=.direction", "css:finder"],
["xpath=//span[2]", "xpath:position"]
],
"value": ""
}, {
"id": "06fda754-668b-440d-83dd-05e757fcb8fa",
"comment": "",
"command": "assertText",
"target": "css=.col-9 > div:nth-child(2)",
"command": "waitForElementPresent",
"target": "css=.card-header",
"targets": [
["css=.col-9 > div:nth-child(2)", "css:finder"],
["xpath=//div/div/div/div/div[2]", "xpath:position"]
["css=.card-header", "css:finder"],
["xpath=//resolver-item/div/div", "xpath:position"]
],
"value": "Metadata Source Upload XML\\nUploadedTest"
"value": "3000"
}, {
"id": "4d5813aa-c287-4bda-b535-18ce9c647087",
"id": "8965fd85-b9b4-49d5-8efe-fcb1ad12b6dd",
"comment": "",
"command": "click",
"target": "css=.fa-eye",
"target": "css=.text-primary",
"targets": [
["css=.fa-eye", "css:finder"],
["xpath=//div[2]/button/i", "xpath:position"]
["css=.text-primary", "css:finder"],
["xpath=//div/i", "xpath:position"]
],
"value": ""
}, {
"id": "d9833784-1fa0-4eb4-a1ef-6771fa067eb8",
"id": "44ac47d8-7246-4bf6-ae7b-0178f2987cfc",
"comment": "",
"command": "click",
"target": "css=button.btn.btn-secondary",
"targets": [
["css=button.btn.btn-secondary", "css"],
["css=.btn-secondary", "css:finder"],
["xpath=(//button[@type='button'])[5]", "xpath:attributes"],
["xpath=//div[3]/button[2]", "xpath:position"]
],
"value": ""
}, {
"id": "6518b29c-f355-4dde-b65e-0011104b91fd",
"comment": "",
"command": "click",
"target": "css=.fa-edit",
"targets": [
["css=.fa-edit", "css:finder"],
["xpath=//button[2]/i", "xpath:position"]
],
"value": ""
}, {
"id": "13d6ff70-8354-49d6-a642-b7cc6661fa79",
"comment": "",
"command": "click",
"target": "css=button.btn.btn-secondary > translate-i18n",
"command": "assertText",
"target": "css=.row:nth-child(1) > .col:nth-child(2)",
"targets": [
["css=button.btn.btn-secondary > translate-i18n", "css"],
["css=.btn-secondary > translate-i18n", "css:finder"],
["xpath=//button[2]/translate-i18n", "xpath:position"]
["css=.row:nth-child(1) > .col:nth-child(2)", "css:finder"],
["xpath=//div[2]/div/div/div/div/div[2]", "xpath:position"]
],
"value": ""
"value": "Metadata Source Upload XML"
}]
}],
"suites": [{
Expand All @@ -246,4 +212,4 @@
}],
"urls": ["http://localhost:10101/"],
"plugins": []
}
}

0 comments on commit 424f852

Please sign in to comment.