Skip to content

Commit

Permalink
Merged in feature/shibui-2394 (pull request #621)
Browse files Browse the repository at this point in the history
Feature/shibui 2394

Approved-by: Dmitriy Kopylenko
Approved-by: Doug Sonaty
Approved-by: Bill Smith
  • Loading branch information
chasegawa committed Nov 15, 2022
2 parents 7f48a17 + f8329db commit 541fae2
Show file tree
Hide file tree
Showing 120 changed files with 3,524 additions and 872 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -415,3 +415,8 @@ beacon/spring/out
/a.xml
/application.yml
/backend/src/test/resources/conf/deletem.xml
/testbed/authentication/shibui/saml-signing-cert.crt
/testbed/authentication/shibui/saml-signing-cert.key
/testbed/authentication/shibui/saml-signing-cert.pem
/testbed/authentication/shibui/samlKeystore.jks
/testbed/authentication/shibui/sp-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import edu.internet2.tier.shibboleth.admin.ui.domain.filters.EntityAttributesFil
import edu.internet2.tier.shibboleth.admin.ui.domain.filters.EntityRoleWhiteListFilter
import edu.internet2.tier.shibboleth.admin.ui.domain.filters.NameIdFormatFilter
import edu.internet2.tier.shibboleth.admin.ui.domain.filters.NameIdFormatFilterTarget
import edu.internet2.tier.shibboleth.admin.ui.domain.filters.SignatureValidationFilter
import edu.internet2.tier.shibboleth.admin.ui.domain.resolvers.DynamicHttpMetadataResolver
import edu.internet2.tier.shibboleth.admin.ui.domain.resolvers.FileBackedHttpMetadataResolver
import edu.internet2.tier.shibboleth.admin.ui.domain.resolvers.FilesystemMetadataResolver
Expand All @@ -19,13 +18,9 @@ import edu.internet2.tier.shibboleth.admin.ui.domain.resolvers.MetadataResolver
import edu.internet2.tier.shibboleth.admin.ui.domain.resolvers.RegexScheme
import edu.internet2.tier.shibboleth.admin.ui.domain.resolvers.TemplateScheme
import edu.internet2.tier.shibboleth.admin.ui.repository.MetadataResolverRepository

import edu.internet2.tier.shibboleth.admin.ui.service.MetadataResolverVersionService
import edu.internet2.tier.shibboleth.admin.ui.util.TestObjectGenerator
import edu.internet2.tier.shibboleth.admin.util.AttributeUtility

import org.apache.commons.lang3.RandomStringUtils

import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.boot.test.web.client.TestRestTemplate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ import javax.persistence.EntityManager

import static edu.internet2.tier.shibboleth.admin.ui.domain.resolvers.HttpMetadataResolverAttributes.HttpCachingType.file
import static edu.internet2.tier.shibboleth.admin.ui.domain.resolvers.HttpMetadataResolverAttributes.HttpCachingType.none
import static edu.internet2.tier.shibboleth.admin.ui.repository.envers.EnversTestsSupport.*
import static edu.internet2.tier.shibboleth.admin.ui.repository.envers.EnversTestsSupport.getModifiedEntityNames
import static edu.internet2.tier.shibboleth.admin.ui.repository.envers.EnversTestsSupport.getRevisionEntityForRevisionIndex
import static edu.internet2.tier.shibboleth.admin.ui.repository.envers.EnversTestsSupport.getTargetEntityForRevisionIndex
import static edu.internet2.tier.shibboleth.admin.ui.repository.envers.EnversTestsSupport.updateAndGetRevisionHistoryOfMetadataResolver

/**
* Testing metadata resolver envers versioning
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@

package com.sebuilder.interpreter.webdriverfactory;

import java.io.File;
import java.util.HashMap;
import org.openqa.selenium.firefox.FirefoxBinary;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxOptions;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;

import java.io.File;
import java.util.HashMap;

public class Firefox implements WebDriverFactory {
/**
* @param config Key/value pairs treated as required capabilities, with the exception of:
Expand All @@ -50,4 +51,4 @@ public RemoteWebDriver make(HashMap<String, String> config) {
options.setBinary(fb);
return new FirefoxDriver(options);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,12 @@ class SeleniumSIDETest extends Specification {
'SHIBUI-2267: Verify new RPO CRUD' | '/SHIBUI-2267.side'
'SHIBUI-2380: OIDC metadata source CRUD' | '/SHIBUI-2380.side'
'SHIBUI-1674: Verify metadata source tooltips' | '/SHIBUI-1674-1.side'
// 'SHIBUI-1674: Verify metadata provider tooltips' | '/SHIBUI-1674-2.side'
'SHIBUI-1674: Verify metadata provider tooltips' | '/SHIBUI-1674-2.side'
'SHIBUI-1674: Verify advanced menu tooltips' | '/SHIBUI-1674-3.side'
'SHIBUI-2270: Verify property set CRUD' | '/SHIBUI-2270-1.side'
'SHIBUI-2270: Verify full property set' | '/SHIBUI-2270-2.side'
'SHIBUI-2394: Multiple levels of approval' | '/SHIBUI-2394.side'
'SHIBUI-2268: Verify Algorithm Filter' | '/SHIBUI-2268.side'
'SHIBUI-2269: Verify XML generation of external filters' | '/SHIBUI-2269.side'
'SHIBUI-2269: Verify XML generation of external filters' | '/SHIBUI-2269.side' // Leave this as the last test in order to keep the suite running without strange errors.
}
}
}
66 changes: 32 additions & 34 deletions backend/src/integration/groovy/jp/vmi/selenium/selenese/Runner.java
Original file line number Diff line number Diff line change
@@ -1,38 +1,7 @@
package jp.vmi.selenium.selenese;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Deque;
import java.util.EnumSet;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.output.NullOutputStream;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.FastDateFormat;
import org.openqa.selenium.Alert;
import org.openqa.selenium.HasCapabilities;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.remote.Augmenter;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.assertthat.selenium_shutterbug.core.Shutterbug;
import com.assertthat.selenium_shutterbug.utils.web.ScrollStrategy;

import jp.vmi.html.result.HtmlResult;
import jp.vmi.html.result.HtmlResultHolder;
import jp.vmi.junit.result.JUnitResult;
Expand All @@ -55,9 +24,38 @@
import jp.vmi.selenium.selenese.utils.MouseUtils;
import jp.vmi.selenium.selenese.utils.PathUtils;
import jp.vmi.selenium.webdriver.WebDriverPreparator;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.output.NullOutputStream;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.FastDateFormat;
import org.openqa.selenium.Alert;
import org.openqa.selenium.HasCapabilities;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.remote.Augmenter;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Deque;
import java.util.EnumSet;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;

import static jp.vmi.selenium.selenese.result.Unexecuted.*;
import static org.openqa.selenium.remote.CapabilityType.*;
import static jp.vmi.selenium.selenese.result.Unexecuted.UNEXECUTED;
import static org.openqa.selenium.remote.CapabilityType.TAKES_SCREENSHOT;

/**
* Provide Java API to run Selenese script.
Expand Down Expand Up @@ -851,4 +849,4 @@ public void unhighlight() {
void setupMaxTimeTimer(long maxTime) {
this.maxTimeTimer = new MaxTimeActiveTimer(maxTime);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,24 @@

package jp.vmi.selenium.selenese.command;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;

import org.apache.commons.io.FilenameUtils;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.io.TemporaryFilesystem;

import com.google.common.io.Resources;

import jp.vmi.selenium.selenese.Context;
import jp.vmi.selenium.selenese.result.Error;
import jp.vmi.selenium.selenese.result.Result;
import jp.vmi.selenium.selenese.result.Warning;
import org.apache.commons.io.FilenameUtils;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.io.TemporaryFilesystem;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;

import static jp.vmi.selenium.selenese.command.ArgumentType.*;
import static jp.vmi.selenium.selenese.result.Success.*;
import static jp.vmi.selenium.selenese.command.ArgumentType.LOCATOR;
import static jp.vmi.selenium.selenese.command.ArgumentType.VALUE;
import static jp.vmi.selenium.selenese.result.Success.SUCCESS;

/**
* Re-implementation of AttachFile.
Expand Down Expand Up @@ -109,4 +108,4 @@ protected Result executeImpl(Context context, String... curArgs) {
element.sendKeys(outputTo.getAbsolutePath());
return SUCCESS;
}
}
}
2 changes: 1 addition & 1 deletion backend/src/integration/resources/SHIBUI-1334-1.side
Original file line number Diff line number Diff line change
Expand Up @@ -2748,7 +2748,7 @@
"id": "bde2bbbb-df66-4e07-a770-ec9125fe3e81",
"comment": "",
"command": "pause",
"target": "7000",
"target": "10000",
"targets": [],
"value": ""
}, {
Expand Down
4 changes: 2 additions & 2 deletions backend/src/integration/resources/SHIBUI-1407-1.side
Original file line number Diff line number Diff line change
Expand Up @@ -2461,7 +2461,7 @@
"id": "4dbf4b6f-7de9-49e1-a23f-ff748f5a986b",
"comment": "",
"command": "pause",
"target": "7000",
"target": "10000",
"targets": [],
"value": ""
}, {
Expand Down Expand Up @@ -2514,7 +2514,7 @@
"id": "39637add-5eb4-40d0-b840-8eb1972ede0f",
"comment": "",
"command": "pause",
"target": "10000",
"target": "15000",
"targets": [],
"value": ""
}, {
Expand Down
16 changes: 16 additions & 0 deletions backend/src/integration/resources/SHIBUI-1503-1.side
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,22 @@
["xpath=//div[4]/a", "xpath:position"]
],
"value": ""
}, {
"id": "a43898de-b92d-443e-8686-fba526f403ec",
"comment": "",
"command": "click",
"target": "id=enable-btn",
"targets": [
["id=enable-btn", "id"],
["linkText=Enable Metadata Sources1", "linkText"],
["css=#enable-btn", "css:finder"],
["xpath=//a[@id='enable-btn']", "xpath:attributes"],
["xpath=//div[@id='root']/div/main/div/section/div/div[2]/div/div/a", "xpath:idRelative"],
["xpath=//a[contains(@href, '/dashboard/admin/actions/enable')]", "xpath:href"],
["xpath=//div[2]/div/div/a", "xpath:position"],
["xpath=//a[contains(.,'Enable Metadata Sources1')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "b1a8c4b1-d164-4f32-adb3-6cfb76951f28",
"comment": "",
Expand Down
16 changes: 16 additions & 0 deletions backend/src/integration/resources/SHIBUI-1503-2.side
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,22 @@
"target": "css=.nav-item > .d-flex",
"targets": [],
"value": ""
}, {
"id": "1f9a1cc1-00d5-4ecd-a0d1-3cec1683286d",
"comment": "",
"command": "click",
"target": "id=user-access-btn",
"targets": [
["id=user-access-btn", "id"],
["linkText=User Access Request2", "linkText"],
["css=#user-access-btn", "css:finder"],
["xpath=//a[@id='user-access-btn']", "xpath:attributes"],
["xpath=//div[@id='root']/div/main/div/section/div/div[2]/div/div[3]/a", "xpath:idRelative"],
["xpath=//a[contains(@href, '/dashboard/admin/actions/useraccess')]", "xpath:href"],
["xpath=//div[2]/div/div[3]/a", "xpath:position"],
["xpath=//a[contains(.,'User Access Request2')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "a98143b5-647f-4e7e-b920-f6e6875d7372",
"comment": "",
Expand Down
38 changes: 19 additions & 19 deletions backend/src/integration/resources/SHIBUI-1503-3.side
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@
"id": "659e4909-239b-4895-aa54-8bf3a6bd57cd",
"comment": "",
"command": "waitForElementVisible",
"target": "xpath=//table/tbody/tr[td[.='none2']]",
"target": "xpath=//table/tbody/tr[td[.='Approver']]",
"targets": [],
"value": "30000"
}, {
"id": "dc06ff49-c076-4f60-95d1-a42514cc6038",
"comment": "",
"command": "select",
"target": "xpath=//table/tbody/tr[td[.='none2']]/td[4]/select",
"target": "xpath=//table/tbody/tr[td[.='Approver']]/td[4]/select",
"targets": [],
"value": "label=ROLE_USER"
}, {
Expand Down Expand Up @@ -168,7 +168,7 @@
["xpath=//input[@name='username']", "xpath:attributes"],
["xpath=//input", "xpath:position"]
],
"value": "none2"
"value": "Approver"
}, {
"id": "c8bf8ea5-1f75-4a40-aca4-9dfa6a6056dc",
"comment": "",
Expand All @@ -180,7 +180,7 @@
["xpath=//input[@name='password']", "xpath:attributes"],
["xpath=//tr[2]/td[2]/input", "xpath:position"]
],
"value": "none2pass"
"value": "password"
}, {
"id": "ba66c45f-2436-4fe7-a5a9-31b55ffe8118",
"comment": "",
Expand Down Expand Up @@ -214,21 +214,21 @@
["xpath=//a[contains(.,'Metadata Sources')]", "xpath:innerText"]
],
"value": "Metadata Sources"
},{
"id": "4ec2c493-85e4-403b-9b09-031c5728f498",
"comment": "",
"command": "open",
"target": "/api/heheheheheheheWipeout",
"targets": [],
"value": ""
}, {
"id": "e074980a-8f21-4c22-8412-c4b6fcdcd1a4",
"comment": "",
"command": "assertText",
"target": "css=body",
"targets": [],
"value": "yes, you did it"
}]
}, {
"id": "4ec2c493-85e4-403b-9b09-031c5728f498",
"comment": "",
"command": "open",
"target": "/api/heheheheheheheWipeout",
"targets": [],
"value": ""
}, {
"id": "e074980a-8f21-4c22-8412-c4b6fcdcd1a4",
"comment": "",
"command": "assertText",
"target": "css=body",
"targets": [],
"value": "yes, you did it"
}]
}],
"suites": [{
"id": "173aaf44-c763-416e-ab3c-d5afd5ffcd29",
Expand Down
Loading

0 comments on commit 541fae2

Please sign in to comment.