From 5b0c27b6dafb6ab6007339214c1d22d79e4b6f5d Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Wed, 18 Oct 2023 15:19:11 +0200 Subject: [PATCH] fix(settings): Stablize user list cypress tests * Use common `data-testid` to identify elements rather than to depend on internal classes or properties * Force clean the state for the user tests * Move leftover acceptance tests for users from drone to cypress Signed-off-by: Ferdinand Thiessen --- .drone.yml | 30 -- .github/workflows/cypress.yml | 6 +- apps/settings/src/components/UserList.vue | 2 +- .../src/components/Users/UserListHeader.vue | 12 + .../settings/src/components/Users/UserRow.vue | 50 ++- .../src/components/Users/UserRowActions.vue | 3 +- cypress/e2e/settings/users.cy.ts | 75 ++-- cypress/e2e/settings/usersUtils.ts | 53 ++- cypress/e2e/settings/users_columns.cy.ts | 22 +- cypress/e2e/settings/users_disable.cy.ts | 38 +- cypress/e2e/settings/users_groups.cy.ts | 177 +++++++- cypress/e2e/settings/users_modify.cy.ts | 284 ++++++++++--- cypress/support/commands.ts | 7 +- dist/settings-users-8351.js | 4 +- dist/settings-users-8351.js.map | 2 +- ...ings-vue-settings-apps-users-management.js | 4 +- ...-vue-settings-apps-users-management.js.map | 2 +- tests/acceptance/config/behat.yml | 2 - .../bootstrap/UsersSettingsContext.php | 379 ------------------ tests/acceptance/features/users.feature | 77 ---- 20 files changed, 559 insertions(+), 670 deletions(-) delete mode 100644 tests/acceptance/features/bootstrap/UsersSettingsContext.php delete mode 100644 tests/acceptance/features/users.feature diff --git a/.drone.yml b/.drone.yml index c768144298fa7..05397f49fb0b5 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1621,36 +1621,6 @@ trigger: - pull_request - push ---- -kind: pipeline -name: acceptance-users - -steps: -- name: submodules - image: ghcr.io/nextcloud/continuous-integration-alpine-git:latest - commands: - - git submodule update --init -- name: acceptance-users - image: ghcr.io/nextcloud/continuous-integration-acceptance-php8.0:latest - commands: - - tests/acceptance/run-local.sh --timeout-multiplier 10 --nextcloud-server-domain acceptance-users --selenium-server selenium:4444 allow-git-repository-modifications features/users.feature - -services: -- name: selenium - image: ghcr.io/nextcloud/continuous-integration-selenium:3.141.59 - environment: - # Reduce default log level for Selenium server (INFO) as it is too - # verbose. - JAVA_OPTS: -Dselenium.LOGGER.level=WARNING - -trigger: - branch: - - master - - stable* - event: - - pull_request - - push - --- kind: pipeline name: acceptance-apps diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index 520769e0de399..a5e94ee5b7981 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -23,7 +23,7 @@ jobs: steps: - name: Checkout app - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v3.5.2 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - name: Check composer.json id: check_composer @@ -39,8 +39,8 @@ jobs: uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2 id: versions with: - fallbackNode: "^14" - fallbackNpm: "^7" + fallbackNode: "^20" + fallbackNpm: "^9" - name: Set up node ${{ steps.versions.outputs.nodeVersion }} uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 diff --git a/apps/settings/src/components/UserList.vue b/apps/settings/src/components/UserList.vue index 07e663d7912a2..5c7e9ba4dda6c 100644 --- a/apps/settings/src/components/UserList.vue +++ b/apps/settings/src/components/UserList.vue @@ -45,7 +45,7 @@ :data-component="UserRow" :data-sources="filteredUsers" data-key="id" - data-test-id="userList" + data-cy-user-list :item-height="rowHeight" :style="style" :extra-props="{ diff --git a/apps/settings/src/components/Users/UserListHeader.vue b/apps/settings/src/components/Users/UserListHeader.vue index 4ee0637d16b54..e314bcb6a7379 100644 --- a/apps/settings/src/components/Users/UserListHeader.vue +++ b/apps/settings/src/components/Users/UserListHeader.vue @@ -23,12 +23,14 @@