Files
sailing-analytics/java/com.sap.sse.security.ui
Axel Uhl bfa1f9baa1 Fix spurious TestNegativeAcls failures from GWT CellTable async redraws
The negative-ACL Selenium tests intermittently failed with
StaleElementReferenceException (masked as a generic RuntimeException) and
a NullPointerException when reading a freshly-created role/permission row
that had not yet rendered.

Root causes and fixes:

- Several user-management RPCs were fired through a plain AsyncCallback, so
  they were invisible to the pending-Ajax counter and waitForAjaxRequests()
  returned before their deferred CellTable repaint ran. Wrap them in
  MarkedAsyncCallback: createRoleDefinition, getRolesAndPermissionsForUser,
  getUserList, addPermissionForUser, removePermissionFromUser and
  removeRoleFromUser.

- Pair those marks with waitForAjaxRequests() barriers on the test side after
  add/delete clicks (WildcardPermissionPanelPO, UserRoleDefinitionPanelPO).
  The ...AndExpectPermissionError() variants deliberately click directly and
  wait for the alert instead, since the RPC fails rather than completing.

- Add RoleDefinitionsPanelPO.findRoleWhenPresent(): wait for Ajax, then poll
  until the row is present before returning it, and use it from
  TestNegativeAcls so a not-yet-rendered row no longer NPEs.

- Stop CellTablePO/GenericCellTablePO from masking staleness: narrow
  createEntry's catch to the exceptions the reflective construction can
  actually throw, unwrap InvocationTargetException(StaleElementReferenceException)
  and rethrow it, and retry getEntries() a bounded number of times so a
  redraw-during-read is tolerated rather than surfaced as an opaque failure.

- PageObject.waitUntil now ignores StaleElementReferenceException.

Assisted-By: Claude Opus 4.8 (Claude Code)
2026-09-18 17:29:27 +02:00
..
…
2026-03-05 17:21:54 +01:00