Skip to content

Commit

Permalink
Merge pull request #173 from tom-and-the-toothfairies/iteration-7
Browse files Browse the repository at this point in the history
Iteration 7
  • Loading branch information
houli authored Apr 2, 2017
2 parents aadc2e8 + baae6d3 commit e88e5cc
Show file tree
Hide file tree
Showing 55 changed files with 1,266 additions and 557 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ maximum convenience - click-able links for example*
This file contains instructions on how to install and run the project, as well
as an overview of the project's design. The target platform is Ubuntu 16.04.

At the time of writing the current release is `1.2`
At the time of writing the current release is `1.3`

## Installing Dependencies

Expand Down
22 changes: 21 additions & 1 deletion athloi/features/file_upload.feature
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ Feature: File upload
Scenario: uploading a PML file with unidentifiable drugs
When I select "unidentifiable_drugs.pml"
And I submit the upload form
And I click the warnings tab
Then I should see the unidentified drugs panel
And I should see "2" in the warning number badge
And I should see the following drugs in the unidentified drugs panel:
| marmalade |
| dimethylheptylpyran |
Expand All @@ -26,25 +28,42 @@ Feature: File upload
When I select "no_drugs.pml"
And I submit the upload form
Then I should see the error panel
And I should see "1" in the error number badge
And the error panel title should be "Pathway error"

Scenario: uploading a PML file with syntax errors
When I select "bad.pml"
And I submit the upload form
Then I should see the error panel
And I should see "1" in the error number badge
And the error panel title should be "Syntax error"

Scenario: uploading a PML file containing delays
When I select "delays.pml"
And I submit the upload form
Then I should see the found DDIs panel

Scenario: uploading a PML file with invalid delay timings
When I select "bad_delays.pml"
And I submit the upload form
Then I should see the error panel
And the error panel title should be "Syntax error"

Scenario: uploading a PML file with unnamed constructs
When I select "analysis/unnamed.pml"
And I submit the upload form
And I click the warnings tab
Then I should see the unnamed panel
And I should see "1" in the warning number badge
And I should see the following warnings in the unnamed panel:
| task on line 2 |

Scenario: uploading a PML file with clashing construct names
When I select "analysis/clashes.pml"
And I submit the upload form
And I click the warnings tab
Then I should see the clashes panel
And I should see "2" in the warning number badge
And I should see the following warnings in the clashes panel:
| action clash1 on line 2 |
| action clash1 on line 8 |
Expand All @@ -55,14 +74,15 @@ Feature: File upload
When I select "example.png"
And I submit the upload form
Then I should see the error panel
And I should see "1" in the error number badge
And the error panel title should be "Encoding error"

Scenario: uploading a PML file with identifiable drugs that have an interaction
When I select "ddis.pml"
And I submit the upload form
Then I should see the found DDIs panel
And I should see the following DDIs in the found DDIs panel:
| torasemide and trandolapril |
| torasemide on line 8 and trandolapril on line 17 |

Scenario: uploading a PML file with identifiable drugs that don't have an interaction
When I select "no_ddis.pml"
Expand Down
10 changes: 10 additions & 0 deletions athloi/features/fixtures/alternative_non_ddi.pml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
process alternative_non_ddis {
selection {
action s1 {
requires { drug { "trandolapril" } }
}
action s2 {
requires { drug { "torasemide" } }
}
}
}
15 changes: 15 additions & 0 deletions athloi/features/fixtures/bad_delays.pml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
process foo {
task bar {
action baz {
requires {
time {
days { 28 }
years { 1 }
minutes { 10 }
years { 3 }
hours { 7 }
}
}
}
}
}
37 changes: 37 additions & 0 deletions athloi/features/fixtures/delays.pml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
process foo {
task bar {
action baz {
tool { "pills" }
script { "eat the pills" }
agent { "patient" }
requires {
drug { "torasemide" }
}
provides { "a cured patient" }
requires {
time {
minutes { 45 }
}
}
}
action baz2 {
tool { "pills" }
script { "eat the pills" }
agent { (intangible)(inscrutable) pml.wtf && ("foo" || 1 != 2) }
requires {
drug { "trandolapril" }
}
provides { "a cured patient" }
requires {
time {
years { 20 }
weeks { 12 }
days { 15 }
hours { 10 }
minutes { 6 }
seconds { 14 }
}
}
}
}
}
10 changes: 10 additions & 0 deletions athloi/features/fixtures/parallel.pml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
process parallel_ddis {
branch {
action b1 {
requires { drug { "trandolapril" } }
}
action b2 {
requires { drug { "torasemide" } }
}
}
}
12 changes: 12 additions & 0 deletions athloi/features/fixtures/repeated_alternative.pml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
process repeated_alternative_ddis {
iteration {
selection {
action s1 {
requires { drug { "trandolapril" } }
}
action s2 {
requires { drug { "torasemide" } }
}
}
}
}
12 changes: 12 additions & 0 deletions athloi/features/step_definitions/file_upload_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,15 @@
expect(body).to have_content(clash)
end
end

