Skip to content

Commit

Permalink
Merge branch 'tests_config'
Browse files Browse the repository at this point in the history
  • Loading branch information
lduboeuf committed Dec 19, 2016
2 parents 418e234 + fe72534 commit 2916c9b
Show file tree
Hide file tree
Showing 20 changed files with 256 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
node_modules
.tmp
bin
.env
*.log
78 changes: 76 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,74 @@ module.exports = function(grunt) {
},
server: '.tmp'
},


connect: {
server: {
options: {
port: 8000,
base: {
path: '.',
options: {
index: 'index.html',
maxAge: 300000
}
}
}
}
},
selenium_standalone: {
options: {
stopOnExit: true
},
default: {
seleniumVersion: '3.0.0',
seleniumDownloadURL: 'http://selenium-release.storage.googleapis.com',
drivers: {
chrome: {
version: '2.9',
arch: process.arch,
baseURL: 'http://chromedriver.storage.googleapis.com'
}
}
}
} ,
nightwatch: {
options: {
"src_folders": [
"test/e2e"// Where you are storing your Nightwatch e2e tests
],
"output_folder": "/tmp/nightwatch/ttb/reports", // reports (test outcome) output by nightwatch

"test_settings": {
"default": {
"launch_url" : "http://localhost",
"selenium_port" : 4444,
"selenium_host" : "localhost",
"screenshots": {
"enabled": true, // if you want to keep screenshots
"path" : "/tmp/nightwatch/ttb/screenshots/" // save screenshots here //L.D: does not seems to work
},
"globals": {
"waitForConditionTimeout": 4000 // sometimes internet is slow so wait.
},
"desiredCapabilities": { // use Chrome as the default browser for tests
"browserName": "chrome"
}
},
"chrome": {
"desiredCapabilities": {
"browserName": "chrome",
"javascriptEnabled": true // turn off to test progressive enhancement
}
},
"gecko": {
"desiredCapabilities": {
"browserName": "gecko",
"javascriptEnabled": true // turn off to test progressive enhancement
}
}
}
}
},
jshint: {
options: {
curly: true,
Expand Down Expand Up @@ -117,6 +183,14 @@ module.exports = function(grunt) {

]);

grunt.registerTask('test', [
'selenium_standalone:default:install',
'connect',
'selenium_standalone:default:start',
'nightwatch',
'selenium_standalone:default:stop'
]);

grunt.registerTask('default', [
'build'
]);
Expand Down
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ It helps you to:
- build teams randomly
- choose randomly members from a Team

TTB can be used without any web servers.

##what is inside
- use tiny MVC library borrowed and turned into native js from ( https://github.com/c-smile/spapp )
Expand All @@ -12,12 +13,22 @@ It helps you to:
##usage
- open index.html in your favorite browser

##compressing for production
- need nodejs, grunt `npm install -g grunt`
##development
- need nodejs
- grunt: `npm install -g grunt`
```
npm install
```


###compressing for publishing
```
npm install
grunt # will output app in dist/dev folder
grunt --rev=prod #will output in dist folder
```
###testings
need chrome installed for instance
```
grunt test
work in progress...
```
39 changes: 39 additions & 0 deletions dist/dev/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE html><html><head><meta charset="utf-8"><title>Team Tool Box</title><meta name="viewport" content="width=device-width,initial-scale=1"><script src="scripts/vendors.js"></script><script src="scripts/scripts.js"></script><link rel="stylesheet" href="styles/main.css"></head><body><!--[if lt IE 10]> <p class="browserupgrade"><strong>Ohlala, so sorry!</strong>, developping apps for old browser is so painfull and time consuming that i choosed not to support them ... Please <a href="http://browsehappy.com/">upgrade your browser</a> .</p> <![endif]--><header><div class="brand"><a href="#home">Team Tool Box</a> <span>Build your teams randomly!</span></div><ul class="topnav" id="menu"><li><a href="#home">Home</a></li><li><a href="#team-list">Team List</a></li><li><a href="#archive-list">Archives</a></li><li><a href="#about">About</a></li><li class="icon"><a href="javascript:void(0);" onclick="menuHandler()">&#9776;</a></li></ul></header><section id="home" src="templates/home.html" default></section><section id="team-list" src="templates/team-list.html"></section><section id="team-list-details" src="templates/team-list-details.html"></section><section id="team-add" src="templates/team-add.html"></section><section id="team-member-add" src="templates/team-member-add.html"></section><section id="team-member-details" src="templates/team-member-details.html"></section><section id="about" src="templates/about.html"></section><section id="archive-save" src="templates/archive-save.html"></section><section id="archive-list" src="templates/archive-list.html"></section><section id="archive-details" src="templates/archive-details.html"></section><div class="alert-info"><span onclick="this.parentElement.style.display='none'" class="alert-closebtn">&times;</span><p class="alert-msg"></p></div><script>var menu = document.getElementById("menu");
var links = document.querySelectorAll('header ul li a');


function menuHandler() {
if (menu.className === "topnav") {
menu.className += " responsive";
} else {
menu.className = "topnav";
}
}

//handle click on nav a, make it selected style
function setSelected(){
/*
for(i=0;i<links.length;i++) {
links[i].classList.remove('selected');
}
this.classList.add('selected');
*/
//toggle menu when a menu item is clicked
if (this.parentNode.className!=='icon'){
menu.className = "topnav";
}

//make sure every alert box is hidden
document.querySelector('.alert-info').style.display = 'none';

}

for(i=0;i<links.length;i++) {
links[i].addEventListener('click',setSelected);
}
document.querySelector('div.brand a').onclick = setSelected;


app.start();

//document.writeln(localStorage.getItem('ttb'));</script></body></html>
1 change: 1 addition & 0 deletions dist/dev/scripts/scripts.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/dev/scripts/vendors.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2916c9b

Please sign in to comment.