From ab61eba09f45f339a47a2b50b7bd93f1f4f65fa0 Mon Sep 17 00:00:00 2001 From: Bill Smith Date: Fri, 8 Mar 2019 15:50:00 -0700 Subject: [PATCH] [NOJIRA] Bumped selenium runner to 3.20.0. Updated create from copy test to skip MDUI on create. This is a temporary workaround for the 400 error on copy. --- backend/build.gradle | 2 +- .../admin/ui/SeleniumSIDETest.groovy | 11 +- .../CreateMetadataSourceFromCopy.side | 170 ++---------------- 3 files changed, 21 insertions(+), 162 deletions(-) diff --git a/backend/build.gradle b/backend/build.gradle index 025da45d8..9de3e645e 100644 --- a/backend/build.gradle +++ b/backend/build.gradle @@ -166,7 +166,7 @@ dependencies { compile 'org.sharegov:mjson:1.4.1' integrationTestCompile 'com.saucelabs:sebuilder-interpreter:1.0.6' - integrationTestCompile 'jp.vmi:selenese-runner-java:3.19.2' + integrationTestCompile 'jp.vmi:selenese-runner-java:3.20.0' // CSV file support compile 'com.opencsv:opencsv:4.4' 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 d2c79fc5d..afb3d5ad2 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 @@ -23,7 +23,7 @@ class SeleniumSIDETest extends Specification { // @Ignore def "Selenium: just run one"() { setup: - def file = "/CreateMetadataSourceFromXML.side" + def file = "/CreateMetadataSourceFromCopy.side" def main = new Main() def config = new DefaultConfig([] as String[]).with { if (System.properties.getProperty('webdriver.driver')) { @@ -33,8 +33,8 @@ class SeleniumSIDETest extends Specification { it } def runner = new Runner() - main.setupRunner(runner, config, [] as String[]) runner.varsMap.put('xmlUpload', Paths.get(this.class.getResource('/TestUpload.xml').toURI()).toString()) + main.setupRunner(runner, config, [] as String[]) expect: def result = runner.run(file, this.class.getResourceAsStream(file)) @@ -55,6 +55,7 @@ class SeleniumSIDETest extends Specification { it } def runner = new Runner() + runner.varsMap.put('xmlUpload', Paths.get(this.class.getResource('/TestUpload.xml').toURI()).toString()) main.setupRunner(runner, config, [] as String[]) expect: @@ -72,19 +73,19 @@ class SeleniumSIDETest extends Specification { 'Create Filter REGEX' | '/CreateFilterREGEX.side' 'Create Filter Script' | '/CreateFilterScript.side' 'Create Metadata Source From XML' | '/CreateMetadataSourceFromXML.side' -// 'Create Metadata Source From Copy' | '/CreateMetadataSourceFromCopy.side' // failing, backend returning a 400 + 'Create Metadata Source From Copy' | '/CreateMetadataSourceFromCopy.side' // currently does not populate MDUI before copy (causes 400) 'Create Metadata Source from URL' | '/CreateMetadataSourceFromURL.side' 'Delete Entity ID Filter' | '/DeleteEntityIDFilter.side' 'Delete REGEX Filter' | '/DeleteREGEXFilter.side' 'Delete Incomplete Source' | '/DeleteIncompleteSource.side' 'Admin Login' | '/SHIBUI-1031_AdminLogin.side' -// 'Delegated Admin: SubmitSourceWithError' | '/SHIBUI-1058_DelegatedAdmin_SubmitSource.side' // failing, Selenium not finding the right elements in the right order +// 'Delegated Admin: SubmitSource' | '/SHIBUI-1058_DelegatedAdmin_SubmitSource.side' // failing, Selenium not finding the right elements in the right order 'Create Filesystem Metadata Resolver' | '/CreateFilesystemMetadataResolver.side' 'Create Local Dynamic Metadata Resolver' | '/CreateLocalDynamicMetadataResolver.side' 'Delete Entity Attributes Script Filter' | '/DeleteScriptFilter.side' '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' // failing, Selenium can't click up/down arrows + 'Create and Modify Filter Order' | '/ModifyFilterOrder.side' } } diff --git a/backend/src/integration/resources/CreateMetadataSourceFromCopy.side b/backend/src/integration/resources/CreateMetadataSourceFromCopy.side index 43f8a4438..a38ffe204 100644 --- a/backend/src/integration/resources/CreateMetadataSourceFromCopy.side +++ b/backend/src/integration/resources/CreateMetadataSourceFromCopy.side @@ -350,153 +350,6 @@ ["xpath=//li[3]/button/span", "xpath:position"] ], "value": "" - }, { - "id": "069f0972-4b43-4a12-a485-542831bba9d3", - "comment": "", - "command": "click", - "target": "id=field15", - "targets": [ - ["id=field15", "id"], - ["name=field15", "name"], - ["css=#field15", "css"], - ["css=#field15", "css:finder"], - ["xpath=//input[@id='field15']", "xpath:attributes"], - ["xpath=//input", "xpath:position"] - ], - "value": "" - }, { - "id": "74879229-2f35-458b-8bc2-fe53b40abc16", - "comment": "", - "command": "type", - "target": "id=field15", - "targets": [ - ["id=field15", "id"], - ["name=field15", "name"], - ["css=#field15", "css"], - ["css=#field15", "css:finder"], - ["xpath=//input[@id='field15']", "xpath:attributes"], - ["xpath=//input", "xpath:position"] - ], - "value": "Metadata Source Happy Path" - }, { - "id": "1c4fcf3d-9316-4816-b80a-3151bd71e9e2", - "comment": "", - "command": "click", - "target": "id=field19", - "targets": [ - ["id=field19", "id"], - ["name=field19", "name"], - ["css=#field19", "css"], - ["css=#field19", "css:finder"], - ["xpath=//input[@id='field19']", "xpath:attributes"], - ["xpath=//fieldset[2]/div/div[2]/sf-form-element/div/sf-widget-chooser/custom-string/div/input", "xpath:position"] - ], - "value": "" - }, { - "id": "79efad4e-9936-4637-a86b-e34be03a833e", - "comment": "", - "command": "type", - "target": "id=field19", - "targets": [ - ["id=field19", "id"], - ["name=field19", "name"], - ["css=#field19", "css"], - ["css=#field19", "css:finder"], - ["xpath=//input[@id='field19']", "xpath:attributes"], - ["xpath=//fieldset[2]/div/div[2]/sf-form-element/div/sf-widget-chooser/custom-string/div/input", "xpath:position"] - ], - "value": "Metadata Source Happy Path" - }, { - "id": "bcce1997-56cd-432c-8e8e-fa7cdfab4ff7", - "comment": "", - "command": "mouseDownAt", - "target": "name=field20", - "targets": [ - ["name=field20", "name"], - ["css=input[name=\"field20\"]", "css"], - ["css=div:nth-child(3) > sf-form-element integer-component .text-widget", "css:finder"], - ["xpath=//input[@name='field20']", "xpath:attributes"], - ["xpath=//integer-component/div/input", "xpath:position"] - ], - "value": "18.046875,20.5625" - }, { - "id": "dc5a59a9-cdb0-4811-9665-2518b540bc96", - "comment": "", - "command": "mouseMoveAt", - "target": "name=field20", - "targets": [ - ["name=field20", "name"], - ["css=input[name=\"field20\"]", "css"], - ["css=div:nth-child(3) > sf-form-element integer-component .text-widget", "css:finder"], - ["xpath=//input[@name='field20']", "xpath:attributes"], - ["xpath=//integer-component/div/input", "xpath:position"] - ], - "value": "18.046875,20.5625" - }, { - "id": "5f6e4eda-266a-4dec-9966-e59579197b57", - "comment": "", - "command": "mouseUpAt", - "target": "name=field20", - "targets": [ - ["name=field20", "name"], - ["css=input[name=\"field20\"]", "css"], - ["css=div:nth-child(3) > sf-form-element integer-component .text-widget", "css:finder"], - ["xpath=//input[@name='field20']", "xpath:attributes"], - ["xpath=//integer-component/div/input", "xpath:position"] - ], - "value": "18.046875,20.5625" - }, { - "id": "fafee973-6b99-4213-abbe-cd19c2a301fc", - "comment": "", - "command": "click", - "target": "name=field20", - "targets": [ - ["name=field20", "name"], - ["css=input[name=\"field20\"]", "css"], - ["css=div:nth-child(3) > sf-form-element integer-component .text-widget", "css:finder"], - ["xpath=//input[@name='field20']", "xpath:attributes"], - ["xpath=//integer-component/div/input", "xpath:position"] - ], - "value": "" - }, { - "id": "d2685a5b-b963-4087-9cb3-a16e284b8eec", - "comment": "", - "command": "type", - "target": "name=field20", - "targets": [ - ["name=field20", "name"], - ["css=input[name=\"field20\"]", "css"], - ["css=integer-component .ng-dirty", "css:finder"], - ["xpath=//input[@name='field20']", "xpath:attributes"], - ["xpath=//integer-component/div/input", "xpath:position"] - ], - "value": "22" - }, { - "id": "33780c34-5a30-44e0-b717-324d8dc1d39f", - "comment": "", - "command": "click", - "target": "name=field21", - "targets": [ - ["name=field21", "name"], - ["css=input[name=\"field21\"]", "css"], - ["css=integer-component .ng-untouched", "css:finder"], - ["xpath=//input[@name='field21']", "xpath:attributes"], - ["xpath=//div[4]/sf-form-element/div/sf-widget-chooser/integer-component/div/input", "xpath:position"] - ], - "value": "" - }, { - "id": "5d61c087-2035-4d19-a861-3709711f27d5", - "comment": "", - "command": "type", - "target": "name=field21", - "targets": [ - ["name=field21", "name"], - ["css=input[name=\"field21\"]", "css"], - ["css=integer-component .ng-untouched", "css:finder"], - ["xpath=//input[@name='field21']", "xpath:attributes"], - ["xpath=//div[4]/sf-form-element/div/sf-widget-chooser/integer-component/div/input", "xpath:position"] - ], - "value": "22" }, { "id": "5bd5ae5a-2c88-4773-bf44-751d13ed88d3", "comment": "", @@ -1572,28 +1425,33 @@ ["xpath=//li[3]/button", "xpath:position"] ], "value": "" + }, { + "id": "cbdd31b0-1b06-4cc7-b18e-ac2fda5d6cfd", + "comment": "", + "command": "pause", + "target": "", + "targets": [], + "value": "3000" }, { "id": "88338e99-dd8d-4c9b-ada6-bb93f612c1ab", "comment": "", "command": "click", - "target": "css=span.direction.pull-right", + "target": "css=.fa-caret-right", "targets": [ - ["css=span.direction.pull-right", "css"], - ["css=.direction:nth-child(2)", "css:finder"], - ["xpath=//li[3]/button/span[2]", "xpath:position"] + ["css=.fa-caret-right", "css:finder"], + ["xpath=//li[2]/resolver-item/div/div/div/div/div/i", "xpath:position"] ], "value": "" }, { "id": "5297a9fe-85c3-4daf-b2a6-c8533c9d5f1c", "comment": "", "command": "assertText", - "target": "css=.lead", + "target": "css=.mt-2 .row:nth-child(1) > .col:nth-child(2)", "targets": [ - ["css=.lead", "css:finder"], - ["xpath=//div/div/div/span", "xpath:position"], - ["xpath=//span[contains(.,'Current Metadata Sources')]", "xpath:innerText"] + ["css=.mt-2 .row:nth-child(1) > .col:nth-child(2)", "css:finder"], + ["xpath=//li[2]/resolver-item/div/div[2]/div/div/div/div/div[2]", "xpath:position"] ], - "value": "Current Metadata Sources" + "value": "New Metadata Source from Copy" }] }], "suites": [{