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

Commit

Permalink
Merge pull request #131 from gchq/gh-129-ui-test
Browse files Browse the repository at this point in the history
Gh 129 ui test
  • Loading branch information
p013570 authored Jun 21, 2017
2 parents a79ee23 + 0f9b800 commit ff281e2
Show file tree
Hide file tree
Showing 11 changed files with 318 additions and 34 deletions.
12 changes: 10 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ jdk:
- oraclejdk8
sudo: false
addons:
firefox: latest
apt:
packages:
- oracle-java8-installer
Expand All @@ -18,11 +19,18 @@ env:
- secure: "UXLzQaMHjae+k9tAulrjsbh9Bj3/a/8dCJpJuNXRwtsEJPD58v7hWK18+00D5BLekfLb5t8tng/n6Pl7KMjpZxCoQd3gQ06V74I08ex/bR1BYSIPh0orc7Eg7CHLfHyafaxdpPzLJSRV1Ar886qn68MHlaKhQ5wgzFCXJ3lp9090XEKv26vwVCQGkY+IlqNMJp43Dhu+wgI73HArxskBKeRxNYCdp8KpoK7q+hIja5o2ptQPG3EiclWNE05BsRe7APMTnszWH1IVJomcXtpQYIuie+GXsdaPeSBgmnbnN5ZYj6kaOWoqgPQ0iEq+k4TTV1vzvANawjxaLkcJFPpcM0P/Pm2ujpMMY7Vs4YZEokkzXrqxvP+zOXNAujCJu8HUe8moWPB7aJpq7ZqhCPqlCxwbM8xg/3ZOTSbqwAf1ygYfgf0fo6giKB/crKLQ49vq8m9CQb3ikjMU3D5ksppjWh7DBASOi2B7ok0ENnAy8gdw/8rJ+RnJGlMolsWFkk65i0q+rtvbS9nHGbejKA3+MmKQYNaT29mweRibjNZ6IbhLLndG2iz+AW5DAVHa3JcY3OTy9BQmKr+1gwnJvLnG0mQ+77JMDo5cVkEeS8bqwl36vgeFnJRN24PbpcXSn+m5GViBIZfxZd/d9r1XI3f6VcHCv1h1PG+APQPtTrIgalQ="
- secure: "2mIgYi3USn9sB+3gQ0ULyRXspQUmpR/5M8StHzfMQ2aBGeSV9MaZ3mHxBZGoGIMejpLxE1dGLFagUZRbuH/gk+OI7tphEanfYN7quAdou0f/SzEMXEi5hlBkqFjl3eXE3FpMt5huxO5hBj2UD7dpMTe2AmIAM2LcEr1zybrQ78G19fDVJX6L5C5APC/5IKpPY4l50iFpv/A9GyT/i2Ax/FskCp73K3z5u3vCX+FsAAKu5iS63VKSdVzmjP5B+vRvLOZd80SvldDMmQM6gXTzpGiM6PoH+gehINT3Csq54mTsh6qDGMn1fPiFaczIRXc5Goe31UzhdN3aCVsnhPSoT+hTMwgNeCFcJRZbBntXoO9oUHtkjRkE9Vaz+0i//Yz6xs5k1CyN3Cm/iAQmSPsc3uS9sAlTTKH+oO6U4vcr7CAEUI78wUGLYMxiy0YEVfHHpFFiSyiPVwiVo4Y+EN1qtJp0zN4z7xecWpxgcnz7tORkK07QICiYpOnRKgbnM4Sz+8a//j9JZnZh/MTLudTCwZtWyJfqQkdWiKO4hHHWXiNF1rRY61EHrScx9w331Esk+EILSjuyZiqTIDlG/cd9gWIR26XxRiE2c4o4vELZMGngB0EWiIzlnSssh3nZ4XBjN2YX6S9ZNUE/hoQjBjCFivqUWZ7NOdV439eNx8zvBPE="
install: mvn -q install -P quick,travis -B -V
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- curl -OL https://github.com/mozilla/geckodriver/releases/download/v0.17.0/geckodriver-v0.17.0-linux64.tar.gz
- tar -xf geckodriver-v0.17.0-linux64.tar.gz
- mv geckodriver ui/
script:
- mvn -q test -P travis,build-extras -B
- mvn install -P quick,road-traffic-demo -pl ui &
- mvn install -P quick,travis,road-traffic-demo -pl ui &
- sleep 2m
- cd python-shell && python3 -m unittest discover -s src
- mvn verify -P travis,system-test -Dwebdriver.gecko.driver=geckodriver -pl ui
- cd python-shell && python3 -m unittest discover -s src && cd ../
after_success:
- ./cd/before_deploy.sh
- ./cd/deploy.sh
5 changes: 5 additions & 0 deletions NOTICES
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ mike-hogan/jarjar-forkfork:
- Apache License, Version 2.0


Selenium (org.seleniumhq.selenium:selenium-server:3.4.0)

