Uploaded image for project: 'ui-users'
  1. ui-users
  2. UIU-604

Address data dependencies in Nightmare tests




      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.

      Active user dependency

      When an active user is not found, 6 tests will fail:

       1) should find an active user to edit
       2) should find patron group ID for "alumni_1757"
       3) should edit user record using "alumni_1757" group
       4) should find ID for "Staff" group
       5) should change patron group to "Staff" in user record
       9) should get active user barcodes

      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.

      .wait('#list-users div[role="listitem"]:nth-of-type(11) > a > div:nth-of-type(5)')
      .evaluate(() => document.querySelector('#list-users div[role="listitem"]:nth-of-type(11) > a > div:nth-of-type(5)').title)

      Similarly in new_proxy.js, attempts to select the 9th user:

      .wait('#list-users div[role="listitem"]:nth-child(9)')

      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.

      Permission dependency

      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:

       6) should create a new permission set
       7) should confirm creation of new permission set
       8) should delete new permission set

      The permissions selected are for "check in" and "check out".

      .xclick('//button[contains(.,"Check in")]')
      .xclick('//button[contains(.,"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.

      TestRail: Results


          Issue Links



                zburke Zak_Burke
                mattj Matt Jones
                0 Vote for this issue
                3 Start watching this issue



                  TestRail: Runs

                    TestRail: Cases