Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travisselenium #8

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:
- secure: kWYqUiO9op6e5u+5ygCSfUVnuTVvXuLYETnllCB5tqcbDN2bO+HUJiS48yA+944KpbnhGVT+6sv1eCwTkrKdTZ7pNmun9IzBIRCrelW+duOv4YCSEYe0mVBUWk7qIDimaSeOLt9Ifz1EsWCJSh+09j9sdaIUbzBmTnNBErl3Jkw3hvBpvR0QFftI8PB3M3w6b4DFr2rR5cRTwAIL06I/awLA+U4/EGZ3zI5gIXTO/08GJebLaGKTjD5gO0nVHT0gptKvJxLfMjUiEZwc3e5DZKq+SMClxmWcw285HPziRlqiYi8MXFU4zVPS6hCDrvmWEIbhS0DNh4yq9johkw3CBuCQAznNlGGXX21boC4g+RP0+WrdgUMT3uN/5LFm4Jw0EroYrjXmP/wnyCxBRDkqINBYgdGU8KnnuTSm/oaAVA/1iuTEaOXuM8foGnbkP/QJOzWsKgK4feYi6xMsyMHTtxwZWiLgpX4Ozp1szmsRjSLyWPRbdca1SBEzIkoJ0bRncuRRJ1MhEeX8qbEFmht8sD/CzxtDX4O1EhvJiYqe/3nwge2HLM2oqPkdXRN0527XZVJD8IG0O7qrCQqilisGHaDUNhtkWwKMvHc9qpHbxEGj5g3fvafPX82D1DwlAfViQGkAlku2yg0C/NMRApPJgPZrKdCOKPp2cEe9T6Imvrk=

addons:
sauce_connect: true
- selenium

