From 15cecc1da50c4a90ead17e6b83b120b9e2b6ceac Mon Sep 17 00:00:00 2001 From: Bill Smith Date: Thu, 29 Jul 2021 14:20:00 -0700 Subject: [PATCH] SHIBUI-1740 More test fixes. --- .../admin/ui/SeleniumSIDETest.groovy | 11 +- .../integration/resources/SHIBUI-1740-3.side | 14 -- .../integration/resources/SHIBUI-1740-4.side | 21 +++ .../integration/resources/SHIBUI-1740-5.side | 124 ------------------ .../support/RestControllersSupport.java | 1 - 5 files changed, 26 insertions(+), 145 deletions(-) delete mode 100644 backend/src/integration/resources/SHIBUI-1740-5.side 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 8f47b85d9..f63de0276 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 @@ -15,7 +15,7 @@ import java.nio.file.Paths //TODO: make config configurable @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = [ShibbolethUiApplication]) -@ActiveProfiles(['dev']) +@ActiveProfiles(['dev', 'very-dangerous']) @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD, methodMode = DirtiesContext.MethodMode.AFTER_METHOD) class SeleniumSIDETest extends Specification { @Value('${local.server.port}') @@ -127,11 +127,10 @@ class SeleniumSIDETest extends Specification { 'SHIBUI-1503: Non-admin can create metadata source' | '/SHIBUI-1503-1.side' 'SHIBUI-1503: User can be deleted' | '/SHIBUI-1503-2.side' 'SHIBUI-1503: User can be enabled' | '/SHIBUI-1503-3.side'*/ -// 'SHIBUI-1740: Group can be created, edited, deleted' | '/SHIBUI-1740-1.side' -// 'SHIBUI-1740: Verify dev profile group membership' | '/SHIBUI-1740-2.side' -// 'SHIBUI-1740: Verify admin-owned resource not visible to nonadmins' | '/SHIBUI-1740-3.side' -// 'SHIBUI-1740: Verify nonadmin-owned resource visibility' | '/SHIBUI-1740-4.side' - 'Test' | '/SHIBUI-1740-5.side' + 'SHIBUI-1740: Group can be created, edited, deleted' | '/SHIBUI-1740-1.side' + 'SHIBUI-1740: Verify dev profile group membership' | '/SHIBUI-1740-2.side' + 'SHIBUI-1740: Verify admin-owned resource not visible to nonadmins' | '/SHIBUI-1740-3.side' + 'SHIBUI-1740: Verify nonadmin-owned resource visibility' | '/SHIBUI-1740-4.side' } } diff --git a/backend/src/integration/resources/SHIBUI-1740-3.side b/backend/src/integration/resources/SHIBUI-1740-3.side index 755792e64..2a026c9b1 100644 --- a/backend/src/integration/resources/SHIBUI-1740-3.side +++ b/backend/src/integration/resources/SHIBUI-1740-3.side @@ -52,13 +52,6 @@ ["xpath=//p[2]/input", "xpath:position"] ], "value": "${KEY_ENTER}" - }, { - "id": "3cbf8848-2e22-42cc-b5f9-aa289ad5cab6", - "comment": "", - "command": "pause", - "target": "5000", - "targets": [], - "value": "" }, { "id": "b64a0533-2175-4578-baeb-7ca4e97e0e23", "comment": "", @@ -66,13 +59,6 @@ "target": "/api/heheheheheheheWipeout", "targets": [], "value": "" - }, { - "id": "70533c84-e78f-491e-aa4e-1c1e9f48b62e", - "comment": "", - "command": "pause", - "target": "5000", - "targets": [], - "value": "" }, { "id": "7580df7e-845d-4cf9-8ea8-116951d565fd", "comment": "", diff --git a/backend/src/integration/resources/SHIBUI-1740-4.side b/backend/src/integration/resources/SHIBUI-1740-4.side index 2bdd98022..43f7421c9 100644 --- a/backend/src/integration/resources/SHIBUI-1740-4.side +++ b/backend/src/integration/resources/SHIBUI-1740-4.side @@ -52,6 +52,27 @@ ["xpath=//p[2]/input", "xpath:position"] ], "value": "${KEY_ENTER}" + }, { + "id": "d54e0170-3343-47d5-8541-b613372ef431", + "comment": "", + "command": "open", + "target": "/api/heheheheheheheWipeout", + "targets": [], + "value": "" + }, { + "id": "74ecfbbb-07d0-420f-abb9-895b68015645", + "comment": "", + "command": "assertText", + "target": "css=body", + "targets": [], + "value": "yes, you did it" + }, { + "id": "299da7ff-9249-4d12-82f8-492eb1739d2b", + "comment": "", + "command": "open", + "target": "/", + "targets": [], + "value": "" }, { "id": "6fb9efa3-c73e-4d27-82e6-28b25bf4fb60", "comment": "", diff --git a/backend/src/integration/resources/SHIBUI-1740-5.side b/backend/src/integration/resources/SHIBUI-1740-5.side deleted file mode 100644 index 58ea846c2..000000000 --- a/backend/src/integration/resources/SHIBUI-1740-5.side +++ /dev/null @@ -1,124 +0,0 @@ -{ - "id": "ea976175-c1e1-4343-8a2d-5d3ab5f46dd3", - "version": "2.0", - "name": "SHIBUI-1740-5", - "url": "http://localhost:10101", - "tests": [{ - "id": "6620cf28-a342-44aa-9422-4a5bea8e4800", - "name": "SHIBUI-1740-5", - "commands": [{ - "id": "4a51946b-2259-45ca-997d-1bb0930ea832", - "comment": "", - "command": "open", - "target": "/login", - "targets": [], - "value": "" - }, { - "id": "d53e2e3b-a7ee-4d57-80dc-e979ce6deb83", - "comment": "", - "command": "type", - "target": "id=username", - "targets": [ - ["id=username", "id"], - ["name=username", "name"], - ["css=#username", "css:finder"], - ["xpath=//input[@id='username']", "xpath:attributes"], - ["xpath=//input", "xpath:position"] - ], - "value": "admin" - }, { - "id": "553fb80f-e533-4a0f-8989-e279e82e9fdb", - "comment": "", - "command": "type", - "target": "id=password", - "targets": [ - ["id=password", "id"], - ["name=password", "name"], - ["css=#password", "css:finder"], - ["xpath=//input[@id='password']", "xpath:attributes"], - ["xpath=//p[2]/input", "xpath:position"] - ], - "value": "adminpass" - }, { - "id": "2e83dce2-4da8-49cb-9d42-abede783df42", - "comment": "", - "command": "sendKeys", - "target": "id=password", - "targets": [ - ["id=password", "id"], - ["name=password", "name"], - ["css=#password", "css:finder"], - ["xpath=//input[@id='password']", "xpath:attributes"], - ["xpath=//p[2]/input", "xpath:position"] - ], - "value": "${KEY_ENTER}" - }, { - "id": "42defc30-1ef1-44ef-a031-bf4f21b4c112", - "comment": "", - "command": "pause", - "target": "5000", - "targets": [], - "value": "" - }, { - "id": "0c5ae682-8d12-4678-9cc0-cbb6a8b2e3f2", - "comment": "", - "command": "open", - "target": "/api/heheheheheheheWipeout", - "targets": [], - "value": "" - }, { - "id": "ef90d28e-7d54-4d24-a58a-a4d497f0328d", - "comment": "", - "command": "pause", - "target": "5000", - "targets": [], - "value": "" - }, { - "id": "e7c62345-0703-4e15-b8cf-2ba5ad16a92b", - "comment": "", - "command": "assertText", - "target": "css=body", - "targets": [], - "value": "yes, you did it" - }, { - "id": "94475727-61c3-4e98-8314-b26e25acc014", - "comment": "", - "command": "pause", - "target": "5000", - "targets": [], - "value": "" - }, { - "id": "562f7523-f424-4e09-b26a-64677463e517", - "comment": "", - "command": "open", - "target": "/", - "targets": [], - "value": "" - }, { - "id": "8cb52fe6-205b-4619-b90e-ab6618483bcd", - "comment": "", - "command": "click", - "target": "linkText=Logout", - "targets": [ - ["linkText=Logout", "linkText"], - ["css=.nav-link:nth-child(4)", "css:finder"], - ["xpath=//a[contains(text(),'Logout')]", "xpath:link"], - ["xpath=//div[@id='basic-navbar-nav']/div/a[2]", "xpath:idRelative"], - ["xpath=//a[contains(@href, '/logout')]", "xpath:href"], - ["xpath=//a[2]", "xpath:position"], - ["xpath=//a[contains(.,'Logout')]", "xpath:innerText"] - ], - "value": "" - }] - }], - "suites": [{ - "id": "5716f2b9-5348-4844-9d8c-e1433c1b12cd", - "name": "Default Suite", - "persistSession": false, - "parallel": false, - "timeout": 300, - "tests": ["6620cf28-a342-44aa-9422-4a5bea8e4800"] - }], - "urls": ["http://localhost:10101/"], - "plugins": [] -} \ No newline at end of file diff --git a/backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/controller/support/RestControllersSupport.java b/backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/controller/support/RestControllersSupport.java index e0dc113b0..c908bd862 100644 --- a/backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/controller/support/RestControllersSupport.java +++ b/backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/controller/support/RestControllersSupport.java @@ -50,7 +50,6 @@ public ResponseEntity handleDatabaseConstraintViolation(Constrain @ExceptionHandler(Exception.class) public final ResponseEntity handleAllOtherExceptions(Exception ex) { - System.err.println(ex); ErrorResponse errorResponse = new ErrorResponse("400", ex.getLocalizedMessage(), ex.getCause() == null ? null : ex.getCause().getLocalizedMessage()); return new ResponseEntity<>(errorResponse, HttpStatus.BAD_REQUEST); }