uPortal-Project / uPortal

Enterprise open source portal built by and for the higher education community.
https://www.apereo.org/projects/uportal
Apache License 2.0
272 stars 273 forks source link

uPortal is not recognizing an admin user in some flows #2684

Open cbeach47 opened 1 year ago

cbeach47 commented 1 year ago

Describe the bug After calling https://github.com/uPortal-Project/uPortal-start/blob/7aad82418ee7e8252b403941ca070bceede9af4b/tests/ux/utils/ux-general-utils.ts#L12 from the playwright tests, the admin user does not appear to be considered an administrator anymore. This was discovered in some failing playwright tests.

This used to work in uP 5.14 . After commit e8db822b2fb9e1973f5b5e24f94360f1c7a0a691 (2023-05-17 - Merge pull request #2660 from mgillian/feat/RDBMcache) it started to fail.

It may be unrelated, but on that same commit, the search API playwright test https://github.com/uPortal-Project/uPortal-start/blob/7aad82418ee7e8252b403941ca070bceede9af4b/tests/api/search-v5_0.spec.ts#L26 began failing - the user.login.id and uid json fields are no longer returned.

To Reproduce Steps to reproduce the behavior:

  1. Deploy the latest uPortal-start and ensure it's using uPortal 5.15.0
  2. Login via the browser via http://localhost:8080/uPortal/Login?userName=admin&password=admin
  3. Note you can see all the tiles
  4. Run the playwright tests
  5. Note the 6 failing tests, including:
    • api/portlet-list.spec.ts:48:1 › GET list creation and retrieval with ownership
    • api/portlet-list.spec.ts:347:1 › PUT items entityId regex
    • api/portlet-list.spec.ts:530:1 › PUT Confirm admin can change ownership of someone elses list
    • api/portlet-list.spec.ts:641:1 › POST / PUT allow admin to specify name as favorites
    • api/portlet-list.spec.ts:719:1 › DELETE Confirm admin can delete someone elses list
  6. Refresh the browser page
  7. Note you can only see two of the tiles

Expected behavior All playwright tests should pass, and the tiles on the admin page should not disappear.

Platform:

Additional context Helpful log output can be found at least in portal/portal.log .

You can run a playwright test individually by appending .only to the method signature. For instance:

test("DELETE Confirm admin can delete their own list", async ({ request }) => {

can be run standalone using the following, and then invoking ./gradlew playwrightRun:

test.only("DELETE Confirm admin can delete their own list", async ({ request }) => {