Skip to content
Merged
Prev Previous commit
Next Next commit
test(settings): adjust e2e tests selectors to new structure
Signed-off-by: Grigorii K. Shartsev <[email protected]>
  • Loading branch information
ShGKme committed Mar 19, 2024
commit 127e3611ca0e7f2823bf1ca16295d488ec56b45f
25 changes: 11 additions & 14 deletions cypress/e2e/settings/apps.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,57 +39,54 @@ 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 })

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 })

// Change to enabled apps view
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 })

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 })

// Change to disabled apps view
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', () => {
Expand All @@ -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')
})
Expand All @@ -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')
})
Expand Down