Skip to content

Commit 0e3b2b9

Browse files
authored
Merge pull request #343 from duncdrum/int-test
Add Integration tests
2 parents 033679b + ecf9f74 commit 0e3b2b9

File tree

23 files changed

+1388
-90
lines changed

23 files changed

+1388
-90
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ node_modules/*
88
node/*
99

1010
maven-archiver/
11+
12+
src/test/cypress/videos/*.mp4
13+
src/test/cypress/screenshots/**/*.png

.travis.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,16 @@ env:
1111
- img=existdb/existdb:latest
1212
- img=existdb/existdb:release
1313

14+
cache:
15+
directories:
16+
- $HOME/.m2
17+
1418
before_install:
1519
- docker pull $img
1620
- docker create --name exist-ci -p 8080:8080 $img
1721

1822
install:
19-
- mvn clean package
23+
- mvn clean package -DskipTests -q
2024

2125
before_script:
2226
- docker cp ./target/exist-documentation-*.xar exist-ci:exist/autodeploy
@@ -27,6 +31,7 @@ before_script:
2731
script:
2832
- mvn validate
2933
- mvn test
34+
- npm run cypress
3035

3136
after_success:
3237
- docker ps

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,14 @@ Should you encounter documentation for features that are deprecated in the minim
3939
3. Install this file via the Dashboard > Package Manager.
4040

4141
## (WIP) Testing
42-
Tests are executed locally by maven or on travis. To validate xml files run `mvn validate`, to run the javascript tests `mvn test` (xQsuite coming soon). We do **not** support testing via node alone, aka `npm test`, use the maven command instead.
42+
43+
### Unit tests
44+
The full test-suite consists of validation, unit, and integration tests, it runs automatically on travis. To be able to run integration tests locally, contributors should run `npm i` to download and install [cypress.js](https://www.cypress.io). This is only required once. To execute the tests run the following commands:
45+
- To validate xml files run `mvn validate`,
46+
- to run the javascript tests `mvn test` (xQsuite coming soon). We do **not** support testing via node alone, aka `npm test`, use the maven command instead.
47+
- To run the Integrations tests, however, use `npm run cypress`.
48+
49+
Both unit and integration tests, expect a running instance of exist with a copy of the documentation app installed reachable at `localhost:8080` and an empty admin password. It might be necessary to skip test execution during building from time to time, use: `mvn clean package -DskipTests`.
4350

4451
## License
4552
LGPLv2.1 [eXist-db.org](http://exist-db.org/exist/apps/homepage/index.html)

cypress.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"baseUrl": "http://localhost:8080/exist/apps/doc",
3+
"fileServerFolder": "src/main/xar-resources",
4+
"ignoreTestFiles": "src/test/cypress/integration/examples/*.js",
5+
"fixturesFolder": "src/test/cypress/fixtures",
6+
"integrationFolder": "src/test/cypress/integration",
7+
"pluginsFile": "src/test/cypress/plugins/index.js",
8+
"screenshotsFolder": "src/test/cypress/screenshots",
9+
"supportFile": "src/test/cypress/support/index.js",
10+
"videosFolder": "src/test/cypress/videos"
11+
}

0 commit comments

Comments
 (0)