Permalink
Browse files

Define nightwatch version range as <0.8.0.

Add usage guide and example for docker-compose and selenium.
  • Loading branch information...
blueimp committed Jul 6, 2015
1 parent 0179694 commit 4ecc61c376a04daba59460c55f37f43b2df7be19
Showing with 114 additions and 10 deletions.
  1. +4 −0 .dockerignore
  2. +1 −0 .gitignore
  3. +1 −3 Dockerfile
  4. +29 −7 README.md
  5. +11 −0 app/index.html
  6. +36 −0 docker-compose.yml
  7. +22 −0 test/nightwatch.json
  8. +10 −0 test/spec.js
View
@@ -1 +1,5 @@
.git
/app
/test
docker-compose.yml
README.md
View
@@ -1 +1,2 @@
.DS_Store
/test/tests_output
View
@@ -6,13 +6,11 @@ FROM blueimp/node:0.12
MAINTAINER Sebastian Tschan <mail@blueimp.net>
ENV NIGHTWATCH_VERSION 0.7.5
USER root
# Install Nightwatch.js:
RUN npm install -g \
nightwatch@$NIGHTWATCH_VERSION \
nightwatch@'<0.8.0' \
# Clean up obsolete files:
&& rm -rf \
/tmp/* \
View
@@ -1,19 +1,41 @@
# Nightwatch.js Dockerfile
## Install
## Usage
Start the selenium hub, the selenium browser nodes and the app server:
```sh
docker-compose up -d chrome firefox
```
Run the nightwatch tests:
```sh
docker pull blueimp/nightwatch
docker-compose run --rm nightwatch -e default,firefox
```
## Usage
Stop and remove the started docker containers:
```sh
docker-compose stop && docker-compose rm -vf
```
Please see [blueimp/docker](https://github.com/blueimp/docker).
## Debug
Start the debug browser nodes along with the selenium hub and app server:
```sh
docker-compose up -d chromedebug firefoxdebug
```
## License
Connect to the chrome debug node via VNC (password: secret):
```sh
open vnc://$DOCKER_HOST_IP:5900
```
Connect to the firefox debug node via VNC (password: secret):
```sh
open vnc://$DOCKER_HOST_IP:5901
```
Released under the [MIT license](http://www.opensource.org/licenses/MIT).
Next run the nightwatch tests as shown above.
## Author
## License
Released under the [MIT license](http://opensource.org/licenses/MIT).
## Author
[Sebastian Tschan](https://blueimp.net/)
View
@@ -0,0 +1,11 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Nightwatch.js Test</title>
</head>
<body>
<h1>Nightwatch.js Test</h1>
<input id="input" onkeyup="document.getElementById('result').textContent=this.value">
<p id="result"></p>
</body>
</html>
View
@@ -0,0 +1,36 @@
app:
image: blueimp/nginx:1.8
volumes:
- ./app:/usr/share/nginx/html
hub:
image: selenium/hub:2.46.0
chrome:
image: selenium/node-chrome:2.46.0
links:
- hub
- app
firefox:
image: selenium/node-firefox:2.46.0
links:
- hub
- app
chromedebug:
image: selenium/node-chrome-debug:2.46.0
links:
- hub
- app
ports:
- 5900:5900
firefoxdebug:
image: selenium/node-firefox-debug:2.46.0
links:
- hub
- app
ports:
- 5901:5900
nightwatch:
image: blueimp/nightwatch:0.7
links:
- hub
volumes:
- ./test:/home/node
View
@@ -0,0 +1,22 @@
{
"src_folders" : ["."],
"test_settings" : {
"default" : {
"launch_url": "http://app",
"selenium_host" : "hub",
"desiredCapabilities": {
"browserName": "chrome"
},
"screenshots" : {
"enabled" : true,
"on_failure" : true,
"path" : "tests_output"
}
},
"firefox" : {
"desiredCapabilities": {
"browserName": "firefox"
}
}
}
}
View
@@ -0,0 +1,10 @@
module.exports = {
'Nightwatch.js Test' : function (browser) {
browser
.url(browser.launch_url)
.waitForElementVisible('body', 1000)
.setValue('#input', 'nightwatch')
.assert.containsText('#result', 'nightwatch')
.end();
}
};

0 comments on commit 4ecc61c

Please sign in to comment.