diff options
author | Christopher Ng <chrng8@gmail.com> | 2025-03-25 14:31:45 -0700 |
---|---|---|
committer | Christopher Ng <chrng8@gmail.com> | 2025-03-28 15:07:06 -0700 |
commit | cdd151817fb8aa6811767ae536eded5b9efe3f55 (patch) | |
tree | 447c05d20624dd830d50b50f0e3f3d62c1633d25 | |
parent | ba8a202f2f40e9921e82ab4ec9769c261868374a (diff) | |
download | nextcloud-server-backport/51336/stable31.tar.gz nextcloud-server-backport/51336/stable31.zip |
test(settings): Fix group items not being foundbackport/51336/stable31
Signed-off-by: Christopher Ng <chrng8@gmail.com>
-rw-r--r-- | cypress/e2e/settings/users_groups.cy.ts | 50 |
1 files changed, 24 insertions, 26 deletions
diff --git a/cypress/e2e/settings/users_groups.cy.ts b/cypress/e2e/settings/users_groups.cy.ts index dbc30dbaa66..01f545d16f3 100644 --- a/cypress/e2e/settings/users_groups.cy.ts +++ b/cypress/e2e/settings/users_groups.cy.ts @@ -61,11 +61,11 @@ describe('Settings: Assign user to a group', { testIsolation: false }, () => { }) it('see that the group is in the list', () => { - cy.get('ul[data-cy-users-settings-navigation-groups="custom"]').contains('li', groupName).should('exist') - cy.get('ul[data-cy-users-settings-navigation-groups="custom"]').contains('li', groupName).within(() => { - cy.get('.counter-bubble__counter') - .should('not.exist') // is hidden when 0 - }) + cy.get('ul[data-cy-users-settings-navigation-groups="custom"]').find('li').contains(groupName) + .should('exist') + cy.get('ul[data-cy-users-settings-navigation-groups="custom"]').find('li').contains(groupName) + .find('.counter-bubble__counter') + .should('not.exist') // is hidden when 0 }) it('see that the user is in the list', () => { @@ -103,8 +103,7 @@ describe('Settings: Assign user to a group', { testIsolation: false }, () => { it('see the group was successfully assigned', () => { // see a new memeber - cy.get('ul[data-cy-users-settings-navigation-groups="custom"]') - .contains('li', groupName) + cy.get('ul[data-cy-users-settings-navigation-groups="custom"]').find('li').contains(groupName) .find('.counter-bubble__counter') .should('contain', '1') }) @@ -129,14 +128,14 @@ describe('Settings: Delete an empty group', { testIsolation: false }, () => { }) it('see that the group is in the list', () => { - cy.get('ul[data-cy-users-settings-navigation-groups="custom"]').within(() => { - // see that the list of groups contains the group foo - cy.contains(groupName).should('exist').scrollIntoView() - // open the actions menu for the group - cy.contains('li', groupName).within(() => { - cy.get('button.action-item__menutoggle').click({ force: true }) - }) - }) + // see that the list of groups contains the group foo + cy.get('ul[data-cy-users-settings-navigation-groups="custom"]').find('li').contains(groupName) + .should('exist') + .scrollIntoView() + // open the actions menu for the group + cy.get('ul[data-cy-users-settings-navigation-groups="custom"]').find('li').contains(groupName) + .find('button.action-item__menutoggle') + .click({ force: true }) }) it('can delete the group', () => { @@ -150,10 +149,9 @@ describe('Settings: Delete an empty group', { testIsolation: false }, () => { }) it('deleted group is not shown anymore', () => { - cy.get('ul[data-cy-users-settings-navigation-groups="custom"]').within(() => { - // see that the list of groups does not contain the group - cy.contains(groupName).should('not.exist') - }) + // see that the list of groups does not contain the group + cy.get('ul[data-cy-users-settings-navigation-groups="custom"]').find('li').contains(groupName) + .should('not.exist') // and also not in database cy.runOccCommand('group:list --output=json').then(($response) => { const groups: string[] = Object.keys(JSON.parse($response.stdout)) @@ -181,13 +179,14 @@ describe('Settings: Delete a non empty group', () => { it('see that the group is in the list', () => { // see that the list of groups contains the group - cy.get('ul[data-cy-users-settings-navigation-groups="custom"]').contains('li', groupName).should('exist').scrollIntoView() + cy.get('ul[data-cy-users-settings-navigation-groups="custom"]').find('li').contains(groupName) + .should('exist') + .scrollIntoView() }) it('can delete the group', () => { // open the menu - cy.get('ul[data-cy-users-settings-navigation-groups="custom"]') - .contains('li', groupName) + cy.get('ul[data-cy-users-settings-navigation-groups="custom"]').find('li').contains(groupName) .find('button.action-item__menutoggle') .click({ force: true }) @@ -201,10 +200,9 @@ describe('Settings: Delete a non empty group', () => { }) it('deleted group is not shown anymore', () => { - cy.get('ul[data-cy-users-settings-navigation-groups="custom"]').within(() => { - // see that the list of groups does not contain the group foo - cy.contains(groupName).should('not.exist') - }) + // see that the list of groups does not contain the group foo + cy.get('ul[data-cy-users-settings-navigation-groups="custom"]').find('li').contains(groupName) + .should('not.exist') // and also not in database cy.runOccCommand('group:list --output=json').then(($response) => { const groups: string[] = Object.keys(JSON.parse($response.stdout)) |