diff --git a/.travis.yml b/.travis.yml
index 26b5c81d..97a0857f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -42,6 +42,7 @@ notifications:
os:
- linux
script:
+ - "cd frontend && yarn test"
- "travis_retry make clean test-ci"
- "if [[ \"$TRAVIS_BRANCH\" == \"master\" && \"$TRAVIS_PULL_REQUEST\" = \"false\" ]]; then make coverage; fi"
services:
diff --git a/cmd/main.go b/cmd/main.go
index 5d6be616..9d147cd6 100644
--- a/cmd/main.go
+++ b/cmd/main.go
@@ -28,8 +28,7 @@ var (
verboseMode int
port int
log = utils.Log.WithField("type", "cmd")
-
- confgs *configs.DbConfig
+ confgs *configs.DbConfig
)
// parseFlags will parse the application flags
@@ -75,8 +74,6 @@ func main() {
parseFlags()
- utils.SentryInit(VERSION)
-
if err := source.Assets(); err != nil {
exit(err)
}
@@ -202,18 +199,14 @@ func InitApp() error {
if _, err := core.Select(); err != nil {
return err
}
-
if _, err := services.SelectAllServices(true); err != nil {
return err
}
-
go services.CheckServices()
-
notifiers.InitNotifiers()
-
+ go database.Maintenance()
+ utils.SentryInit(&VERSION, core.App.AllowReports.Bool)
core.App.Setup = true
core.App.Started = utils.Now()
-
- go database.Maintenance()
return nil
}
diff --git a/frontend/cypress/integration/0_setup_spec.js b/frontend/cypress/integration/0_setup_spec.js
index 5d452d78..78c91af7 100644
--- a/frontend/cypress/integration/0_setup_spec.js
+++ b/frontend/cypress/integration/0_setup_spec.js
@@ -19,6 +19,8 @@ context('Setup Process', () => {
it('should have sample data', () => {
cy.visit('/')
+ cy.get('#title').should('contain', 'Demo Tester')
+ cy.get('#description').should('contain', 'This is a test from Crypress!')
cy.get('.card').should('have.length', 5)
cy.get('.group_header').should('have.length', 2)
})
diff --git a/frontend/cypress/integration/notifiers_spec.js b/frontend/cypress/integration/notifiers_spec.js
index 302e44b0..9f3e2074 100644
--- a/frontend/cypress/integration/notifiers_spec.js
+++ b/frontend/cypress/integration/notifiers_spec.js
@@ -34,17 +34,17 @@ context('Notifier Tests', () => {
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()
- })
+ // 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/echo')
+ // cy.get('#v-pills-command-tab > .form-control').eq(1).clear().type('"success"')
+ // cy.get('#v-pills-command-tab > .form-control').eq(2).clear().type('"failure"')
+ //
+ // cy.get('#v-pills-command-tab').find(".save-notifier").click()
+ // cy.get('#v-pills-command-tab').find(".test-notifier").click()
+ // })
})
diff --git a/frontend/cypress/integration/services_spec.js b/frontend/cypress/integration/services_spec.js
index a171de27..5fd4712b 100644
--- a/frontend/cypress/integration/services_spec.js
+++ b/frontend/cypress/integration/services_spec.js
@@ -98,9 +98,13 @@ context('Services Tests', () => {
it('should delete new services', () => {
cy.visit('/dashboard/services')
+ cy.get('#services_list > tr').should('have.length', 10)
cy.get('#services_list > tr').eq(0).find('a.btn-danger').click()
+ cy.get('#services_list > tr').should('have.length', 9)
cy.get('#services_list > tr').eq(1).find('a.btn-danger').click()
+ cy.get('#services_list > tr').should('have.length', 8)
cy.get('#services_list > tr').eq(2).find('a.btn-danger').click()
+ cy.get('#services_list > tr').should('have.length', 7)
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/users_spec.js b/frontend/cypress/integration/users_spec.js
index e0e194ad..7cceb63d 100644
--- a/frontend/cypress/integration/users_spec.js
+++ b/frontend/cypress/integration/users_spec.js
@@ -66,19 +66,6 @@ context('Users Tests', () => {
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)
diff --git a/frontend/src/API.js b/frontend/src/API.js
index 3bd07b97..28ad0a36 100644
--- a/frontend/src/API.js
+++ b/frontend/src/API.js
@@ -1,7 +1,11 @@
+import Vue from "vue";
import axios from 'axios'
+import * as Sentry from "@sentry/browser";
+import * as Integrations from "@sentry/integrations";
+const qs = require('querystring');
-const qs = require('querystring')
const tokenKey = "statping_user";
+const errorReporter = "https://bed4d75404924cb3a799e370733a1b64@sentry.statping.com/3"
class Api {
constructor() {
@@ -9,7 +13,11 @@ class Api {
}
async core() {
- return axios.get('api').then(response => (response.data))
+ const core = axios.get('api').then(response => (response.data))
+ if (core.allow_reports) {
+ await this.sentry_init()
+ }
+ return core
}
async core_save(obj) {
@@ -258,6 +266,13 @@ class Api {
await axios.all([all])
}
+ async sentry_init() {
+ Sentry.init({
+ dsn: errorReporter,
+ integrations: [new Integrations.Vue({Vue, attachProps: true})],
+ });
+ }
+
}
const api = new Api()
export default api
diff --git a/frontend/src/App.vue b/frontend/src/App.vue
index 3e2d3162..c605d153 100644
--- a/frontend/src/App.vue
+++ b/frontend/src/App.vue
@@ -1,7 +1,7 @@