From 3214fffa3b578a2a714381cfe91a382b6c12003d Mon Sep 17 00:00:00 2001 From: Bill Smith Date: Thu, 16 Sep 2021 14:32:41 -0700 Subject: [PATCH] 2052 Fixed a couple more tests that had related bugfixes that made it in to develop. --- .../admin/ui/SeleniumSIDETest.groovy | 2 +- .../integration/resources/SHIBUI-1503-1.side | 99 +++++++++++------ .../integration/resources/SHIBUI-1503-2.side | 100 ++++++++++++++++-- 3 files changed, 163 insertions(+), 38 deletions(-) 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 d9f3dc581..2c410b484 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 @@ -125,8 +125,8 @@ 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-2052: Logged in user & role appear on dashboard' | '/SHIBUI-2052.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-1503-1.side b/backend/src/integration/resources/SHIBUI-1503-1.side index 2e1fd3127..83105740a 100644 --- a/backend/src/integration/resources/SHIBUI-1503-1.side +++ b/backend/src/integration/resources/SHIBUI-1503-1.side @@ -38,13 +38,14 @@ "id": "5a5d0684-7d38-4fde-8038-733fd8ffa232", "comment": "", "command": "waitForElementVisible", - "target": "id=dropdown-basic", + "target": "id=metadata-nav-dropdown-toggle", "targets": [ - ["id=dropdown-basic", "id"], - ["xpath=//button[@id='dropdown-basic']", "xpath:attributes"], - ["xpath=//div[@id='basic-nav-dropdown']/button", "xpath:idRelative"], - ["xpath=//div/button", "xpath:position"], - ["xpath=//button[contains(.,'Advanced')]", "xpath:innerText"] + ["id=metadata-nav-dropdown-toggle", "id"], + ["css=#metadata-nav-dropdown-toggle", "css:finder"], + ["xpath=//button[@id='metadata-nav-dropdown-toggle']", "xpath:attributes"], + ["xpath=//div[@id='metadata-nav-dropdown']/button", "xpath:idRelative"], + ["xpath=//div[2]/button", "xpath:position"], + ["xpath=//button[contains(.,'Add New')]", "xpath:innerText"] ], "value": "30000" }, { @@ -68,18 +69,34 @@ "target": "/dashboard", "targets": [], "value": "" + }, { + "id": "d0ef9e1d-b756-4618-bb54-2d1212b95f81", + "comment": "", + "command": "click", + "target": "id=user-nav-dropdown-toggle", + "targets": [ + ["id=user-nav-dropdown-toggle", "id"], + ["css=#user-nav-dropdown-toggle", "css:finder"], + ["xpath=//button[@id='user-nav-dropdown-toggle']", "xpath:attributes"], + ["xpath=//div[@id='user-nav-dropdown']/button", "xpath:idRelative"], + ["xpath=//div[4]/button", "xpath:position"], + ["xpath=//button[contains(.,'Logged in as admin')]", "xpath:innerText"] + ], + "value": "" }, { "id": "01957ac4-2039-4331-80d3-c8ce382321b0", "comment": "", "command": "click", - "target": "linkText=Logout", + "target": "id=user-nav-dropdown-logout", "targets": [ + ["id=user-nav-dropdown-logout", "id"], ["linkText=Logout", "linkText"], - ["css=.nav-link:nth-child(4)", "css:finder"], + ["css=#user-nav-dropdown-logout", "css:finder"], ["xpath=//a[contains(text(),'Logout')]", "xpath:link"], - ["xpath=//div[@id='basic-navbar-nav']/div/a[2]", "xpath:idRelative"], + ["xpath=//a[@id='user-nav-dropdown-logout']", "xpath:attributes"], + ["xpath=//div[@id='user-nav-dropdown']/div/a", "xpath:idRelative"], ["xpath=//a[contains(@href, '/logout')]", "xpath:href"], - ["xpath=//a[2]", "xpath:position"], + ["xpath=//div[4]/div/a", "xpath:position"], ["xpath=//a[contains(.,'Logout')]", "xpath:innerText"] ], "value": "" @@ -123,13 +140,13 @@ "id": "db912e0e-b9c9-4693-92cf-a43a9756d253", "comment": "", "command": "waitForElementVisible", - "target": "id=dropdown-basic", + "target": "id=metadata-nav-dropdown-toggle", "targets": [ - ["id=dropdown-basic", "id"], - ["css=#dropdown-basic", "css:finder"], - ["xpath=//button[@id='dropdown-basic']", "xpath:attributes"], - ["xpath=//div[@id='basic-nav-dropdown']/button", "xpath:idRelative"], - ["xpath=//div/button", "xpath:position"], + ["id=metadata-nav-dropdown-toggle", "id"], + ["css=#metadata-nav-dropdown-toggle", "css:finder"], + ["xpath=//button[@id='metadata-nav-dropdown-toggle']", "xpath:attributes"], + ["xpath=//div[@id='metadata-nav-dropdown']/button", "xpath:idRelative"], + ["xpath=//div[2]/button", "xpath:position"], ["xpath=//button[contains(.,'Add New')]", "xpath:innerText"] ], "value": "30000" @@ -137,26 +154,30 @@ "id": "fcb0a214-ead2-407e-b2b2-ddac954e1348", "comment": "", "command": "click", - "target": "id=dropdown-basic", + "target": "id=metadata-nav-dropdown-toggle", "targets": [ - ["css=#addNewDropdown > translate-i18n", "css:finder"], - ["xpath=//button[@id='addNewDropdown']/translate-i18n", "xpath:idRelative"], - ["xpath=//translate-i18n", "xpath:position"], - ["xpath=//translate-i18n[contains(.,'Add New')]", "xpath:innerText"] + ["id=metadata-nav-dropdown-toggle", "id"], + ["css=#metadata-nav-dropdown-toggle", "css:finder"], + ["xpath=//button[@id='metadata-nav-dropdown-toggle']", "xpath:attributes"], + ["xpath=//div[@id='metadata-nav-dropdown']/button", "xpath:idRelative"], + ["xpath=//div[2]/button", "xpath:position"], + ["xpath=//button[contains(.,'Add New')]", "xpath:innerText"] ], "value": "" }, { "id": "837ce33c-8787-4b31-9f8c-d250e5fae525", "comment": "", "command": "click", - "target": "linkText=Add a new metadata source", + "target": "id=metadata-nav-dropdown-source", "targets": [ + ["id=metadata-nav-dropdown-source", "id"], ["linkText=Add a new metadata source", "linkText"], - ["css=.text-primary", "css:finder"], + ["css=#metadata-nav-dropdown-source", "css:finder"], ["xpath=//a[contains(text(),'Add a new metadata source')]", "xpath:link"], - ["xpath=//div[@id='basic-nav-dropdown']/div/a", "xpath:idRelative"], + ["xpath=//a[@id='metadata-nav-dropdown-source']", "xpath:attributes"], + ["xpath=//div[@id='metadata-nav-dropdown']/div/a", "xpath:idRelative"], ["xpath=//a[contains(@href, '/metadata/source/new')]", "xpath:href"], - ["xpath=//div/a", "xpath:position"], + ["xpath=//div[2]/div/a", "xpath:position"], ["xpath=//a[contains(.,'Add a new metadata source')]", "xpath:innerText"] ], "value": "" @@ -359,18 +380,34 @@ "target": "5000", "targets": [], "value": "" + }, { + "id": "36d1a730-3d4f-4be4-a9b0-0ea6bc59114f", + "comment": "", + "command": "click", + "target": "id=user-nav-dropdown-toggle", + "targets": [ + ["id=user-nav-dropdown-toggle", "id"], + ["css=#user-nav-dropdown-toggle", "css:finder"], + ["xpath=//button[@id='user-nav-dropdown-toggle']", "xpath:attributes"], + ["xpath=//div[@id='user-nav-dropdown']/button", "xpath:idRelative"], + ["xpath=//div[3]/button", "xpath:position"], + ["xpath=//button[contains(.,'Logged in as nonadmin')]", "xpath:innerText"] + ], + "value": "" }, { "id": "e9a8182c-47d9-444c-8386-f84e1a7da38a", "comment": "", "command": "click", - "target": "linkText=Logout", + "target": "id=user-nav-dropdown-logout", "targets": [ + ["id=user-nav-dropdown-logout", "id"], ["linkText=Logout", "linkText"], - ["css=.nav-link:nth-child(3)", "css:finder"], + ["css=#user-nav-dropdown-logout", "css:finder"], ["xpath=//a[contains(text(),'Logout')]", "xpath:link"], - ["xpath=//div[@id='basic-navbar-nav']/div/a[2]", "xpath:idRelative"], + ["xpath=//a[@id='user-nav-dropdown-logout']", "xpath:attributes"], + ["xpath=//div[@id='user-nav-dropdown']/div/a", "xpath:idRelative"], ["xpath=//a[contains(@href, '/logout')]", "xpath:href"], - ["xpath=//a[2]", "xpath:position"], + ["xpath=//div[3]/div/a", "xpath:position"], ["xpath=//a[contains(.,'Logout')]", "xpath:innerText"] ], "value": "" @@ -441,7 +478,7 @@ ["xpath=//li[4]/a/span", "xpath:position"], ["xpath=//span[contains(.,'2')]", "xpath:innerText"] ], - "value": "2" + "value": "3" }, { "id": "9be511e0-ed11-4707-8490-6fa248e4138e", "comment": "", @@ -532,7 +569,7 @@ ["xpath=//li[4]/a/span", "xpath:position"], ["xpath=//span[contains(.,'1')]", "xpath:innerText"] ], - "value": "1" + "value": "2" }, { "id": "3f92b1a1-9675-4da3-90d5-475a89a22913", "comment": "", diff --git a/backend/src/integration/resources/SHIBUI-1503-2.side b/backend/src/integration/resources/SHIBUI-1503-2.side index 408f5648d..8f7050f58 100644 --- a/backend/src/integration/resources/SHIBUI-1503-2.side +++ b/backend/src/integration/resources/SHIBUI-1503-2.side @@ -49,6 +49,27 @@ ["xpath=//button[contains(.,'Sign in')]", "xpath:innerText"] ], "value": "" + }, { + "id": "ba3c21fe-bd14-45c9-a77c-47db7f261e89", + "comment": "", + "command": "open", + "target": "/api/heheheheheheheWipeout", + "targets": [], + "value": "" + }, { + "id": "5486f406-5e1d-49e4-989b-58b164778110", + "comment": "", + "command": "assertText", + "target": "css=body", + "targets": [], + "value": "yes, you did it" + }, { + "id": "c1397f74-17dd-4cf2-b49d-391b89c877a4", + "comment": "", + "command": "open", + "target": "/", + "targets": [], + "value": "" }, { "id": "812843b9-c71a-4141-b204-3387f0fee39a", "comment": "", @@ -87,10 +108,61 @@ "target": "css=.modal-footer > .btn-danger", "targets": [ ["css=.modal-footer > .btn-danger", "css:finder"], - ["xpath=(//button[@type='button'])[2]", "xpath:attributes"], - ["xpath=//div[3]/button", "xpath:position"] + ["xpath=(//button[@type='button'])[7]", "xpath:attributes"], + ["xpath=//div[5]/div/div/div[3]/button", "xpath:position"] ], "value": "" + }, { + "id": "a024bec1-b14e-456a-9f59-3a08b49f463a", + "comment": "", + "command": "waitForElementVisible", + "target": "xpath=//div[@role=\"alert\" and contains(., \"User deleted.\")]", + "targets": [], + "value": "30000" + }, { + "id": "d995f269-813b-487d-98dc-e730911643c1", + "comment": "", + "command": "waitForElementNotPresent", + "target": "xpath=//div[@role=\"alert\" and contains(., \"User deleted.\")]", + "targets": [], + "value": "30000" + }, { + "id": "fc07efd6-4f50-42d1-88ac-538fb9a02ce4", + "comment": "", + "command": "click", + "target": "css=.btn > span", + "targets": [ + ["css=.btn > span", "css:finder"], + ["xpath=//div[@id='root']/div/main/div/section[2]/div/div[2]/div/div/div/div[2]/button/span", "xpath:idRelative"], + ["xpath=//div[2]/button/span", "xpath:position"], + ["xpath=//span[contains(.,'Delete Request')]", "xpath:innerText"] + ], + "value": "" + }, { + "id": "cd32d898-adab-4ac8-8cf6-cf1a3b970396", + "comment": "", + "command": "click", + "target": "css=.modal-footer > .btn-danger", + "targets": [ + ["css=.modal-footer > .btn-danger", "css:finder"], + ["xpath=(//button[@type='button'])[7]", "xpath:attributes"], + ["xpath=//div[5]/div/div/div[3]/button", "xpath:position"] + ], + "value": "" + }, { + "id": "43bd7acf-67cf-4b52-87f8-0c049f7ec707", + "comment": "", + "command": "waitForElementVisible", + "target": "xpath=//div[@role=\"alert\" and contains(., \"User deleted.\")]", + "targets": [], + "value": "30000" + }, { + "id": "617dd2b1-f8e4-4d8d-ad2c-ce2ec1b9ad13", + "comment": "", + "command": "waitForElementNotPresent", + "target": "xpath=//div[@role=\"alert\" and contains(., \"User deleted.\")]", + "targets": [], + "value": "30000" }, { "id": "2d8da370-0a5a-4048-a8bd-f68210a271c5", "comment": "", @@ -114,18 +186,34 @@ ["xpath=//p[contains(.,'There are no new user requests at this time.')]", "xpath:innerText"] ], "value": "There are no new user requests at this time." + }, { + "id": "e406c422-d086-43e8-9c31-1b83177368ac", + "comment": "", + "command": "click", + "target": "id=user-nav-dropdown-toggle", + "targets": [ + ["id=user-nav-dropdown-toggle", "id"], + ["css=#user-nav-dropdown-toggle", "css:finder"], + ["xpath=//button[@id='user-nav-dropdown-toggle']", "xpath:attributes"], + ["xpath=//div[@id='user-nav-dropdown']/button", "xpath:idRelative"], + ["xpath=//div[4]/button", "xpath:position"], + ["xpath=//button[contains(.,'Logged in as admin')]", "xpath:innerText"] + ], + "value": "" }, { "id": "e6d6cac9-cc9a-424d-b89e-90b9eb899b7a", "comment": "", "command": "click", - "target": "linkText=Logout", + "target": "id=user-nav-dropdown-logout", "targets": [ + ["id=user-nav-dropdown-logout", "id"], ["linkText=Logout", "linkText"], - ["css=.nav-link:nth-child(4)", "css:finder"], + ["css=#user-nav-dropdown-logout", "css:finder"], ["xpath=//a[contains(text(),'Logout')]", "xpath:link"], - ["xpath=//div[@id='basic-navbar-nav']/div/a[2]", "xpath:idRelative"], + ["xpath=//a[@id='user-nav-dropdown-logout']", "xpath:attributes"], + ["xpath=//div[@id='user-nav-dropdown']/div/a", "xpath:idRelative"], ["xpath=//a[contains(@href, '/logout')]", "xpath:href"], - ["xpath=//a[2]", "xpath:position"], + ["xpath=//div[4]/div/a", "xpath:position"], ["xpath=//a[contains(.,'Logout')]", "xpath:innerText"] ], "value": ""