]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(tests): Make the cypress apps management test more reliable 43273/head
authorJoas Schilling <coding@schilljs.com>
Thu, 1 Feb 2024 19:37:42 +0000 (20:37 +0100)
committerJoas Schilling <coding@schilljs.com>
Fri, 2 Feb 2024 06:04:33 +0000 (07:04 +0100)
Signed-off-by: Joas Schilling <coding@schilljs.com>
cypress/e2e/settings/apps.cy.ts

index 8bec0bd00f419c94b07838fb2a25b04e8cb1e81c..bfd6b1965fa316acc1075daba52d50b747fe96e2 100644 (file)
@@ -40,7 +40,8 @@ describe('Settings: App management', { testIsolation: true }, () => {
 
        it('Can enable an installed app', () => {
                cy.get('#apps-list').should('be.visible')
-                       .contains('tr', 'QA testing')
+                       // Wait for the app list to load
+                       .contains('tr', 'QA testing', { timeout: 10000 })
                        .should('exist')
                        .find('.actions')
                        // I enable the "QA testing" app
@@ -49,6 +50,14 @@ 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')
+                       .contains('tr', 'QA testing')
+                       .should('exist')
+                       .find('.actions')
+                       // I see the disable button for the app
+                       .contains('button', 'Disable', { timeout: 10000 })
+
                // Change to enabled apps view
                cy.get('#app-category-enabled a').click({ force: true })
                cy.url().should('match', /settings\/apps\/enabled$/)
@@ -58,7 +67,8 @@ describe('Settings: App management', { testIsolation: true }, () => {
 
        it('Can disable an installed app', () => {
                cy.get('#apps-list').should('be.visible')
-                       .contains('tr', 'Update notification')
+                       // Wait for the app list to load
+                       .contains('tr', 'Update notification', { timeout: 10000 })
                        .should('exist')
                        .find('.actions')
                        // I disable the "Update notification" app
@@ -67,6 +77,14 @@ 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')
+                       .contains('tr', 'Update notification')
+                       .should('exist')
+                       .find('.actions')
+                       // I see the enable button for the app
+                       .contains('button', 'Enable', { timeout: 10000 })
+
                // Change to disabled apps view
                cy.get('#app-category-disabled a').click({ force: true })
                cy.url().should('match', /settings\/apps\/disabled$/)