Skip to content

Commit

Permalink
Merge branch 'master' into feature/SHIBUI-1461-QA
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill Smith committed Sep 5, 2019
2 parents 80462e8 + 7993d5e commit bf64dd5
Show file tree
Hide file tree
Showing 111 changed files with 3,363 additions and 456 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
package edu.internet2.tier.shibboleth.admin.ui.controller

import edu.internet2.tier.shibboleth.admin.ui.domain.EntityDescriptor
import edu.internet2.tier.shibboleth.admin.ui.domain.Organization
import edu.internet2.tier.shibboleth.admin.ui.domain.OrganizationDisplayName
import edu.internet2.tier.shibboleth.admin.ui.domain.OrganizationName
import edu.internet2.tier.shibboleth.admin.ui.domain.OrganizationURL
import edu.internet2.tier.shibboleth.admin.ui.domain.frontend.EntityDescriptorRepresentation
import edu.internet2.tier.shibboleth.admin.ui.repository.EntityDescriptorRepository
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.boot.test.web.client.TestRestTemplate
import org.springframework.http.HttpEntity
import org.springframework.http.HttpHeaders
import org.springframework.http.HttpMethod
import org.springframework.http.MediaType
import org.springframework.test.annotation.DirtiesContext
import org.springframework.test.context.ActiveProfiles
import spock.lang.Specification

Expand Down Expand Up @@ -100,6 +111,46 @@ class EntityDescriptorControllerVersionEndpointsIntegrationTests extends Specifi
edv2.body.serviceProviderName == 'SP2'
}

