forked from statping-ng/statping-ng
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cypress testing - makefile - sass - dep
- Loading branch information
1 parent
52684c5
commit 65998c5
Showing
33 changed files
with
2,329 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM golang:1.10.3-alpine | ||
LABEL maintainer "Hunter Long (https://github.com/hunterlong)" | ||
|
||
# Statup 'test' image for running a full test using the production environment | ||
ENV VERSION=$(VERSION) | ||
|
||
RUN apk add --no-cache libstdc++ gcc g++ make git ca-certificates linux-headers wget | ||
|
||
RUN wget -q https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 && \ | ||
chmod +x dep-linux-amd64 && \ | ||
mv dep-linux-amd64 /usr/local/bin/dep | ||
|
||
WORKDIR $GOPATH/src/github.com/hunterlong/statup | ||
|
||
COPY . . | ||
|
||
RUN wget -q https://assets.statup.io/sass && \ | ||
chmod +x sass && \ | ||
mv sass /usr/local/bin/sass | ||
|
||
RUN dep ensure && \ | ||
go get github.com/GeertJohan/go.rice/rice | ||
|
||
RUN cd cmd && go build -ldflags "-X main.VERSION=$VERSION" && mv cmd /usr/local/bin/statup | ||
|
||
ENV IS_DOCKER=true | ||
|
||
WORKDIR /app | ||
ADD ./Makefile . | ||
EXPOSE 8080 | ||
ENTRYPOINT statup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"projectId": "bi8mhr", | ||
"env": { | ||
"DB_HOST": "localhost", | ||
"DB_USER": "root", | ||
"DB_DATABASE": "root", | ||
"DB_PORT": "5432", | ||
"DB_PASS": "password123", | ||
"GO_ENV": "production" | ||
}, | ||
"chromeWebSecurity": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "Using fixtures to represent data", | ||
"email": "[email protected]", | ||
"body": "Fixtures are a great way to mock data for responses to routes" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
context('Setup Process', () => { | ||
|
||
// it('should go to setup Statup with Postgres', () => { | ||
// cy.visit('http://localhost:8080') | ||
// cy.get('select[name=db_connection]').select('postgres') | ||
// cy.get('input[name="db_host"]').clear().type(Cypress.env('DB_HOST')) | ||
// cy.get('input[name="db_port"]').clear().type('5432') | ||
// cy.get('input[name="db_user"]').clear().type(Cypress.env('DB_USER')) | ||
// if (Cypress.env('TRAVIS')==="yes") { | ||
// cy.get('input[name="db_password"]').clear() | ||
// } else { | ||
// cy.get('input[name="db_password"]').clear().type(Cypress.env('DB_PASS')) | ||
// } | ||
// cy.get('input[name="db_database"]').clear().type(Cypress.env('DB_DATABASE')) | ||
// cy.get('input[name="project"]').clear().type('Demo Tester') | ||
// cy.get('input[name="description"]').clear().type('This is a test from Crypress!') | ||
// cy.get('input[name="domain"]').clear().type('http://localhost:8080') | ||
// cy.get('input[name="username"]').clear().type('admin') | ||
// cy.get('input[name="email"]').clear().type('[email protected]') | ||
// cy.get('input[name="password"]').clear().type('admin') | ||
// cy.scrollTo('bottom') | ||
// cy.get('#setup_button').click().wait(10000) | ||
// cy.get('.header-title').should('contain', 'Demo Tester') | ||
// cy.get('.header-desc').should('contain', 'This is a test from Crypress!') | ||
// cy.scrollTo('bottom') | ||
// cy.get('.service_li').should('have.length', 5) | ||
// cy.get('.card').should('have.length', 5) | ||
// }) | ||
|
||
it('should go to setup Statup with SQLite', () => { | ||
cy.visit('http://localhost:8080') | ||
cy.get('select[name=db_connection]').select('sqlite') | ||
cy.get('input[name="project"]').clear().type('Demo Tester') | ||
cy.get('input[name="description"]').clear().type('This is a test from Crypress!') | ||
cy.get('input[name="domain"]').clear().type('http://localhost:8080') | ||
cy.get('input[name="username"]').clear().type('admin') | ||
cy.get('input[name="email"]').clear().type('[email protected]') | ||
cy.get('input[name="password"]').clear().type('admin') | ||
cy.scrollTo('bottom') | ||
cy.get('#setup_button').click().wait(10000) | ||
cy.get('.header-title').should('contain', 'Demo Tester') | ||
cy.get('.header-desc').should('contain', 'This is a test from Crypress!') | ||
cy.scrollTo('bottom') | ||
cy.get('.service_li').should('have.length', 5) | ||
cy.get('.card').should('have.length', 5) | ||
}) | ||
|
||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
context('Asset Tests', () => { | ||
|
||
beforeEach(function () { | ||
cy.visit('http://localhost:8080/dashboard') | ||
cy.get('input[name="username"]').type('admin') | ||
cy.get('input[name="password"]').type('admin') | ||
cy.get('form').submit() | ||
}) | ||
|
||
it('should create local assets', () => { | ||
cy.visit('http://localhost:8080/settings/build') | ||
cy.get('#v-pills-style-tab').click() | ||
cy.wait(500) | ||
cy.get(':nth-child(2) > .CodeMirror-line').should('contain', '$background-color') | ||
}) | ||
|
||
it('should save assets form', () => { | ||
cy.request({method: 'POST', url: 'http://localhost:8080/settings/css', form: true, body: { | ||
variables: '$tester: #bababa', | ||
theme: '@import \'variables\'; .test-var { color: $tester; }' | ||
}}) | ||
}) | ||
|
||
it('should check css file', () => { | ||
cy.request('http://localhost:8080/css/base.css').its('body').should('contain', '.test-var') | ||
}) | ||
|
||
it('should delete assets', () => { | ||
cy.visit('http://localhost:8080/settings') | ||
cy.get('#v-pills-style-tab').click() | ||
cy.wait(500) | ||
cy.get('.btn-danger').click() | ||
}) | ||
|
||
it('should check css file after delete', () => { | ||
cy.request('http://localhost:8080/css/base.css').its('body').should('contain', 'BODY') | ||
}) | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
context('Dashboard Tests', () => { | ||
|
||
beforeEach(function() { | ||
cy.visit('http://localhost:8080/dashboard') | ||
cy.get('input[name="username"]').type('admin') | ||
cy.get('input[name="password"]').type('admin') | ||
cy.get('form').submit() | ||
}) | ||
|
||
it('should view logs', () => { | ||
cy.visit('http://localhost:8080/settings') | ||
cy.get(':nth-child(5) > .nav-link').click() | ||
cy.wait(10000) | ||
cy.get('#live_logs').should('contain', 'Service') | ||
}) | ||
|
||
it('should view help', () => { | ||
cy.visit('http://localhost:8080/settings') | ||
cy.get(':nth-child(6) > .nav-link').click() | ||
cy.title().should('eq', 'Statup | Help') | ||
cy.get('.col-12 > :nth-child(1)').should('contain', 'Statup') | ||
}) | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
context('Service Tests', () => { | ||
|
||
beforeEach(function () { | ||
cy.visit('http://localhost:8080/dashboard') | ||
cy.get('input[name="username"]').type('admin') | ||
cy.get('input[name="password"]').type('admin') | ||
cy.get('form').submit() | ||
}) | ||
|
||
it('should view services', () => { | ||
cy.visit('http://localhost:8080/services') | ||
cy.get('tr').should('have.length', 6) | ||
cy.title().should('eq', 'Statup | Services') | ||
}) | ||
|
||
it('should create services', () => { | ||
cy.visit('http://localhost:8080/services') | ||
cy.get('input[name="name"]').type('Google.com') | ||
cy.get('input[name="domain"]').type('https://google.com') | ||
cy.get('input[name="interval"]').type('30') | ||
cy.get('form').submit() | ||
cy.title().should('eq', 'Statup | Services') | ||
cy.get('tr').should('have.length', 7) | ||
}) | ||
|
||
it('should delete a service', () => { | ||
cy.visit('http://localhost:8080/services') | ||
cy.get(':nth-child(5) > .text-right > .btn-group > .btn-danger').click() | ||
cy.title().should('eq', 'Statup | Services') | ||
cy.get('tr').should('have.length', 6) | ||
}) | ||
|
||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
context('Settings Forms', () => { | ||
|
||
beforeEach(function() { | ||
cy.visit('http://localhost:8080/dashboard') | ||
cy.get('input[name="username"]').type('admin') | ||
cy.get('input[name="password"]').type('admin') | ||
cy.get('form').submit() | ||
}) | ||
|
||
it('should edit main settings', () => { | ||
cy.visit('http://localhost:8080/settings') | ||
cy.get('input[name="project"]').clear().type('Project Updated') | ||
cy.get('input[name="description"]').clear().type('This is an awesome page') | ||
cy.get('input[name="domain"]').clear().type('http://0.0.0.0:8080') | ||
cy.get('textarea[name="footer"]').clear().type('This is a custom footer') | ||
cy.get('#v-pills-home > form').submit() | ||
cy.title().should('eq', 'Statup | Settings') | ||
cy.get('input[name="project"]').should('have.value', 'Project Updated') | ||
cy.get('input[name="description"]').should('have.value', 'This is an awesome page') | ||
cy.get('input[name="domain"]').should('have.value', 'http://0.0.0.0:8080') | ||
cy.get('.footer').should('contain', 'This is a custom footer') | ||
}) | ||
|
||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
context('User Testing', () => { | ||
|
||
beforeEach(function () { | ||
cy.visit('http://localhost:8080/dashboard') | ||
cy.get('input[name="username"]').type('admin') | ||
cy.get('input[name="password"]').type('admin') | ||
cy.get('form').submit() | ||
}) | ||
|
||
it('should view users', () => { | ||
cy.visit('http://localhost:8080/users') | ||
cy.get('tr').should('have.length', 2) | ||
cy.title().should('eq', 'Statup | Users') | ||
}) | ||
|
||
it('should create a new user', () => { | ||
cy.visit('http://localhost:8080/users') | ||
cy.get('input[name="username"]').type('hunterlong') | ||
cy.get('input[name="email"]').type('[email protected]') | ||
cy.get('input[name="password"]').type('admin') | ||
cy.get('input[name="password_confirm"]').type('admin') | ||
cy.get('form').submit() | ||
cy.get('tr').should('have.length', 3) | ||
}) | ||
|
||
it('should delete a user', () => { | ||
cy.visit('http://localhost:8080/users') | ||
cy.get('#user_2 > .btn-group > .btn-danger').click() | ||
cy.get('tr').should('have.length', 2) | ||
}) | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// *********************************************************** | ||
// This example plugins/index.js can be used to load plugins | ||
// | ||
// You can change the location of this file or turn off loading | ||
// the plugins file with the 'pluginsFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/plugins-guide | ||
// *********************************************************** | ||
|
||
// This function is called when a project is opened or re-opened (e.g. due to | ||
// the project's config changing) | ||
|
||
module.exports = (on, config) => { | ||
// `on` is used to hook into various events Cypress emits | ||
// `config` is the resolved Cypress config | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// *********************************************** | ||
// This example commands.js shows you how to | ||
// create various custom commands and overwrite | ||
// existing commands. | ||
// | ||
// For more comprehensive examples of custom | ||
// commands please read more here: | ||
// https://on.cypress.io/custom-commands | ||
// *********************************************** | ||
// | ||
// | ||
// -- This is a parent command -- | ||
// Cypress.Commands.add("login", (email, password) => { ... }) | ||
// | ||
// | ||
// -- This is a child command -- | ||
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This is a dual command -- | ||
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This is will overwrite an existing command -- | ||
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// *********************************************************** | ||
// This example support/index.js is processed and | ||
// loaded automatically before your test files. | ||
// | ||
// This is a great place to put global configuration and | ||
// behavior that modifies Cypress. | ||
// | ||
// You can change the location of this file or turn off | ||
// automatically serving support files with the | ||
// 'supportFile' configuration option. | ||
// | ||
// You can read more here: | ||
// https://on.cypress.io/configuration | ||
// *********************************************************** | ||
|
||
// Import commands.js using ES2015 syntax: | ||
import './commands' | ||
|
||
// Alternatively you can use CommonJS syntax: | ||
// require('./commands') |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.