diff --git a/CHANGELOG.md b/CHANGELOG.md index 609fd84a..2f35740f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 0.90.25 +- Added string response on OnTest for Notifiers +- Modified UI to show user the response for a Notifier. +- Modified some Notifiers title's +- Added more Cypress e2e testing + # 0.90.24 - Fixed login form from not showing diff --git a/frontend/cypress/integration/groups_spec.js b/frontend/cypress/integration/groups_spec.js index e5a07577..8c617489 100644 --- a/frontend/cypress/integration/groups_spec.js +++ b/frontend/cypress/integration/groups_spec.js @@ -29,7 +29,7 @@ context('Groups Tests', () => { cy.visit('/dashboard/services') cy.get('.sortable_groups > tr').should('have.length', 3) - cy.get('.sortable_groups > tr').eq(0).contains('PRIVATE') + cy.get('.sortable_groups > tr').eq(0).contains('PUBLIC') cy.get('.sortable_groups > tr').eq(1).contains('PUBLIC') cy.get('.sortable_groups > tr').eq(2).contains('PRIVATE') }) @@ -48,17 +48,28 @@ context('Groups Tests', () => { cy.get('button[type="submit"]').click() }) + it('should edit Group', () => { + cy.visit('/dashboard/services') + cy.get('.sortable_groups > tr').eq(0).find('.btn-outline-secondary').click() + cy.get('#title').should('have.value', 'Test Group') + cy.get('#title').clear().type('Updated Group') + cy.get('button[type="submit"]').click() + + cy.get('.sortable_groups > tr').eq(0).contains('Updated Group') + }) + it('should confirm new groups', () => { cy.visit('/dashboard/services') cy.get('.sortable_groups > tr').should('have.length', 5) cy.get('.sortable_groups > tr').eq(0).contains('PUBLIC') - cy.get('.sortable_groups > tr').eq(0).contains('Test Group') + cy.get('.sortable_groups > tr').eq(0).contains('Updated Group') cy.get('.sortable_groups > tr').eq(1).contains('PRIVATE') cy.get('.sortable_groups > tr').eq(1).contains('Test Private Group') }) it('should delete new groups', () => { + cy.visit('/dashboard/services') cy.get('.sortable_groups > tr').eq(0).find('.btn-danger').click() cy.get('.sortable_groups > tr').eq(1).find('.btn-danger').click() cy.get('.sortable_groups > tr').should('have.length', 3) diff --git a/frontend/cypress/integration/messages_spec.js b/frontend/cypress/integration/messages_spec.js index a0e541b8..a2a025ae 100644 --- a/frontend/cypress/integration/messages_spec.js +++ b/frontend/cypress/integration/messages_spec.js @@ -2,7 +2,7 @@ import "../support/commands" -context('Messages Tests', () => { +context('Annoucements Tests', () => { beforeEach(() => { @@ -43,4 +43,10 @@ context('Messages Tests', () => { cy.get('tbody > tr').should('have.length', 3) }) + it('should confirm delete Message', () => { + cy.visit('/dashboard/messages') + cy.get('tbody > tr').eq(0).find('.btn-danger').click() + cy.get('tbody > tr').should('have.length', 2) + }) + }) diff --git a/frontend/cypress/integration/notifiers_spec.js b/frontend/cypress/integration/notifiers_spec.js index 26cc93a7..302e44b0 100644 --- a/frontend/cypress/integration/notifiers_spec.js +++ b/frontend/cypress/integration/notifiers_spec.js @@ -25,12 +25,26 @@ context('Notifier Tests', () => { cy.getCookies().should('have.length', 1) }) + // uzrwstmtd69hi4wgzsj27q2v29mtpu it('should confirm notifiers are installed', () => { cy.visit('/dashboard/settings') - cy.get('#notifiers_tabs > a').should('have.length', 9) + cy.get('#notifiers_tabs > a').should('have.length', 10) cy.get('#api_key').should('not.have.value', '') cy.get('#api_secret').should('not.have.value', '') }) + it('should test and save notifier', () => { + cy.visit('/dashboard/settings') + cy.get('#notifiers_tabs > a').should('have.length', 10) + cy.get('#notifiers_tabs > #v-pills-command-tab').click() + + cy.get('#v-pills-command-tab > .form-control').eq(0).clear().type('/bin/sh') + cy.get('#v-pills-command-tab > .form-control').eq(1).clear().type('echo "success"') + cy.get('#v-pills-command-tab > .form-control').eq(2).clear().type('echo "failure"') + + cy.get('#v-pills-command-tab > .card-body > .btn').eq(0).click() + cy.get('#v-pills-command-tab > .card-body > .btn').eq(1).click() + }) + }) diff --git a/frontend/cypress/integration/services_spec.js b/frontend/cypress/integration/services_spec.js index 9d459f36..a171de27 100644 --- a/frontend/cypress/integration/services_spec.js +++ b/frontend/cypress/integration/services_spec.js @@ -26,7 +26,7 @@ context('Services Tests', () => { it('should goto services', () => { cy.visit('/dashboard/services') - cy.get('#services_list > tr').should('have.length', 5) + cy.get('#services_list > tr').should('have.length', 6) cy.get('.sortable_groups > tr').should('have.length', 3) }) @@ -79,7 +79,7 @@ context('Services Tests', () => { it('should create new ICMP service', () => { cy.visit('/dashboard/create_service') - cy.get('#name').clear().type('ICMP Service') + cy.get('#name').clear().type('ICMP Service') cy.get('#service_type').select('icmp') cy.get('#service_url').clear().type('8.8.8.8') @@ -93,16 +93,16 @@ context('Services Tests', () => { it('should confirm new services', () => { cy.visit('/dashboard/services') - cy.get('#services_list > tr').should('have.length', 9) + cy.get('#services_list > tr').should('have.length', 10) }) it('should delete new services', () => { cy.visit('/dashboard/services') - cy.get('#services_list > tr').eq(0).find('.btn-danger').click() - cy.get('#services_list > tr').eq(0).find('.btn-danger').click() - cy.get('#services_list > tr').eq(0).find('.btn-danger').click() - cy.get('#services_list > tr').eq(0).find('.btn-danger').click() - cy.get('#services_list > tr').should('have.length', 4) + cy.get('#services_list > tr').eq(0).find('a.btn-danger').click() + cy.get('#services_list > tr').eq(1).find('a.btn-danger').click() + cy.get('#services_list > tr').eq(2).find('a.btn-danger').click() + cy.get('#services_list > tr').eq(3).find('a.btn-danger').click() + cy.get('#services_list > tr').should('have.length', 6) }) }) diff --git a/frontend/cypress/integration/settings_spec.js b/frontend/cypress/integration/settings_spec.js index e225340e..14992041 100644 --- a/frontend/cypress/integration/settings_spec.js +++ b/frontend/cypress/integration/settings_spec.js @@ -27,7 +27,7 @@ context('Settings Tests', () => { it('should confirm notifiers are installed', () => { cy.visit('/dashboard/settings') - cy.get('#notifiers_tabs > a').should('have.length', 9) + cy.get('#notifiers_tabs > a').should('have.length', 10) cy.get('#api_key').should('not.have.value', '') cy.get('#api_secret').should('not.have.value', '') @@ -36,7 +36,7 @@ context('Settings Tests', () => { it('should update Statping settings', () => { cy.visit('/dashboard/settings') - cy.get('#project').clear().type('Statping Cypress Tests') + cy.get('#project').clear().type('Statping Updated') cy.get('#description').clear().type('Statping can use Cypress e2e testing to make it more stable!') cy.get('#domain').clear().type('http://localhost:8888') cy.get('#footer').clear().type('Statping Custom Footer') @@ -46,7 +46,7 @@ context('Settings Tests', () => { it('should confirm Statping settings', () => { cy.visit('/dashboard/settings') - cy.get('#project').should('have.value', 'Statping Cypress Tests') + cy.get('#project').should('have.value', 'Statping Updated') cy.get('#description').should('have.value', 'Statping can use Cypress e2e testing to make it more stable!') cy.get('#domain').should('have.value', 'http://localhost:8888') cy.get('#footer').should('have.value', 'Statping Custom Footer') @@ -59,6 +59,13 @@ context('Settings Tests', () => { cy.get('.footer').should('contain', 'Statping Custom Footer') }) + it('should regenerate API Keys', () => { + cy.visit('/dashboard/settings') + cy.get('#regenkeys').click() + cy.get('#api_key').should('not.have.value', '') + cy.get('#api_secret').should('not.have.value', '') + }) + it('should create Local Assets', () => { cy.visit('/dashboard/settings') cy.get('#v-pills-style-tab').click() diff --git a/frontend/cypress/integration/users_spec.js b/frontend/cypress/integration/users_spec.js index 2bdb5141..e0e194ad 100644 --- a/frontend/cypress/integration/users_spec.js +++ b/frontend/cypress/integration/users_spec.js @@ -39,13 +39,52 @@ context('Users Tests', () => { cy.get('#password_confirm').clear().type('password123') cy.get('button[type="submit"]').click() + cy.get('#users_table > tr').should('have.length', 2) }) - // it('should confirm new user', () => { - // cy.visit('/dashboard/users') - // cy.get('#users_table > tr').should('have.length', 2) - // cy.get('#users_table > tr').eq(0).contains('admin') - // cy.get('#users_table > tr').eq(1).contains('admin2') - // }) + it('should create new Admin User', () => { + cy.visit('/dashboard/users') + cy.get('#username').clear().type('admin3') + cy.get('#admin_switch').click() + cy.get('#email').clear().type('info@admin3.com') + cy.get('#password').clear().type('password123') + cy.get('#password_confirm').clear().type('password123') + + cy.get('button[type="submit"]').click() + cy.get('#users_table > tr').should('have.length', 3) + }) + + it('should confirm new user', () => { + cy.visit('/dashboard/users') + cy.get('#users_table > tr').should('have.length', 3) + cy.get('#users_table > tr').eq(0).contains('admin') + cy.get('#users_table > tr').eq(1).contains('admin2') + cy.get('#users_table > tr').eq(2).contains('admin3') + + cy.get('#users_table > tr').eq(0).contains('ADMIN') + cy.get('#users_table > tr').eq(1).contains('USER') + cy.get('#users_table > tr').eq(2).contains('ADMIN') + }) + + it('should confirm edit user', () => { + cy.visit('/dashboard/users') + cy.get('#users_table > tr').should('have.length', 3) + cy.get('#users_table > tr').eq(2).find('a.edit-user').click() + cy.get('#email').should('have.value', 'info@admin3.com') + cy.get('#email').clear().type('info@updated.com') + cy.get('#password').type('password123') + cy.get('#password_confirm').type('password123') + cy.get('button[type="submit"]').click() + + cy.get('#users_table > tr').should('have.length', 3) + }) + + it('should delete new users', () => { + cy.visit('/dashboard/users') + cy.get('#users_table > tr').should('have.length', 3) + cy.get('#users_table > tr').eq(2).find('a.btn-danger').click() + cy.get('#users_table > tr').eq(1).find('a.btn-danger').click() + cy.get('#users_table > tr').should('have.length', 1) + }) }) diff --git a/frontend/src/components/Dashboard/DashboardUsers.vue b/frontend/src/components/Dashboard/DashboardUsers.vue index 09942fb0..943821f4 100644 --- a/frontend/src/components/Dashboard/DashboardUsers.vue +++ b/frontend/src/components/Dashboard/DashboardUsers.vue @@ -14,15 +14,22 @@
-Response:
{{response}}
Response:
{{response}}