As discovered while running tests in isolation for
FOLIO-1344, some of the Nightmare tests in ui-users have data dependencies that are not met when running tests for a pull request with a dedicated PR tenant.
When an active user is not found, 6 tests will fail:
The first failure occurs in patron_group.js while looking for an active user. Active users are present in the PR tenant, however the test is looking for the 11th user in the list when there may not even be 11 users to choose from.
Similarly in new_proxy.js, attempts to select the 9th user:
A few possible solutions:
(a) Pre-populate PR tenants with sufficient number of users. While this works, it maintains a data dependency that may not be met in other test environments.
(b) Update the test to be aware of how many items are in the list and select the nth item up to the list count.
(c) Create n users before selecting the nth one.
The next data dependency comes from new_permission_set.js which selects existing permissions to assign to a permission set. When these permissions are not found the following tests fail:
The permissions selected are for "check in" and "check out".
While tenant diku has the matching permissions "Check in: All permissions" and "Check out: All permissions", these permissions are dependent on having the Check-In and Check-Out modules enabled.
This test should be updated to select permissions sourced from the users module to guarantee availability.