- Apache License, Version 2.0


----------------------------------------------------------------------

The UI contains the following javascript dependencies
Expand Down
60 changes: 60 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,64 @@
</license>
</licenses>

<profiles>
<profile>
<id>system-test</id>
<properties>
<skip.surefire.tests>true</skip.surefire.tests>
<skip.failsafe.tests>false</skip.failsafe.tests>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${failsafe.version}</version>
<executions>
<execution>
<id>system-test</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<skipITs>${skip.failsafe.tests}</skipITs>
<excludes>
<exclude>**/*$*</exclude>
<exclude>**/performance/**</exclude>
</excludes>
<includes>
<include>**/*SystemTest.java</include>
<include>**/*ST.java</include>
<include>**/*STs.java</include>
<include>**/*SystemTests.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<executions>
<execution>
<id>validate</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<executions>
<execution>
<id>analyze-compile</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
16 changes: 16 additions & 0 deletions ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,23 @@
<standalone-ui-path>ui</standalone-ui-path>
<standalone-rest-path>rest</standalone-rest-path>
<standalone-port>8080</standalone-port>
<selenium.version>3.4.0</selenium.version>
</properties>

<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>${selenium.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>21.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
Expand Down
4 changes: 4 additions & 0 deletions ui/src/main/webapp/app/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -546,5 +546,9 @@ angular.module('app').controller('AppController',
$scope.editingOperations = false;
}

$scope.onInOutFlagChange = function(newInOutFlag) {
$scope.inOutFlag = newInOutFlag;
}

$scope.initialise();
} ]);
4 changes: 2 additions & 2 deletions ui/src/main/webapp/app/graph/addSeedDialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ <h2>Add Seed</h2>

<md-dialog-actions layout="row">
<span flex></span>
<md-button ng-click="addSeedCancel()">
<md-button id="add-seed-cancel" ng-click="addSeedCancel()">
Cancel
</md-button>
<md-button ng-click="addSeedAdd()">
<md-button id="add-seed-confirm" ng-click="addSeedAdd()">
Add
</md-button>
</md-dialog-actions>
Expand Down
48 changes: 30 additions & 18 deletions ui/src/main/webapp/app/graph/graph.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ <h3>Build query</h3>
<md-content class="md-padding">
<h4>
Select seeds (ctrl click for multiple)
<button ng-click="graph.selectAllNodes()"
<button id="select-all-seeds"
ng-click="graph.selectAllNodes()"
class="btn btn-default">
Select all
</button>
Expand All @@ -73,7 +74,8 @@ <h4>
class="btn btn-default">
Cancel
</button>
<button ng-click="goToStep(2)"
<button id="step-1-next"
ng-click="goToStep(2)"
class="btn btn-primary"
ng-show="selectedEntitiesCount">
Next
Expand All @@ -90,9 +92,9 @@ <h4>Select related entities</h4>
</p>

<div ng-repeat="entity in relatedEntities">
<md-checkbox
ng-checked="exists(entity, expandEntities)"
ng-click="toggle(entity, expandEntities)">
<md-checkbox id="related-entity-{{entity}}"
ng-checked="exists(entity, expandEntities)"
ng-click="toggle(entity, expandEntities)">
{{entity}}
</md-checkbox>
</div>
Expand All @@ -105,9 +107,9 @@ <h4>Select related edges</h4>
</p>

<div ng-repeat="edge in relatedEdges">
<md-checkbox
ng-checked="exists(edge, expandEdges)"
ng-click="toggle(edge, expandEdges)">
<md-checkbox id="related-edge-{{edge}}"
ng-checked="exists(edge, expandEdges)"
ng-click="toggle(edge, expandEdges)">
{{edge}}
</md-checkbox>
</div>
Expand All @@ -116,7 +118,8 @@ <h4>Select related edges</h4>
class="btn btn-default">
Cancel
</button>
<button ng-click="goToStep(3)"
<button id="step-2-next"
ng-click="goToStep(3)"
class="btn btn-primary"
ng-show="(expandEntities.length + expandEdges.length)">
Next
Expand Down Expand Up @@ -158,7 +161,8 @@ <h5>
<tbody>
<tr ng-repeat="filter in expandEntitiesContent[entity].filters">
<td>
<select class="form-control"
<select id="{{entity}}-property-selector"
class="form-control"
ng-model="filter.property"
ng-options="name as name for (name, type) in rawData.entityProperties(entity)"
ng-change="onSelectedPropertyChange(entity, filter)">
Expand Down Expand Up @@ -201,7 +205,8 @@ <h5>
</tr>
</tbody>
</table>
<button ng-click="addFilterFunction(expandEntitiesContent, entity)"
<button id="{{entity}}-add-filter"
ng-click="addFilterFunction(expandEntitiesContent, entity)"
class="btn btn-default">
Add filter
</button>
Expand Down Expand Up @@ -232,7 +237,8 @@ <h5>
<tbody>
<tr ng-repeat="filter in expandEdgesContent[edge].filters">
<td>
<select class="form-control"
<select id="{{edge}}-property-selector"
class="form-control"
ng-model="filter.property"
ng-options="name as name for (name, type) in rawData.edgeProperties(edge)"
ng-change="onSelectedPropertyChange(edge, filter)">
Expand All @@ -243,7 +249,8 @@ <h5>
</select>
</td>
<td>
<select class="form-control"
<select id="{{edge}}-{{filter.property}}-predicate-selector"
class="form-control"
ng-model="filter.predicate"
ng-options="predicate as predicate for predicate in filter.availableFunctions"
ng-change="onSelectedFunctionChange(edge, filter)">
Expand All @@ -257,7 +264,8 @@ <h5>
<div ng-repeat="(idx, param) in filter.availableFunctionParameters">
<p class="inline">
{{param}}:</p>
<input type="text"
<input id="{{edge}}-{{filter.property}}-{{filter.predicate}}-{{param}}"
type="text"
class="form-control inline"
ng-model="filter.parameters[idx]">
</div>
Expand All @@ -274,7 +282,8 @@ <h5>
</tr>
</tbody>
</table>
<button ng-click="addFilterFunction(expandEdgesContent, edge)"
<button id="{{edge}}-add-filter"
ng-click="addFilterFunction(expandEdgesContent, edge)"
class="btn btn-default">
Add filter
</button>
Expand All @@ -285,7 +294,8 @@ <h5>
class="btn btn-default">
Cancel
</button>
<button ng-click="goToStep(4)"
<button id="step-3-next"
ng-click="goToStep(4)"
class="btn btn-primary">
Next
</button>
Expand All @@ -312,7 +322,8 @@ <h4>Additional query options</h4>
</p>
</div>

<md-radio-group id="inoutflag" ng-model="inOutFlag">
<md-radio-group id="inoutflag" ng-model="inOutFlag"
ng-change="onInOutFlagChange(inOutFlag)">
<label>In/Out edges:</label>
<md-radio-button value="INCOMING">
Incoming
Expand All @@ -329,7 +340,8 @@ <h4>Additional query options</h4>
class="btn btn-default">
Cancel
</button>
<button ng-click="executeBuildQuery()"
<button id="step-4-execute"
ng-click="executeBuildQuery()"
class="btn btn-primary">
Execute
</button>
Expand Down
15 changes: 9 additions & 6 deletions ui/src/main/webapp/app/nav/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,21 @@
<div id="navbar">
<ul class="nav navbar-nav">
<li ng-class="{ active: showGraph }">
<a href="#graph"
<a id="open-graph"
href="#graph"
ng-click="openGraph()">Graph</a>
</li>
<li ng-class="{ active: showResultsTable }">
<a href="#resultsTable"
<a id="open-table"
href="#resultsTable"
ng-click="openResultsTable()">Table</a>
</li>
<li ng-class="{ active: showRaw }">
<a href="#raw" ng-click="openRaw()">Raw</a>
<a id="open-raw" href="#raw" ng-click="openRaw()">Raw</a>
</li>
<li ng-class="{ active: showSettings }">
<a href="#settings" ng-click="openSettings()">Settings</a>
<a id="open-settings" href="#settings"
ng-click="openSettings()">Settings</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
Expand All @@ -31,13 +34,13 @@
</li>
<li><a class="nav-button"
ng-show="showGraph">
<button ng-click="addSeedPrompt()"
<button id="add-seed" ng-click="addSeedPrompt()"
class="btn btn-primary">Add Seed
</button>
</a></li>
<li><a class="nav-button"
ng-show="seeds.length != 0 || operations.length != 0">
<button ng-click="buildQuery()"
<button id="build-query" ng-click="buildQuery()"
class="btn btn-primary">Build query
</button>
</a></li>
Expand Down
10 changes: 6 additions & 4 deletions ui/src/main/webapp/app/raw/raw.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ <h3>
</h3>

<div ng-repeat="(i, json) in operations track by $index">
<pre ng-show="!editingOperations">
<pre id="operation-{{i}}-json"
ng-show="!editingOperations">
{{operations[i] | json}}
</pre>
<textarea ng-model="operationsForEdit[i]"
<textarea id="editing-operation-{{i}}-json"
ng-model="operationsForEdit[i]"
ng-blur="onOperationsChange()"
ng-show="editingOperations">>
</textarea>
Expand All @@ -44,12 +46,12 @@ <h3>
<h3>Results</h3>

<h4>Entities</h4>
<pre>
<pre id="raw-entity-results">
{{rawData.results.entities | json}}
</pre>

<h4>Edges</h4>
<pre>
<pre id="raw-edge-results">
{{rawData.results.edges | json}}
</pre>
</md-content>
Expand Down
Loading

0 comments on commit ff281e2

Please sign in to comment.