Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Commit

Permalink
First UI test working #70
Browse files Browse the repository at this point in the history
Didn't work with Firefox, using Chrome only for now.
  • Loading branch information
ColinMaudry committed Oct 14, 2016
1 parent 55d2770 commit e068680
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ config/*.json
coverage
*.sh
*.swp
bin/selenium*
reports
Binary file added bin/chromedriver
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/views/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ body#app(style='padding-top: 60px;')
.navbar.navbar-default.navbar-fixed-top
.container
.navbar-header
a.navbar-brand(href='/') queery.link
a.navbar-brand#logo(href='/') queery.link
button.navbar-toggle(type='button', data-toggle='collapse', data-target='#navbar-main')
span.icon-bar
span.icon-bar
Expand Down
42 changes: 42 additions & 0 deletions nightwatch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"src_folders" : ["test/ui"],
"output_folder" : "reports",
"custom_commands_path" : "",
"custom_assertions_path" : "",
"page_objects_path" : "",
"globals_path" : "",

"selenium" : {
"start_process" : true,
"server_path" : "./bin/selenium-server-standalone-3.0.0-beta4.jar",
"log_path" : "",
"port" : 4444,
"cli_args" : {
"webdriver.chrome.driver": "./bin/chromedriver"
}
},

"test_settings" : {
"default" : {
"launch_url" : "http://localhost:3000",
"selenium_port" : 4444,
"selenium_host" : "localhost",
"compatible_testcase_support": true,
"silent": true,
"screenshots" : {
"enabled" : false,
"path" : ""
},
"desiredCapabilities": {
"browserName": "chrome",
"marionette": true
}
},

"chrome" : {
"desiredCapabilities": {
"browserName": "chrome"
}
}
}
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@
"scripts": {
"initialize": "node bin/init",
"test": "istanbul cover ./node_modules/.bin/_mocha --check-leaks",
"test-ui": "nightwatch ./test/ui/basic.js",
"start": "node bin/www",
"watch-scss": "node-sass -w ./src/main.scss ./public/dist/main.css",
"build-css": "node-sass ./src/main.scss | cleancss -d -o ./public/dist/main.css",
"watch-js": "watchify -vd -p browserify --ignore unicode/category/So -e src/main.js -o ./public/dist/build.js",
"browser-sync": "browser-sync start --config 'bs-config.js'",
"nodemon": "nodemon --watch ./lib --watch app.js --watch ./lib/views --debug bin/www",
"dev": "npm-run-all --parallel watch-js watch-scss nodemon browser-sync",
"dev": "DEBUG=functions,routes npm-run-all --parallel watch-js watch-scss nodemon browser-sync",
"build": "NODE_ENV=production browserify --ignore unicode/category/So src/main.js | uglifyjs -v -c > ./public/dist/build.js & npm run build-css",
"lint": "eslint --ext .js,.vue src test/unit"
},
Expand Down Expand Up @@ -80,7 +81,7 @@
"eslint-plugin-html": "^1.1.0",
"istanbul": "^0.4.3",
"mocha": "^2.4.5",
"nightwatch": "^0.8.18",
"nightwatch": "^0.9.8",
"node-sass": "^3.7.0",
"nodemon": "^1.9.2",
"npm-run-all": "^2.1.0",
Expand Down
9 changes: 9 additions & 0 deletions test/ui/basic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
'App starts' : function (browser) {
browser
.url('http://localhost:3000/#/')
.waitForElementVisible('body', 1000)
.assert.containsText('#logo', 'queery.link')
.end();
}
};

0 comments on commit e068680

Please sign in to comment.