Then(/^I should see "([^"]*)" in the warning number badge$/) do |number|
badge = find('#warnings-badge')

expect(badge).to have_content(number)
end

Then(/^I should see "([^"]*)" in the error number badge$/) do |number|
badge = find('#errors-badge')

expect(badge).to have_content(number)
end
4 changes: 4 additions & 0 deletions athloi/features/step_definitions/shared_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@
When(/^I submit the upload form$/) do
click_on 'Submit'
end

When(/^I click the warnings tab$/) do
click_on('Warnings', wait: 5)
end
17 changes: 16 additions & 1 deletion doc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
# Change Log

All notable changes to this project will be documented in this file.

## [1.3] 2017-04-02

### Added
- Added UI sections for displaying the different types of DDI sequencing
categories identified by the system: parallel, sequential, repeated
alternative, and alternative non-DDI
- Added the ability to specify a delay in PML files

### Changed
- Redesigned the UI to use tabs for the different logical sections of the
application: Analysis, Warnings, and Errors
- The syntax error UI now includes contextual line highlighting

## [1.2] 2017-03-26

### Added
Expand Down Expand Up @@ -139,7 +153,8 @@ All notable changes to this project will be documented in this file.
docker service: pathways.
- Installation instructions in README

[Unreleased]: https://github.com/tom-and-the-toothfairies/pathways/compare/1.2...iteration-7
[Unreleased]: https://github.com/tom-and-the-toothfairies/pathways/compare/1.3...release-2
[1.3]: https://github.com/tom-and-the-toothfairies/pathways/compare/1.2...1.3
[1.2]: https://github.com/tom-and-the-toothfairies/pathways/compare/1.1...1.2
[1.1]: https://github.com/tom-and-the-toothfairies/pathways/compare/1.0...1.1
[1.0]: https://github.com/tom-and-the-toothfairies/pathways/compare/0.3...1.0
Expand Down
41 changes: 22 additions & 19 deletions doc/FEATURES_RELEASE_1.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Features
# Features - Release 1

