owncloud / user_ldap

šŸ“’
GNU Affero General Public License v3.0
17 stars 17 forks source link

Behavior change for User count of group #716

Closed phil-davis closed 2 years ago

phil-davis commented 2 years ago

core PR https://github.com/owncloud/core/pull/39721 changed the behavior of the groups on the user management page. If the group is an LDAP group, or for whatever reason the group member count is zero or not available, then the count is not displayed at all.

As a result, some existing tests in user_ldap are failing and need to be adjusted:

https://drone.owncloud.com/owncloud/user_ldap/3778/54/14 https://drone.owncloud.com/owncloud/user_ldap/3778/55/14 https://drone.owncloud.com/owncloud/user_ldap/3778/58/14 https://drone.owncloud.com/owncloud/user_ldap/3778/59/14 https://drone.owncloud.com/owncloud/user_ldap/3778/68/14

runsh: Total unexpected failed scenarios throughout the test run:
webUIProvisioning/groups.feature:21
webUIProvisioning/groups.feature:70
webUIProvisioning/groups.feature:89
  Scenario: An LDAP group should be listed but the member count is not known # /var/www/owncloud/testrunner/apps/user_ldap/tests/acceptance/features/webUIProvisioning/groups.feature:21
    Then the group name "grp1" should be listed on the webUI                 # WebUIUsersContext::theGroupNameShouldBeListed()
    And the user count of group "grp1" should display 0 users on the webUI   # WebUIUsersContext::theUserCountOfGroupShouldDisplayUsersOnTheWebUI()
      Page\UsersPage::getUserCountOfGroup xpath //li[@data-gid='grp1']//span[@class='usercount tag'] could not find user count for group grp1 (SensioLabs\Behat\PageObjectExtension\PageObject\Exception\ElementNotFoundException)
SCENARIO RESULT: (fail)
  Scenario: Adding database user to database group should be possible                          # /var/www/owncloud/testrunner/apps/user_ldap/tests/acceptance/features/webUIProvisioning/groups.feature:70
    Given user "db-user" has been created with default attributes in the database user backend # FeatureContext::userHasBeenCreatedOnDatabaseBackend()
    And group "db-group" has been created in the database user backend                         # FeatureContext::groupHasBeenCreatedOnDatabaseBackend()
    And the administrator has browsed to the users page                                        # WebUIUsersContext::theUserBrowsesToTheUsersPage()
INFORMATION: timed out waiting for ajax calls to start
    When the administrator adds user "db-user" to group "db-group" using the webUI             # WebUIUsersContext::addsUserToGroupUsingTheWebui()
      ā”‚ INFORMATION: timed out waiting for ajax calls to start
    Then user "db-user" should exist                                                           # FeatureContext::userShouldExist()
    And user "db-user" should belong to group "db-group"                                       # FeatureContext::userShouldBelongToGroup()
    And the user count of group "db-group" should display 0 users on the webUI                 # WebUIUsersContext::theUserCountOfGroupShouldDisplayUsersOnTheWebUI()
      Page\UsersPage::getUserCountOfGroup xpath //li[@data-gid='db-group']//span[@class='usercount tag'] could not find user count for group db-group (SensioLabs\Behat\PageObjectExtension\PageObject\Exception\ElementNotFoundException)
  Scenario: Adding LDAP user to database group should be possible                # /var/www/owncloud/testrunner/apps/user_ldap/tests/acceptance/features/webUIProvisioning/groups.feature:89
    Given group "db-group" has been created in the database user backend         # FeatureContext::groupHasBeenCreatedOnDatabaseBackend()
    And the administrator has browsed to the users page                          # WebUIUsersContext::theUserBrowsesToTheUsersPage()
INFORMATION: timed out waiting for ajax calls to start
    When the administrator adds user "Alice" to group "db-group" using the webUI # WebUIUsersContext::addsUserToGroupUsingTheWebui()
      ā”‚ INFORMATION: timed out waiting for ajax calls to start
    Then user "Alice" should exist                                               # FeatureContext::userShouldExist()
    And user "Alice" should belong to group "db-group"                           # FeatureContext::userShouldBelongToGroup()
    And the user count of group "db-group" should display 0 users on the webUI   # WebUIUsersContext::theUserCountOfGroupShouldDisplayUsersOnTheWebUI()
      Page\UsersPage::getUserCountOfGroup xpath //li[@data-gid='db-group']//span[@class='usercount tag'] could not find user count for group db-group (SensioLabs\Behat\PageObjectExtension\PageObject\Exception\ElementNotFoundException)
phil-davis commented 2 years ago

PR #715 has the changes/fixes to the test scenarios.

core PR https://github.com/owncloud/core/pull/39809 added the necessary core test enhancements.

phil-davis commented 2 years ago

I raised an issue about on of the scenarios, which I think demonstrates that there is still an edge-case bug: https://github.com/owncloud/user_ldap/issues/717

The test development is done here.