Skip to content

Commit 6914056

Browse files
committed
feat(test): add cypress test
TDD for whats to come
1 parent 3bf3521 commit 6914056

File tree

9 files changed

+1841
-13
lines changed

9 files changed

+1841
-13
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,17 @@ jobs:
66
strategy:
77
fail-fast: true
88
matrix:
9+
exist-version: [latest, 6.2.0, 5.3.0]
910
jdk: ['8', '17']
1011
os: [ubuntu-latest]
12+
exclude:
13+
- exist-version: 6.2.0
14+
java-version: 17
15+
- exist-version: 5.3.0
16+
java-version: 17
17+
- exist-version: latest
18+
java-version: 11
19+
1120
runs-on: ${{ matrix.os }}
1221
steps:
1322
- uses: actions/checkout@v4
@@ -18,8 +27,33 @@ jobs:
1827
cache: maven
1928
java-version: ${{ matrix.jdk }}
2029
- name: Maven Build
21-
run: mvn clean package -DskipTests
22-
- name: Test
23-
env:
24-
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
25-
run: mvn verify
30+
run: mvn clean package
31+
32+
- name: Add expath dependencies
33+
working-directory: target
34+
run: |
35+
wget http://exist-db.org/exist/apps/public-repo/public/templating-1.1.0.xar -O 001.xar
36+
37+
38+
# Install
39+
- name: Start exist-ci containers
40+
run: |
41+
docker run -dit -p 8080:8080 -v ${{ github.workspace }}/target:/exist/autodeploy \
42+
--name exist --rm --health-interval=2s --health-start-period=4s \
43+
duncdrum/existdb:${{ matrix.exist-version }}
44+
45+
- name: wait for install to finish
46+
timeout-minutes: 5
47+
run: |
48+
while ! docker logs exist | grep -q "Server has started"; \
49+
do sleep 2s; \
50+
done
51+
52+
# Test
53+
- name: Run e2e test
54+
run: npx cypress run
55+
56+
# - name: Test
57+
# env:
58+
# CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
59+
# run: mvn verify

cypress.config.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const { defineConfig } = require('cypress')
2+
3+
module.exports = defineConfig({
4+
fileServerFolder: 'src/main/xar-resources',
5+
fixturesFolder: 'src/test/cypress/fixtures',
6+
screenshotsFolder: 'src/test/cypress/screenshots',
7+
videosFolder: 'src/test/cypress/videos',
8+
e2e: {
9+
// We've imported your old cypress plugins here.
10+
// You may want to clean this up later by importing these.
11+
setupNodeEvents(on, config) {
12+
return require('./src/test/cypress/plugins/index.js')(on, config)
13+
},
14+
baseUrl: 'http://localhost:8080/exist/apps/fundocs/',
15+
excludeSpecPattern: 'src/test/cypress/integration/examples/*.js',
16+
specPattern: 'src/test/cypress/integration/**/*.{js,jsx,ts,tsx}',
17+
supportFile: 'src/test/cypress/support/index.js',
18+
},
19+
})

0 commit comments

Comments
 (0)