Skip to content

Commit

Permalink
[SHIBUI-922]
Browse files Browse the repository at this point in the history
WIP
  • Loading branch information
jj committed Nov 26, 2018
1 parent 5f624be commit 98cf437
Show file tree
Hide file tree
Showing 9 changed files with 294 additions and 563 deletions.
33 changes: 31 additions & 2 deletions backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ repositories {
url 'https://build.shibboleth.net/nexus/content/groups/public'
artifactUrls = ['https://build.shibboleth.net/nexus/content/repositories/thirdparty-snapshots']
}
mavenLocal()
}

configurations.all {
Expand All @@ -28,6 +29,16 @@ configurations.all {
}
}

configurations {
integrationTestCompile {
extendsFrom testCompile

}
integrationTestRuntime {
extendsFrom testRuntime
}
}

processResources.dependsOn(':ui:npm_run_buildProd')

//Integration of the frontend and backend into the build to have all of the UI resources available in the app's executable war
Expand Down Expand Up @@ -70,8 +81,9 @@ springBoot {
}

lombok {
version = "1.16.20"
sha256 = "c5178b18caaa1a15e17b99ba5e4023d2de2ebc18b58cde0f5a04ca4b31c10e6d"
version = "1.18.4"
//TODO: get new sha256
sha256 = ""
}

dependencies {
Expand Down Expand Up @@ -139,6 +151,8 @@ dependencies {

//JSON schema validator
compile 'org.sharegov:mjson:1.4.1'

integrationTestCompile 'com.saucelabs:sebuilder-interpreter:3.0.0-SNAPSHOT'
}

def generatedSrcDir = new File(buildDir, 'generated/src/main/java')
Expand All @@ -152,6 +166,21 @@ sourceSets {
srcDirs = []
}
}
integrationTest {
groovy {
srcDirs = ['src/integration/groovy']
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
}
resources {
srcDir 'src/integration/resources'
}
}
}

task integrationTest(type: Test) {
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
}