before_install:
- npm install -g grunt-cli
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![Build Status](https://travis-ci.org/BooksterTeam/Bookster2.svg?branch=master)](https://travis-ci.org/BooksterTeam/Bookster2)
[![Quality Gate](http://193.196.7.25/api/badges/gate?key=io.bookster:bookster-2)](http://193.196.7.25/overview?id=5973)
# Bookster2

This application was generated using JHipster, you can find documentation and help at [https://jhipster.github.io](https://jhipster.github.io).
Expand Down
46 changes: 30 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,20 @@ buildscript {
}
}


apply plugin: 'java'
sourceCompatibility=1.8
targetCompatibility=1.8
sourceCompatibility = 1.8
targetCompatibility = 1.8
apply plugin: 'maven'
apply plugin: 'spring-boot'
apply plugin: 'war'
apply plugin: 'propdeps'
apply plugin: 'sonar-runner'
apply plugin: 'jacoco'
defaultTasks 'bootRun'

bootRepackage {
mainClass = 'io.bookster.Bookster2App'
mainClass = 'io.bookster.Bookster2App'
}

war {
Expand Down Expand Up @@ -111,7 +114,7 @@ dependencies {
compile group: 'io.dropwizard.metrics', name: 'metrics-jvm', version: dropwizard_metrics_version
compile group: 'io.dropwizard.metrics', name: 'metrics-servlet', version: dropwizard_metrics_version
compile group: 'io.dropwizard.metrics', name: 'metrics-json', version: dropwizard_metrics_version
compile (group: 'io.dropwizard.metrics', name: 'metrics-servlets', version: dropwizard_metrics_version) {
compile(group: 'io.dropwizard.metrics', name: 'metrics-servlets', version: dropwizard_metrics_version) {
exclude(module: 'metrics-healthchecks')
}
compile(group: 'net.logstash.logback', name: 'logstash-logback-encoder', version: logstash_logback_encoder_version) {
Expand All @@ -123,10 +126,10 @@ dependencies {
compile group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-hibernate4', version: jackson_version
compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: jackson_version
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: jackson_version
compile (group: 'com.ryantenney.metrics', name: 'metrics-spring', version: metrics_spring_version) {
compile(group: 'com.ryantenney.metrics', name: 'metrics-spring', version: metrics_spring_version) {
exclude(module: 'metrics-core')
exclude(module: 'metrics-healthchecks')
}
}
compile(group: 'com.zaxxer', name: 'HikariCP', version: HikariCP_version) {
exclude(module: 'tools')
}
Expand All @@ -136,13 +139,13 @@ dependencies {
compile group: 'javax.transaction', name: 'javax.transaction-api'
compile group: 'org.apache.geronimo.javamail', name: 'geronimo-javamail_1.4_mail', version: geronimo_javamail_1_4_mail_version
compile group: 'org.hibernate', name: 'hibernate-core', version: hibernate_entitymanager_version
compile (group: 'org.hibernate', name: 'hibernate-ehcache') {

compile(group: 'org.hibernate', name: 'hibernate-ehcache') {
exclude(module: 'ehcache-core')
}
compile group: 'org.hibernate', name: 'hibernate-envers'
compile group: 'org.hibernate', name: 'hibernate-validator'
compile (group: 'org.liquibase', name: 'liquibase-core', version: liquibase_core_version) {
compile(group: 'org.liquibase', name: 'liquibase-core', version: liquibase_core_version) {
exclude(module: 'jetty-servlet')
}
compile group: 'com.mattbertolini', name: 'liquibase-slf4j', version: liquibase_slf4j_version
Expand All @@ -166,12 +169,12 @@ dependencies {
compile group: 'org.springframework.security', name: 'spring-security-config', version: spring_security_version
compile group: 'org.springframework.security', name: 'spring-security-data', version: spring_security_version
compile group: 'org.springframework.security', name: 'spring-security-web', version: spring_security_version
compile group: 'org.springframework.security', name: 'spring-security-messaging', version: spring_security_version
compile group: 'org.springframework.security', name: 'spring-security-messaging', version: spring_security_version

compile(group: 'io.springfox', name: 'springfox-swagger2', version: springfox_version){
compile(group: 'io.springfox', name: 'springfox-swagger2', version: springfox_version) {
exclude module: 'mapstruct'
}

compile group: 'mysql', name: 'mysql-connector-java'
compile group: 'com.h2database', name: 'h2'
compile group: 'fr.ippon.spark.metrics', name: 'metrics-spark-reporter', version: metrics_spark_reporter_version
Expand All @@ -181,14 +184,14 @@ dependencies {
testCompile group: 'info.cukes', name: 'cucumber-junit', version: cucumber_version
testCompile group: 'info.cukes', name: 'cucumber-spring', version: cucumber_version
testCompile group: 'org.springframework.boot', name: 'spring-boot-starter-test'
testCompile group: 'org.assertj', name: 'assertj-core', version: assertj_core_version
testCompile group: 'org.assertj', name: 'assertj-core', version: assertj_core_version
testCompile group: 'junit', name: 'junit'
testCompile group: 'org.mockito', name: 'mockito-core'
testCompile group: 'com.mattbertolini', name: 'liquibase-slf4j', version: liquibase_slf4j_version
testCompile group: 'org.hamcrest', name: 'hamcrest-library'
optional group: 'org.springframework.boot', name:'spring-boot-configuration-processor', version: spring_boot_version


optional group: 'org.springframework.boot', name: 'spring-boot-configuration-processor', version: spring_boot_version
//jhipster-needle-gradle-dependency - JHipster will add additional dependencies here
testCompile "org.seleniumhq.selenium:selenium-java:2.48.2"
}
Expand All @@ -205,3 +208,14 @@ task wrapper(type: Wrapper) {

task stage(dependsOn: 'bootRepackage') {
}

sonarRunner {
sonarProperties {
property "sonar.host.url", "http://193.196.7.25/"
property "sonar.projectName", "bookster2"
property "sonar.projectVersions", "1.0.0"
property "sonar.sources", "src/main/java/io/bookster"
property "sourceEncoding", "UTF-8"
//property "sonar.jacoco.reportPath", "${project.buildDir}/jacoco/test.exec"
}
}
20 changes: 20 additions & 0 deletions src/main/java/io/bookster/domain/enumeration/AcceptRequest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package io.bookster.domain.enumeration;

import io.bookster.domain.LendingRequest;

/**
* Created on 08/05/16
* author: nixoxo
*/
public class AcceptRequest implements Request {

public AcceptRequest(){

}

@Override
public LendingRequest process(LendingRequest lendingRequest) {
lendingRequest.setStatus(RequestStatus.ACCEPTED);
return lendingRequest;
}
}
20 changes: 20 additions & 0 deletions src/main/java/io/bookster/domain/enumeration/CancelRequest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package io.bookster.domain.enumeration;

import io.bookster.domain.LendingRequest;

/**
* Created on 08/05/16
* author: nixoxo
*/
public class CancelRequest implements Request {

public CancelRequest(){

}

@Override
public LendingRequest process(LendingRequest lendingRequest) {
lendingRequest.setStatus(RequestStatus.CANCELED);
return lendingRequest;
}
}
22 changes: 22 additions & 0 deletions src/main/java/io/bookster/domain/enumeration/PendingRequest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package io.bookster.domain.enumeration;

import io.bookster.domain.LendingRequest;

/**
* Created on 08/05/16
* author: nixoxo
*/
public class PendingRequest implements Request {

public PendingRequest() {

}

@Override
public LendingRequest process(LendingRequest lendingRequest) {

lendingRequest.setStatus(RequestStatus.PENDING);

return lendingRequest;
}
}
15 changes: 15 additions & 0 deletions src/main/java/io/bookster/domain/enumeration/RejectRequest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package io.bookster.domain.enumeration;

import io.bookster.domain.LendingRequest;

/**
* Created on 08/05/16
* author: nixoxo
*/
public class RejectRequest implements Request {
@Override
public LendingRequest process(LendingRequest lendingRequest) {
lendingRequest.setStatus(RequestStatus.REJECTED);
return lendingRequest;
}
}
13 changes: 13 additions & 0 deletions src/main/java/io/bookster/domain/enumeration/Request.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package io.bookster.domain.enumeration;

import io.bookster.domain.LendingRequest;

/**
* Created on 08/05/16
* author: nixoxo
*/
public interface Request {

public LendingRequest process(LendingRequest lendingRequest);

}
34 changes: 34 additions & 0 deletions src/main/java/io/bookster/domain/enumeration/RequestFactory.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package io.bookster.domain.enumeration;

/**
* Created on 08/05/16
* author: nixoxo
*/
public class RequestFactory {

private static RequestFactory requestFactory = new RequestFactory();

private RequestFactory() {
}

public static Request pendingRequest() {
return new PendingRequest();
}

public static Request cancelRequest() {
return new CancelRequest();
}

public static Request acceptRequest(){
return new AcceptRequest();
}

public static Request rejectRequest(){
return new RejectRequest();
}


public static RequestFactory getRequestFactory() {
return requestFactory;
}
}
32 changes: 16 additions & 16 deletions src/main/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,6 @@
<script src="app/entities/author/author-dialog.controller.js"></script>
<script src="app/entities/author/author-detail.controller.js"></script>
<script src="app/entities/author/author-delete-dialog.controller.js"></script>
<script src="app/blocks/interceptor/notification.interceptor.js"></script>
<script src="app/blocks/interceptor/errorhandler.interceptor.js"></script>
<script src="app/blocks/interceptor/auth-expired.interceptor.js"></script>
<script src="app/blocks/handlers/translation.handler.js"></script>
<script src="app/blocks/handlers/state.handler.js"></script>
<script src="app/blocks/config/translation.config.js"></script>
<script src="app/blocks/config/translation-storage.provider.js"></script>
<script src="app/blocks/config/localstorage.config.js"></script>
<script src="app/blocks/config/http.config.js"></script>
<script src="app/blocks/config/compile.config.js"></script>
<script src="app/blocks/config/alert.config.js"></script>
<script src="app/components/util/truncate-words.filter.js"></script>
<script src="app/components/util/truncate-characters.filter.js"></script>
<script src="app/components/util/sort.directive.js"></script>
Expand All @@ -186,6 +175,17 @@
<script src="app/components/alert/alert.service.js"></script>
<script src="app/components/alert/alert.directive.js"></script>
<script src="app/components/alert/alert-error.directive.js"></script>
<script src="app/blocks/interceptor/notification.interceptor.js"></script>
<script src="app/blocks/interceptor/errorhandler.interceptor.js"></script>
<script src="app/blocks/interceptor/auth-expired.interceptor.js"></script>
<script src="app/blocks/handlers/translation.handler.js"></script>
<script src="app/blocks/handlers/state.handler.js"></script>
<script src="app/blocks/config/translation.config.js"></script>
<script src="app/blocks/config/translation-storage.provider.js"></script>
<script src="app/blocks/config/localstorage.config.js"></script>
<script src="app/blocks/config/http.config.js"></script>
<script src="app/blocks/config/compile.config.js"></script>
<script src="app/blocks/config/alert.config.js"></script>
<script src="app/admin/user-management/user-management.state.js"></script>
<script src="app/admin/user-management/user-management.controller.js"></script>
<script src="app/admin/user-management/user-management-dialog.controller.js"></script>
Expand All @@ -206,18 +206,18 @@
<script src="app/admin/health/health.modal.controller.js"></script>
<script src="app/admin/health/health.controller.js"></script>
<script src="app/admin/docs/docs.state.js"></script>
<script src="app/admin/audits/audits.state.js"></script>
<script src="app/admin/audits/audits.service.js"></script>
<script src="app/admin/audits/audits.controller.js"></script>
<script src="app/admin/configuration/configuration.state.js"></script>
<script src="app/admin/configuration/configuration.service.js"></script>
<script src="app/admin/configuration/configuration.controller.js"></script>
<script src="app/admin/audits/audits.state.js"></script>
<script src="app/admin/audits/audits.service.js"></script>
<script src="app/admin/audits/audits.controller.js"></script>
<script src="app/account/settings/settings.state.js"></script>
<script src="app/account/settings/settings.controller.js"></script>
<script src="app/account/register/register.state.js"></script>
<script src="app/account/register/register.controller.js"></script>
<script src="app/account/sessions/sessions.state.js"></script>
<script src="app/account/sessions/sessions.controller.js"></script>
<script src="app/account/register/register.state.js"></script>
<script src="app/account/register/register.controller.js"></script>
<script src="app/account/password/password.state.js"></script>
<script src="app/account/password/password.controller.js"></script>
<script src="app/account/password/password-strength-bar.directive.js"></script>
Expand Down
4 changes: 4 additions & 0 deletions src/test/features/books.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ Feature: This should describe the feature of displaying books
Given user authenticated and clicked on the market
Then books are shown
Then one book has the id 'details1001'

Scenario: Retrieve no books
Given user authenticated and clicked on the market
Then no books are shown
6 changes: 6 additions & 0 deletions src/test/features/copy.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ Feature: This should describe the feature of adding a copy
Given a modal does pop up
Given add a copy for the book with the id '1001'
Then a copy has been added

Scenario: Add copy failed because book does not exist
Given user authenticated and navigated to the copys
Given a modal does pop up
Given add a copy for the book with the id '345678'
Then no copy has been added
4 changes: 2 additions & 2 deletions src/test/java/io/bookster/config/BaseDriverIntegration.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ private WebDriver firefoxDriver(){
protected void authenticate(WebDriver browser) throws InterruptedException {
browser.get(server);
Thread.sleep(500);
browser.findElement(id("account-menu")).click();
browser.findElement(id("login")).click();
// browser.findElement(id("account-menu")).click();
// browser.findElement(id("login")).click();
browser.findElement(id("username")).sendKeys("admin");
browser.findElement(id("password")).sendKeys("admin");
WebElement loginForm = browser.findElement(id("login-button"));
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/io/bookster/cucumber/CucumberTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
@CucumberOptions(plugin = "pretty", features = "src/test/features/register.feature")
@CucumberOptions(plugin = "pretty", features = "src/test/features/books.feature")
public class CucumberTest {

}
8 changes: 8 additions & 0 deletions src/test/java/io/bookster/cucumber/stepdefs/BooksSteps.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package io.bookster.cucumber.stepdefs;

import cucumber.api.PendingException;
import cucumber.api.java.After;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import io.bookster.config.BaseDriverIntegration;
import org.hamcrest.Matchers;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;

import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.openqa.selenium.By.id;

Expand Down Expand Up @@ -44,4 +47,9 @@ public void oneBookHasTheIdDetails(int bookid) throws Throwable {
public void tearDown(){
closeBrowser();
}

@Then("^no books are shown$")
public void noBooksAreShown() throws Throwable {

}
}
Loading