I am creating a docker image / container for testing purposes from my productive build application (nodeJS app). Now I want to test e2e using mocha / chai and nightmareJS . Therefore, I created a very simple test file.
Now my problem is how to test a running application. Therefore, I want to download an application, for example
- goto http://localhost
- check if login form is existing
- do login
- check if login was successful
I do not know how to do this in my docker / e2e.js-file ...
This is how I create the docker image:
Dockerfile
FROM productive_build:latest
COPY e2e.js /
ENV NODE_ENV dev
RUN (cd programs/server && npm install)
RUN npm install -g mocha
RUN npm install chai nightmare
CMD ["mocha", "e2e.js", "--reporter", "spec"]
And here is what my main e2e.js file looks like:
e2e.js
var Nightmare = require('nightmare'),
expect = require('chai').expect
describe('test', function () {
it('should always be true', function () {
var nightmare = Nightmare()
nightmare.end()
expect(true).to.be.true
})
})