From e7424d2db2c909e7d19d8abc8ae469196724a096 Mon Sep 17 00:00:00 2001 From: Bill Smith Date: Fri, 8 Mar 2019 14:18:40 -0700 Subject: [PATCH] [NOJIRA] Fixed file upload test. --- .../admin/ui/SeleniumSIDETest.groovy | 8 ++++--- .../CreateMetadataSourceFromXML.side | 22 ++++++++----------- .../{Test Upload.xml => TestUpload.xml} | 0 3 files changed, 14 insertions(+), 16 deletions(-) rename backend/src/integration/resources/{Test Upload.xml => TestUpload.xml} (100%) 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 78e99ce75..d2c79fc5d 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 @@ -11,6 +11,8 @@ 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) @@ -18,7 +20,7 @@ class SeleniumSIDETest extends Specification { @Value('${local.server.port}') int randomPort - @Ignore +// @Ignore def "Selenium: just run one"() { setup: def file = "/CreateMetadataSourceFromXML.side" @@ -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)) @@ -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 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' diff --git a/backend/src/integration/resources/CreateMetadataSourceFromXML.side b/backend/src/integration/resources/CreateMetadataSourceFromXML.side index 64e10cd0d..8de279641 100644 --- a/backend/src/integration/resources/CreateMetadataSourceFromXML.side +++ b/backend/src/integration/resources/CreateMetadataSourceFromXML.side @@ -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"], @@ -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": "", diff --git a/backend/src/integration/resources/Test Upload.xml b/backend/src/integration/resources/TestUpload.xml similarity index 100% rename from backend/src/integration/resources/Test Upload.xml rename to backend/src/integration/resources/TestUpload.xml