]> source.dussan.org Git - nextcloud-server.git/commitdiff
test(settings): adjust e2e tests selectors to new structure
authorGrigorii K. Shartsev <me@shgk.me>
Mon, 18 Mar 2024 14:18:36 +0000 (15:18 +0100)
committerGrigorii K. Shartsev <me@shgk.me>
Tue, 19 Mar 2024 14:38:51 +0000 (15:38 +0100)
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
cypress/e2e/settings/apps.cy.ts

index 581a6c0a1e7ebf852fe227db59691470918a15a0..c1ef24951a9aad1d0334ec90ab70e59d0f8697be 100644 (file)
@@ -39,11 +39,10 @@ describe('Settings: App management', { testIsolation: true }, () => {
        })
 
        it('Can enable an installed app', () => {
-               cy.get('#apps-list').should('be.visible')
+               cy.get('#apps-list').should('exist')
                        // Wait for the app list to load
                        .contains('tr', 'QA testing', { timeout: 10000 })
                        .should('exist')
-                       .find('.actions')
                        // I enable the "QA testing" app
                        .contains('button', 'Enable')
                        .click({ force: true })
@@ -51,10 +50,9 @@ describe('Settings: App management', { testIsolation: true }, () => {
                handlePasswordConfirmation(admin.password)
 
                // Wait until we see the disable button for the app
-               cy.get('#apps-list').should('be.visible')
+               cy.get('#apps-list').should('exist')
                        .contains('tr', 'QA testing')
                        .should('exist')
-                       .find('.actions')
                        // I see the disable button for the app
                        .contains('button', 'Disable', { timeout: 10000 })
 
@@ -62,15 +60,15 @@ describe('Settings: App management', { testIsolation: true }, () => {
                cy.get('#app-category-enabled a').click({ force: true })
                cy.url().should('match', /settings\/apps\/enabled$/)
                // I see that the "QA testing" app has been enabled
-               cy.get('.apps-list-container').contains('tr', 'QA testing')
+               cy.get('#apps-list').contains('tr', 'QA testing')
        })
 
        it('Can disable an installed app', () => {
-               cy.get('#apps-list').should('be.visible')
+               cy.get('#apps-list')
+                       .should('exist')
                        // Wait for the app list to load
                        .contains('tr', 'Update notification', { timeout: 10000 })
                        .should('exist')
-                       .find('.actions')
                        // I disable the "Update notification" app
                        .contains('button', 'Disable')
                        .click({ force: true })
@@ -78,10 +76,9 @@ describe('Settings: App management', { testIsolation: true }, () => {
                handlePasswordConfirmation(admin.password)
 
                // Wait until we see the disable button for the app
-               cy.get('#apps-list').should('be.visible')
+               cy.get('#apps-list').should('exist')
                        .contains('tr', 'Update notification')
                        .should('exist')
-                       .find('.actions')
                        // I see the enable button for the app
                        .contains('button', 'Enable', { timeout: 10000 })
 
@@ -89,7 +86,7 @@ describe('Settings: App management', { testIsolation: true }, () => {
                cy.get('#app-category-disabled a').click({ force: true })
                cy.url().should('match', /settings\/apps\/disabled$/)
                // I see that the "Update notification" app has been disabled
-               cy.get('.apps-list-container').contains('tr', 'Update notification')
+               cy.get('#apps-list').contains('tr', 'Update notification')
        })
 
        it('Browse enabled apps', () => {
@@ -102,8 +99,8 @@ describe('Settings: App management', { testIsolation: true }, () => {
                cy.get('#app-category-enabled').find('.active').should('exist')
                // I see that there are only enabled apps
                cy.get('#apps-list')
-                       .should('be.visible')
-                       .find('tr .actions')
+                       .should('exist')
+                       .find('tr button')
                        .each(($action) => {
                                cy.wrap($action).should('not.contain', 'Enable')
                        })
@@ -119,8 +116,8 @@ describe('Settings: App management', { testIsolation: true }, () => {
                cy.get('#app-category-disabled').find('.active').should('exist')
                // I see that there are only disabled apps
                cy.get('#apps-list')
-                       .should('be.visible')
-                       .find('tr .actions')
+                       .should('exist')
+                       .find('tr button')
                        .each(($action) => {
                                cy.wrap($action).should('not.contain', 'Disable')
                        })