Skip to content
This repository has been archived by the owner on Oct 18, 2018. It is now read-only.

Add web tests #6

Open
wants to merge 2 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
63 changes: 63 additions & 0 deletions phantomjsdriver.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
[INFO - 2014-11-25T16:41:32.574Z] GhostDriver - Main - running on port 8197
[INFO - 2014-11-25T16:41:33.195Z] Session [ea087350-74c1-11e4-afe3-27c7cad584fe] - page.settings - {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; PPC Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.7 Safari/534.34","webSecurityEnabled":true}
[INFO - 2014-11-25T16:41:33.195Z] Session [ea087350-74c1-11e4-afe3-27c7cad584fe] - page.customHeaders: - {}
[INFO - 2014-11-25T16:41:33.195Z] Session [ea087350-74c1-11e4-afe3-27c7cad584fe] - Session.negotiatedCapabilities - {"browserName":"phantomjs","version":"1.9.7","driverName":"ghostdriver","driverVersion":"1.1.0","platform":"mac-unknown-64bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
[INFO - 2014-11-25T16:41:33.195Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: ea087350-74c1-11e4-afe3-27c7cad584fe
[INFO - 2014-11-25T16:42:40.401Z] GhostDriver - Main - running on port 29080
[INFO - 2014-11-25T16:42:41.006Z] Session [12740bb0-74c2-11e4-ad10-139f7d274b42] - page.settings - {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; PPC Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.7 Safari/534.34","webSecurityEnabled":true}
[INFO - 2014-11-25T16:42:41.007Z] Session [12740bb0-74c2-11e4-ad10-139f7d274b42] - page.customHeaders: - {}
[INFO - 2014-11-25T16:42:41.007Z] Session [12740bb0-74c2-11e4-ad10-139f7d274b42] - Session.negotiatedCapabilities - {"browserName":"phantomjs","version":"1.9.7","driverName":"ghostdriver","driverVersion":"1.1.0","platform":"mac-unknown-64bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
[INFO - 2014-11-25T16:42:41.007Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 12740bb0-74c2-11e4-ad10-139f7d274b42
[INFO - 2014-11-25T16:43:31.039Z] GhostDriver - Main - running on port 21109
[INFO - 2014-11-25T16:43:31.619Z] Session [309ed2f0-74c2-11e4-8d6b-519401e221ef] - page.settings - {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; PPC Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.7 Safari/534.34","webSecurityEnabled":true}
[INFO - 2014-11-25T16:43:31.619Z] Session [309ed2f0-74c2-11e4-8d6b-519401e221ef] - page.customHeaders: - {}
[INFO - 2014-11-25T16:43:31.620Z] Session [309ed2f0-74c2-11e4-8d6b-519401e221ef] - Session.negotiatedCapabilities - {"browserName":"phantomjs","version":"1.9.7","driverName":"ghostdriver","driverVersion":"1.1.0","platform":"mac-unknown-64bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
[INFO - 2014-11-25T16:43:31.620Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 309ed2f0-74c2-11e4-8d6b-519401e221ef
[INFO - 2014-11-25T16:44:06.512Z] GhostDriver - Main - running on port 22999
[INFO - 2014-11-25T16:44:07.063Z] Session [45bf4d40-74c2-11e4-86bd-3b0c65fc48f2] - page.settings - {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; PPC Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.7 Safari/534.34","webSecurityEnabled":true}
[INFO - 2014-11-25T16:44:07.063Z] Session [45bf4d40-74c2-11e4-86bd-3b0c65fc48f2] - page.customHeaders: - {}
[INFO - 2014-11-25T16:44:07.063Z] Session [45bf4d40-74c2-11e4-86bd-3b0c65fc48f2] - Session.negotiatedCapabilities - {"browserName":"phantomjs","version":"1.9.7","driverName":"ghostdriver","driverVersion":"1.1.0","platform":"mac-unknown-64bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
[INFO - 2014-11-25T16:44:07.064Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 45bf4d40-74c2-11e4-86bd-3b0c65fc48f2
[INFO - 2014-11-25T16:46:32.571Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
[INFO - 2014-11-25T16:47:40.400Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
[INFO - 2014-11-25T16:48:31.040Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
[INFO - 2014-11-25T16:49:06.513Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
[INFO - 2014-11-25T16:51:32.571Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
[INFO - 2014-11-25T16:52:40.400Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
[INFO - 2014-11-25T16:53:31.040Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
[INFO - 2014-11-25T16:54:06.514Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
[INFO - 2014-11-25T16:55:52.670Z] GhostDriver - Main - running on port 40137
[INFO - 2014-11-25T16:55:53.189Z] Session [eaa19420-74c3-11e4-8fb5-7f676f255fa1] - page.settings - {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; PPC Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.7 Safari/534.34","webSecurityEnabled":true}
[INFO - 2014-11-25T16:55:53.189Z] Session [eaa19420-74c3-11e4-8fb5-7f676f255fa1] - page.customHeaders: - {}
[INFO - 2014-11-25T16:55:53.189Z] Session [eaa19420-74c3-11e4-8fb5-7f676f255fa1] - Session.negotiatedCapabilities - {"browserName":"phantomjs","version":"1.9.7","driverName":"ghostdriver","driverVersion":"1.1.0","platform":"mac-unknown-64bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
[INFO - 2014-11-25T16:55:53.189Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: eaa19420-74c3-11e4-8fb5-7f676f255fa1
[INFO - 2014-11-25T16:55:53.246Z] ShutdownReqHand - _handle - About to shutdown
[INFO - 2014-11-25T16:56:32.572Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
[INFO - 2014-11-25T16:57:04.812Z] GhostDriver - Main - running on port 38956
[INFO - 2014-11-25T16:57:05.321Z] Session [15a00c60-74c4-11e4-89cb-0bd6fd273020] - page.settings - {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; PPC Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.7 Safari/534.34","webSecurityEnabled":true}
[INFO - 2014-11-25T16:57:05.321Z] Session [15a00c60-74c4-11e4-89cb-0bd6fd273020] - page.customHeaders: - {}
[INFO - 2014-11-25T16:57:05.321Z] Session [15a00c60-74c4-11e4-89cb-0bd6fd273020] - Session.negotiatedCapabilities - {"browserName":"phantomjs","version":"1.9.7","driverName":"ghostdriver","driverVersion":"1.1.0","platform":"mac-unknown-64bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
[INFO - 2014-11-25T16:57:05.321Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 15a00c60-74c4-11e4-89cb-0bd6fd273020
[INFO - 2014-11-25T16:57:05.373Z] ShutdownReqHand - _handle - About to shutdown
[INFO - 2014-11-25T16:57:40.400Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
[INFO - 2014-11-25T16:57:49.616Z] GhostDriver - Main - running on port 16014
[INFO - 2014-11-25T16:57:49.992Z] Session [303fff30-74c4-11e4-9e31-5bc560ae157b] - page.settings - {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; PPC Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.7 Safari/534.34","webSecurityEnabled":true}
[INFO - 2014-11-25T16:57:49.992Z] Session [303fff30-74c4-11e4-9e31-5bc560ae157b] - page.customHeaders: - {}
[INFO - 2014-11-25T16:57:49.999Z] Session [303fff30-74c4-11e4-9e31-5bc560ae157b] - Session.negotiatedCapabilities - {"browserName":"phantomjs","version":"1.9.7","driverName":"ghostdriver","driverVersion":"1.1.0","platform":"mac-unknown-64bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
[INFO - 2014-11-25T16:57:50.010Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 303fff30-74c4-11e4-9e31-5bc560ae157b
[INFO - 2014-11-25T16:57:50.060Z] ShutdownReqHand - _handle - About to shutdown
[INFO - 2014-11-25T16:58:31.040Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
[INFO - 2014-11-25T16:59:06.515Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
[INFO - 2014-11-25T17:00:32.769Z] GhostDriver - Main - running on port 25081
[INFO - 2014-11-25T17:00:33.308Z] Session [91985890-74c4-11e4-a209-4520a42fd3b3] - page.settings - {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; PPC Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.7 Safari/534.34","webSecurityEnabled":true}
[INFO - 2014-11-25T17:00:33.308Z] Session [91985890-74c4-11e4-a209-4520a42fd3b3] - page.customHeaders: - {}
[INFO - 2014-11-25T17:00:33.309Z] Session [91985890-74c4-11e4-a209-4520a42fd3b3] - Session.negotiatedCapabilities - {"browserName":"phantomjs","version":"1.9.7","driverName":"ghostdriver","driverVersion":"1.1.0","platform":"mac-unknown-64bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
[INFO - 2014-11-25T17:00:33.309Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 91985890-74c4-11e4-a209-4520a42fd3b3
[INFO - 2014-11-25T17:00:33.364Z] ShutdownReqHand - _handle - About to shutdown
[INFO - 2014-11-25T17:01:09.380Z] GhostDriver - Main - running on port 41527
[INFO - 2014-11-25T17:01:09.942Z] Session [a76e1920-74c4-11e4-850b-61d8ee94d550] - page.settings - {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Macintosh; PPC Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.7 Safari/534.34","webSecurityEnabled":true}
[INFO - 2014-11-25T17:01:09.942Z] Session [a76e1920-74c4-11e4-850b-61d8ee94d550] - page.customHeaders: - {}
[INFO - 2014-11-25T17:01:09.943Z] Session [a76e1920-74c4-11e4-850b-61d8ee94d550] - Session.negotiatedCapabilities - {"browserName":"phantomjs","version":"1.9.7","driverName":"ghostdriver","driverVersion":"1.1.0","platform":"mac-unknown-64bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
[INFO - 2014-11-25T17:01:09.943Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: a76e1920-74c4-11e4-850b-61d8ee94d550
[INFO - 2014-11-25T17:01:10.452Z] ShutdownReqHand - _handle - About to shutdown
[INFO - 2014-11-25T17:01:32.573Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
94 changes: 82 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@

<jersey.version>2.13</jersey.version>
<sl4j.version>1.7.7</sl4j.version>
<jetty.host>localhost</jetty.host>
<jetty.port>9998</jetty.port>

<environment>test</environment>

</properties>

<dependencies>
Expand Down Expand Up @@ -75,6 +77,12 @@
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.detro.ghostdriver</groupId>
<artifactId>phantomjsdriver</artifactId>
<version>1.1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.stefanbirkner</groupId>
<artifactId>system-rules</artifactId>
Expand Down Expand Up @@ -136,28 +144,90 @@
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.1.3.v20140225</version>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<configuration>
<scanIntervalSeconds>0</scanIntervalSeconds>
<excludes>
<exclude>**/*WebTest.java</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.17</version>
<configuration>
<includes>
<include>**/*WebTest.java</include>
</includes>
<systemProperties>
<systemProperty>
<name>environment</name>
<value>prod</value>
<name>webdriver.baseurl</name>
<value>http://${jetty.host}:${jetty.port}</value>
</systemProperty>
</systemProperties>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>2.18</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<id>verify</id>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.1.3.v20140225</version>
<configuration>
<scanIntervalSeconds>0</scanIntervalSeconds>
<webApp>
<contextPath>/</contextPath>
</webApp>
<stopPort>9847</stopPort>
<stopKey>tms-local</stopKey>
<jvmArgs>
-Xmx1024m
-XX:MaxPermSize=512m
</jvmArgs>
<goal>run-forked</goal>
<stopPort>9847</stopPort>
</configuration>
<executions>
<execution>
<id>start-jetty</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
<configuration>
<systemProperties>
<systemProperty>
<name>environment</name>
<value>test</value>
</systemProperty>
</systemProperties>
<scanIntervalSeconds>0</scanIntervalSeconds>
<daemon>true</daemon>
</configuration>
</execution>
<execution>
<id>stop-jetty</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class DatabaseProvider implements ContainerRequestFilter {
static {
try {
ServerConfig config = ServerConfig.newInstance();
dbUrl = format("jdbc:h2:%s/%s,user=%s", config.getDbLocation(), config.getDbName(), DBUSER);
dbUrl = format("jdbc:h2:%s:%s,user=%s", config.getDbLocation(), config.getDbName(), DBUSER);
logger.info(format("Starting embedded database with url '%s' ...", dbUrl));
openConnection();
Flyway flyway = new Flyway();
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/index.ftl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<#-- @ftlvariable name="model" type="ru.qatools.school.switter.models.Post[]" -->
<#import "/layouts/main.ftl" as layout />
<@layout.layout title="Blog: posts">
<@layout.layout title="Switter">
<div class="row">
<div class="col-md-12">
<div class="page-header">
Expand Down
Loading