Skip to content

Commit f70e151

Browse files
committed
Add a first Cypress test
1 parent a0e2704 commit f70e151

File tree

4 files changed

+41
-0
lines changed

4 files changed

+41
-0
lines changed

cypress/config.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const { defineConfig } = require('cypress')
2+
3+
module.exports = defineConfig({
4+
e2e: {
5+
supportFile: false
6+
}
7+
})

cypress/docker/cypress.Dockerfile

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM cypress/included:10.9.0
2+
3+
WORKDIR /app
4+
5+
# Suppress most Cypress output
6+
# ENV CI=1
7+
8+
# CMD ["cypress run"]
9+
# CMD ["bash"]
10+
ENTRYPOINT ["bash"]

cypress/docker/docker-compose.yml

+13
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,16 @@ services:
1313
- "8080:9080"
1414
volumes:
1515
- ../..:/app
16+
17+
cypress:
18+
image: cypress
19+
build:
20+
dockerfile: ./cypress/docker/cypress.Dockerfile
21+
context: ../..
22+
container_name: cypress
23+
stdin_open: true
24+
tty: true
25+
environment:
26+
- CYPRESS_baseUrl=http://webserver:9080
27+
volumes:
28+
- ../..:/app

cypress/e2e/slideshow.cy.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
context('Without a config parameter', () => {
2+
beforeEach(() => {
3+
cy.visit('/')
4+
})
5+
6+
it('shows an error', () => {
7+
cy.get('#viewer').should(e => {
8+
expect(e).to.contain('supply a config')
9+
})
10+
})
11+
})

0 commit comments

Comments
 (0)