mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-03 01:29:33 +00:00
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)