task generateSources {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package edu.internet2.tier.shibboleth.admin.ui

import com.sebuilder.interpreter.Script
import com.sebuilder.interpreter.factory.ScriptFactory
import com.sebuilder.interpreter.factory.StepTypeFactory
import com.sebuilder.interpreter.factory.TestRunFactory
import spock.lang.Specification
import spock.lang.Unroll

class SeleniumTest extends Specification {
@Unroll
def "#name"() {
expect:
ScriptFactory scriptFactory = new ScriptFactory().with {
it.stepTypeFactory = new StepTypeFactory()
it.testRunFactory = new TestRunFactory()
it
}
def x = this.class.getResource(file)
def scripts = scriptFactory.parse(new File(this.class.getResource(file).toURI()))
for (Script script : scripts) {
def lastRun = scriptFactory.testRunFactory.createTestRun(script)
assert lastRun.finish()
}

where:
name | file
'Create metadata source from url' | '/CreateMetaDataSourceFromURL.json'
}
}
213 changes: 213 additions & 0 deletions backend/src/integration/resources/CreateMetaDataSourceFromURL.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
{
"type": "script",
"seleniumVersion": "2",
"formatVersion": 2,
"steps": [
{
"type": "get",
"url": "http://localhost:8080"
},
{
"type": "waitForElementPresent",
"locator": {
"type": "css selector",
"value": "#addNewDropdown"
}
},
{
"type": "clickElement",
"locator": {
"type": "css selector",
"value": "#addNewDropdown"
}
},
{
"type": "waitForElementPresent",
"locator": {
"type": "css selector",
"value": "a[href=\"/metadata/resolver/new\"] > translate-i18n"
}
},
{
"type": "clickElement",
"locator": {
"type": "css selector",
"value": "a[href=\"/metadata/resolver/new\"] > translate-i18n"
}
},
{
"type": "waitForElementPresent",
"locator": {
"type": "css selector",
"value": "i.fa.fa-link"
}
},
{
"type": "clickElement",
"locator": {
"type": "css selector",
"value": "i.fa.fa-link"
}
},
{
"type": "waitForElementPresent",
"locator": {
"type": "css selector",
"value": "#serviceProviderName"
}
},
{
"type": "clickElement",
"locator": {
"type": "css selector",
"value": "#serviceProviderName"
}
},
{
"type": "waitForElementPresent",
"locator": {
"type": "css selector",
"value": "#serviceProviderName"
}
},
{
"type": "setElementText",
"locator": {
"type": "css selector",
"value": "#serviceProviderName"
},
"text": "Create Upload Using Download from XML URL"
},
{
"type": "waitForElementPresent",
"locator": {
"type": "css selector",
"value": "#serviceProviderName"
}
},
{
"type": "clickElement",
"locator": {
"type": "css selector",
"value": "#serviceProviderName"
}
},
{
"type": "waitForElementPresent",
"locator": {
"type": "css selector",
"value": "#serviceProviderName"
}
},
{
"type": "setElementText",
"locator": {
"type": "css selector",
"value": "#serviceProviderName"
},
"text": "Create Upload Using Download from URL"
},
{
"type": "waitForElementPresent",
"locator": {
"type": "css selector",
"value": "#url"
}
},
{
"type": "clickElement",
"locator": {
"type": "css selector",
"value": "#url"
}
},
{
"type": "waitForElementPresent",
"locator": {
"type": "css selector",
"value": "#url"
}
},
{
"type": "setElementText",
"locator": {
"type": "css selector",
"value": "#url"
},
"text": "https://signin.aws.amazon.com/static/saml-metadata.xml"
},
{
"type": "waitForElementPresent",
"locator": {
"type": "css selector",
"value": ".section-body > upload-resolver-form > .row"
}
},
{
"type": "clickElement",
"locator": {
"type": "css selector",
"value": ".section-body > upload-resolver-form > .row"
}
},
{
"type": "waitForElementPresent",
"locator": {
"type": "css selector",
"value": ".direction"
}
},
{
"type": "clickElement",
"locator": {
"type": "css selector",
"value": ".direction"
}
},
{
"type": "waitForElementPresent",
"locator": {
"type": "css selector",
"value": ".p-3 resolver-item > .card > .card-header > .row > .clearfix > div:nth-of-type(2)"
}
},
{
"type": "assertElementPresent",
"locator": {
"type": "css selector",
"value": ".p-3 resolver-item > .card > .card-header > .row > .clearfix > div:nth-of-type(2)"
},
"negated": false
},
{
"type": "waitForElementPresent",
"locator": {
"type": "css selector",
"value": ".p-3 resolver-item > .card > .card-header > .row > .clearfix > div:nth-of-type(2) > small.d-block"
}
},
{
"type": "clickElement",
"locator": {
"type": "css selector",
"value": ".p-3 resolver-item > .card > .card-header > .row > .clearfix > div:nth-of-type(2) > small.d-block"
}
},
{
"type": "waitForElementPresent",
"locator": {
"type": "css selector",
"value": ".p-3 resolver-item > .card > .collapse > .card-body > .row > div:nth-of-type(1) > .row:nth-of-type(2) > .col:nth-of-type(2)"
}
},
{
"type": "assertText",
"locator": {
"type": "css selector",
"value": ".p-3 resolver-item > .card > .collapse > .card-body > .row > div:nth-of-type(1) > .row:nth-of-type(2) > .col:nth-of-type(2)"
},
"text": "urn:amazon:webservices",
"negated": false
}
]
}
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
task wrapper(type: Wrapper) {
gradleVersion = 4.6
gradleVersion = '4.8.1'
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Sep 12 16:59:56 CDT 2017
#Mon Nov 26 11:20:36 CST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-all.zip
26 changes: 17 additions & 9 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

##############################################################################
##
Expand Down Expand Up @@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
Expand Down Expand Up @@ -154,11 +154,19 @@ if $cygwin ; then
esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
APP_ARGS=$(save "$@")

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
6 changes: 0 additions & 6 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ goto fail
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
Expand All @@ -60,11 +59,6 @@ set _SKIP=2
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line
Expand Down
Loading

0 comments on commit 98cf437

Please sign in to comment.