@DirtiesContext(methodMode = DirtiesContext.MethodMode.AFTER_METHOD)
def 'SHIBUI-1414'() {
given:
def ed = new EntityDescriptor(entityID: 'testme', serviceProviderName: 'testme').with {
entityDescriptorRepository.save(it)
}.with {
it.setOrganization(new Organization().with {
it.organizationNames = [new OrganizationName(value: 'testme', XMLLang: 'en')]
it.organizationDisplayNames = [new OrganizationDisplayName(value: 'testme', XMLLang: 'en')]
it.organizationURLs = [new OrganizationURL(value: 'http://testme.org', XMLLang: 'en')]
it
})
entityDescriptorRepository.save(it)
}

when:
def headers = new HttpHeaders().with {
it.set(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
it
}

def allVersions = getAllEntityDescriptorVersions(ed.resourceId, List)
def edv1 = getEntityDescriptorForVersion(ed.resourceId, allVersions.body[0].id, String).body
def tedv2 = getEntityDescriptorForVersion(ed.resourceId, allVersions.body[1].id, EntityDescriptorRepresentation).body

def aedv1 = new JsonSlurper().parseText(edv1).with {
it.put('version', tedv2.version)
it
}.with {
JsonOutput.toJson(it)
}

def request = new HttpEntity(aedv1, headers)
def response = this.restTemplate.exchange("/api/EntityDescriptor/${ed.resourceId}", HttpMethod.PUT, request, String)

then:
response.statusCodeValue != 400
noExceptionThrown()
}

private getAllEntityDescriptorVersions(String resourceId, responseType) {
this.restTemplate.getForEntity(resourceUriFor(ALL_VERSIONS_URI, resourceId), responseType)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class SeleniumSIDETest extends Specification {
// 'SHIBUI-1335: Verify Local Dynamic Metadata Provider Filters' | '/SHIBUI-1335-3.side'
// 'SHIBUI-1335: Verify Dynamic HTTP Metadata Provider Filters' | '/SHIBUI-1335-4.side'
'SHIBUI-1392: Verify provider with script filter is persistable' | '/SHIBUI-1392.side'
'SHIBUI-1361: Verify dates display in proper format' | '/SHIBUI-1361.side'
}
}

13 changes: 10 additions & 3 deletions backend/src/integration/resources/SHIBUI-1334-1.side
Original file line number Diff line number Diff line change
Expand Up @@ -2219,7 +2219,7 @@
"id": "c2d29077-30c4-45cf-81c9-b5790294e11e",
"comment": "",
"command": "click",
"target": "css=.btn-info > translate-i18n",
"target": "css=.btn-info",
"targets": [
["css=.btn-info > translate-i18n", "css:finder"],
["xpath=//div[2]/button/translate-i18n", "xpath:position"],
Expand All @@ -2230,7 +2230,7 @@
"id": "f2e3d420-5cf5-4165-94da-41688839cf82",
"comment": "",
"command": "click",
"target": "css=.btn-link:nth-child(1) > translate-i18n",
"target": "css=.btn-link:nth-child(1)",
"targets": [
["css=.btn-link:nth-child(1) > translate-i18n", "css:finder"],
["xpath=//div[@id='navigation']/div/a/translate-i18n", "xpath:idRelative"],
Expand All @@ -2253,7 +2253,7 @@
"id": "68972f7d-8268-4701-865c-585a39987208",
"comment": "",
"command": "click",
"target": "css=tr:nth-child(2) .custom-control-label",
"target": "css=tr:nth-child(3) .custom-control-label",
"targets": [
["css=tr:nth-child(2) .custom-control-label", "css:finder"],
["xpath=//tr[2]/td/div/label", "xpath:position"]
Expand All @@ -2270,6 +2270,13 @@
["xpath=//button[contains(.,'Compare Selected(2)')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "98aafaee-a430-4a2d-9aa5-b4c9ce0c4908",
"comment": "",
"command": "waitForElementVisible",
"target": "css=.mb-4:nth-child(2) primitive-property:nth-child(1) .d-block:nth-child(2)",
"targets": [],
"value": "10000"
}, {
"id": "5a976e2c-dc5f-4021-9cc6-3cad12e771ea",
"comment": "",
Expand Down
106 changes: 75 additions & 31 deletions backend/src/integration/resources/SHIBUI-1334-2.side
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@
["xpath=//li[2]/button", "xpath:position"]
],
"value": ""
}, {
"id": "d072327c-78b4-4bdb-8020-b825cd26592d",
"comment": "",
"command": "waitForElementVisible",
"target": "id=/xmlId",
"targets": [],
"value": "10000"
}, {
"id": "86262eda-4a44-41b0-b7aa-fa46406e2601",
"comment": "",
Expand Down Expand Up @@ -578,15 +585,9 @@
}, {
"id": "5636ef67-71fb-4bca-ba58-7ecf926c7bf0",
"comment": "",
"command": "click",
"target": "id=/xmlId",
"targets": [
["id=/xmlId", "id"],
["name=field38", "name"],
["css=#\\/xmlId", "css:finder"],
["xpath=//input[@id='/xmlId']", "xpath:attributes"],
["xpath=//custom-string/div/input", "xpath:position"]
],
"command": "pause",
"target": "5000",
"targets": [],
"value": ""
}, {
"id": "7d641e58-47ce-4d20-908c-e0002ff73cfa",
Expand All @@ -600,7 +601,14 @@
["xpath=//input[@id='/xmlId']", "xpath:attributes"],
["xpath=//custom-string/div/input", "xpath:position"]
],
"value": "123 v2"
"value": "123 version 2"
}, {
"id": "b78c81e9-41ac-41db-837a-0db6bd4f77eb",
"comment": "",
"command": "pause",
"target": "5000",
"targets": [],
"value": ""
}, {
"id": "247b04c1-e690-42bc-ae15-dfbedb44d2e9",
"comment": "",
Expand All @@ -624,6 +632,13 @@
["xpath=//button[contains(.,'Save')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "eb08417b-b8f0-46dc-9e32-e8daf3bc205d",
"comment": "",
"command": "pause",
"target": "2000",
"targets": [],
"value": ""
}, {
"id": "cf005a45-74ae-4f7a-a53c-ed59d63f7114",
"comment": "",
Expand Down Expand Up @@ -695,19 +710,19 @@
"command": "assertText",
"target": "css=.d-block > primitive-property:nth-child(2) .d-block:nth-child(2)",
"targets": [
["css=.d-block > primitive-property:nth-child(2) .d-block:nth-child(2)", "css:finder"],
["xpath=//primitive-property[2]/div/span[2]", "xpath:position"],
["css=.d-block > primitive-property:nth-child(4) .d-block:nth-child(2)", "css:finder"],
["xpath=//primitive-property[4]/div/span[2]", "xpath:position"],
["xpath=//span[contains(.,'123 v2')]", "xpath:innerText"]
],
"value": "123 v2"
"value": "123 version 2"
}, {
"id": "a13198b9-7827-47e2-ade3-143b981d34ee",
"comment": "",
"command": "assertText",
"target": "css=.d-block > primitive-property:nth-child(2) .d-block:nth-child(3)",
"targets": [
["css=.d-block > primitive-property:nth-child(2) .d-block:nth-child(3)", "css:finder"],
["xpath=//primitive-property[2]/div/span[3]", "xpath:position"]
["css=.d-block > primitive-property:nth-child(4) .d-block:nth-child(3)", "css:finder"],
["xpath=//primitive-property[4]/div/span[3]", "xpath:position"]
],
"value": "123"
}, {
Expand All @@ -716,8 +731,8 @@
"command": "assertText",
"target": "css=.d-block > primitive-property:nth-child(10) .d-block:nth-child(2)",
"targets": [
["css=.d-block > primitive-property:nth-child(10) .d-block:nth-child(2)", "css:finder"],
["xpath=//primitive-property[10]/div/span[2]", "xpath:position"]
["css=.d-block > primitive-property:nth-child(12) .d-block:nth-child(2)", "css:finder"],
["xpath=//primitive-property[12]/div/span[2]", "xpath:position"]
],
"value": "false"
}, {
Expand All @@ -726,8 +741,8 @@
"command": "assertText",
"target": "css=.d-block > primitive-property:nth-child(10) .d-block:nth-child(3)",
"targets": [
["css=.d-block > primitive-property:nth-child(10) .d-block:nth-child(3)", "css:finder"],
["xpath=//primitive-property[10]/div/span[3]", "xpath:position"]
["css=.d-block > primitive-property:nth-child(12) .d-block:nth-child(3)", "css:finder"],
["xpath=//primitive-property[12]/div/span[3]", "xpath:position"]
],
"value": "true"
}, {
Expand Down Expand Up @@ -782,17 +797,11 @@
],
"value": ""
}, {
"id": "78967fb5-8f61-46ce-9c14-9b6ceb12b03a",
"id": "270a048e-b903-4bc1-b95b-06ffbdef99de",
"comment": "",
"command": "click",
"target": "css=#\\/httpMetadataResolverAttributes\\/connectionRequestTimeout-container .btn",
"targets": [
["css=#\\/httpMetadataResolverAttributes\\/connectionRequestTimeout-container .btn", "css:finder"],
["xpath=(//button[@type='button'])[2]", "xpath:attributes"],
["xpath=//div[@id='/httpMetadataResolverAttributes/connectionRequestTimeout-container']/div/div/button", "xpath:idRelative"],
["xpath=//auto-complete/div/div/div/button", "xpath:position"],
["xpath=//button[contains(.,'Toggle Dropdown')]", "xpath:innerText"]
],
"command": "pause",
"target": "3000",
"targets": [],
"value": ""
}, {
"id": "1cde012c-d521-4fd5-a7d5-7a680bba0e7b",
Expand All @@ -806,7 +815,14 @@
],
"value": ""
}, {
"id": "d00ecf98-7425-467c-acbb-3b39918e3462",
"id": "863e9f5e-a3d6-47e9-8b65-de639029812a",
"comment": "",
"command": "waitForElementVisible",
"target": "css=#\\/httpMetadataResolverAttributes\\/connectionRequestTimeout-container .btn",
"targets": [],
"value": "10000"
}, {
"id": "78967fb5-8f61-46ce-9c14-9b6ceb12b03a",
"comment": "",
"command": "click",
"target": "css=#\\/httpMetadataResolverAttributes\\/connectionRequestTimeout-container .btn",
Expand All @@ -818,6 +834,13 @@
["xpath=//button[contains(.,'Toggle Dropdown')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "8277f894-0bbd-41f7-b3bb-1aba2a0f80be",
"comment": "",
"command": "waitForElementVisible",
"target": "id=/httpMetadataResolverAttributes/connectionRequestTimeout__option--1",
"targets": [],
"value": "10000"
}, {
"id": "8ba62572-354d-47f4-bb72-f9309c1cb201",
"comment": "",
Expand All @@ -844,6 +867,13 @@
["xpath=//div[2]/sf-form-element/div/sf-widget-chooser/datalist-component/div/auto-complete/div/div/div/button", "xpath:position"]
],
"value": ""
}, {
"id": "7014a534-b908-482f-85d2-7f7031741b04",
"comment": "",
"command": "waitForElementVisible",
"target": "id=/httpMetadataResolverAttributes/connectionTimeout__option--2",
"targets": [],
"value": "10000"
}, {
"id": "337ac160-7990-425f-83da-2788d8a0985e",
"comment": "",
Expand All @@ -869,6 +899,13 @@
["xpath=//div[3]/sf-form-element/div/sf-widget-chooser/datalist-component/div/auto-complete/div/div/div/button", "xpath:position"]
],
"value": ""
}, {
"id": "c28e3ee6-e536-4eb7-914b-896b2ec2cb9e",
"comment": "",
"command": "waitForElementVisible",
"target": "id=/httpMetadataResolverAttributes/socketTimeout__option--3",
"targets": [],
"value": "10000"
}, {
"id": "34693225-4754-4b27-92ee-3e37304a8cd7",
"comment": "",
Expand All @@ -893,6 +930,13 @@
["xpath=//button[contains(.,'Save')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "c3ad6c24-736a-492a-8952-b368e123d8e1",
"comment": "",
"command": "waitForElementVisible",
"target": "linkText=Test Metadata Provider",
"targets": [],
"value": "10000"
}, {
"id": "8868c054-2e6a-403e-ba2b-499a56730d71",
"comment": "",
Expand All @@ -911,7 +955,7 @@
"id": "0092cd5c-a885-4a48-a233-b3af447b02bc",
"comment": "",
"command": "click",
"target": "css=.btn-link:nth-child(1) > translate-i18n",
"target": "css=.btn-link:nth-child(1)",
"targets": [
["css=.btn-link:nth-child(1) > translate-i18n", "css:finder"],
["xpath=//div[@id='navigation']/div/a/translate-i18n", "xpath:idRelative"],
Expand Down
Loading

0 comments on commit bf64dd5

Please sign in to comment.