Each deliverable feature for Release 1 is outlined in this file. Each feature
is given a short description. For completed features, instructions on how to
Expand All @@ -11,7 +11,7 @@ tracked [here](https://circleci.com/gh/tom-and-the-toothfairies/pathways).

We have developed a suite of end to end tests that verify the whole system's
functionality by automating interactions with a web browser. These can be run
with the following command
from the project's root directory with the following command

```bash
$ sudo docker-compose -f docker-compose.e2e.yml -p integration run athloi; sudo docker-compose -f docker-compose.e2e.yml -p integration down
Expand Down Expand Up @@ -63,9 +63,10 @@ Visit the [homepage] and select a file. Press the `Submit` button. The file
should be sent to the system, and analysis results should now be displayed.
Invalid files should result in an error dialogue, which displays a meaningful
error message. For example, `panacea/test/fixtures/bad.pml` should result in a
`Syntax error` being displayed when submitted. Valid files should result in a
success dialogue. See [PML File Loading](#pml-file-loading---complete) for an
example.
`Syntax error` being displayed in the errors tab when submitted. Valid files
such as `panacea/test/fixtures/ddis.pml` should result in analysis being
displayed in the analysis tab.
See [PML File Loading](#pml-file-loading---complete) for an example.

## On-Screen PML Reporting - Complete

Expand All @@ -77,9 +78,10 @@ must be easily identified, and the error messages must be useful.
Visit the [homepage] and select a file. Some useful files can be found in the
[fixtures directory]. Press the `Submit` button. Analysis results should be
displayed. `panacea/test/fixtures/example.png` is not UTF-8 encoded and should
result in an `Encoding error`. `panacea/test/fixtures/bad.pml` contains invalid
PML and should result in a `Syntax error`. `panacea/test/fixtures/ddis.pml`
contains valid PML and should result in a successful analysis.
result in an `Encoding error` in the errors tab. `panacea/test/fixtures/bad.pml`
contains invalid PML and should result in a `Syntax error`.
`panacea/test/fixtures/ddis.pml` contains valid PML and should result in a
successful analysis displayed in the analysis tab.

## PML Log File Generation - Complete

Expand All @@ -88,15 +90,15 @@ The successful or unsuccessful loading of PML files into the system is output
to the console logs of the panacea service.

### Testing
First, open up the tail of the Panacea logs (the system must be running to do this):
First, open up the tail of the Panacea logs (the system must be running to do
this):
```bash
$ sudo docker-compose logs -f panacea
```
Visit the [homepage] and select a file. Some useful files can be found in the
[fixtures directory]. Press the `Submit` button. You should see log entries
created indicating either a successful parse of the PML file and the drugs
contained in it or that an error occurred parsing the PML file and what the
error was.
created indicating either a successful parse of the PML file or that an error
occurred parsing the PML file and what the error was.

## PML Error and Warning highlights - Complete

Expand All @@ -116,7 +118,6 @@ specify which file should be used in the `docker build` process.
Instructions on how to specify an OWL file and releasing the new docker image
can be found [here](./UPDATING_DINTO.md)


## Load Selected Ontology - Complete

See [Select specific OWL Ontology](#select-specific-owl-ontology---complete)
Expand All @@ -131,7 +132,7 @@ Users can specify a drug using the following construct:
`drug { "drug_name" }`

Drugs to be administered to patients must be placed in `requires` blocks within
the PML document. For example
the PML document. For example:

```
process foo {
Expand All @@ -154,7 +155,8 @@ and analysing it should result in `paracetamol` and `cocaine` being identified
and presented in the UI.

`no_drugs.pml` is a well-structured PML document that does not contain drug
identifiers. Analysing it should result in no drugs being identified.
identifiers. Analysing it should result in no drugs being identified with an
error being displayed in the errors tab.

## Identify Drugs in DINTO - Complete

Expand All @@ -166,10 +168,11 @@ plain English into a format that can be used when querying DINTO.
This feature can be manually tested by uploading files.

Visit the [homepage] and select a PML file that contains drugs; for example
`panacea/text/fixtures/no_ddis.pml`. Press the `Submit` button. You should see
`panacea/test/fixtures/no_ddis.pml`. Press the `Submit` button. You should see
that "cocaine" and "paracetamol" have been identified as drugs in DINTO. Testing
`panacea/test/fixtures/unidentifiable_drugs.pml` returns drugs that cannot be
identified in DINTO and are highlighted with a warning as a result.
identified in DINTO and are highlighted with a warning in the warnings tab as a
result.

## Identify DDIs - Complete

Expand Down Expand Up @@ -214,15 +217,15 @@ A record of queries made to DINTO (via Chiron/Asclepius) can be found in the
console logs of the Chiron service.

### Testing
This feature is tested manually by looking at the logs of the running sytem.
This feature is tested manually by looking at the logs of the running system.

First, open up the tail of the Chiron logs (the system must be running to do this):
```bash
$ sudo docker-compose logs -f chiron
```

Visit the [homepage] and select a PML file that contains drugs; for example
`panacea/text/fixtures/ddis.pml`. Press the `Submit` button. You should see log
`panacea/test/fixtures/ddis.pml`. Press the `Submit` button. You should see log
entries indicating that queries were made (there will be requests such as `POST
http://chiron:3030/dinto/query`) and the contents of those queries.

Expand Down
Loading

0 comments on commit e88e5cc

Please sign in to comment.