Permalink
Browse files

Trying to make the selenium tests work on travis

  • Loading branch information...
1 parent a7f3cfd commit 5e18fd00482ff710798f76339bf82eeae94ea72d @bjpirt committed Jun 1, 2012
Showing with 9 additions and 3 deletions.
  1. +1 −1 lib/server.js
  2. +1 −1 package.json
  3. +2 −1 test/integration_server/test.html
  4. +5 −0 test/integration_test.js
View
@@ -84,7 +84,7 @@ var server = {
},
send_error: function(uid, err, message){
- server.send(JSON.stringify({uid: uid, error: message, detail: err.detail}));
+ server.send(JSON.stringify({uid: uid, error: message, detail: (err.detail || err.message)}));
}
}
View
@@ -11,7 +11,7 @@
},
"main": "backbone-sockjs.js",
"scripts": {
- "test": "./node_modules/mocha/bin/mocha -R spec --ignore-leaks -t 15000 test/*_test.js"
+ "test": "./node_modules/mocha/bin/mocha -R spec --ignore-leaks -t 60000 test/*_test.js"
},
"dependencies": {
},
@@ -14,14 +14,15 @@
<script type="text/javascript">
SocketConnector.initialize(window.Backbone, '/socket', function(){
+ $('p.status').text('Connected');
window.main = new window.MainView({el: $('#mainView'), collection: (new TestModelCollection())});
});
-
</script>
</head>
<body>
<div id="mainView">
+ <p class="status">Connecting</p>
<input type="text" class="name" value="hmmm" />
<button class="add">Add</button>
<ul id="itemList">
View
@@ -45,6 +45,7 @@ describe('integration testing the client and server', function(){
open("/test.html").
waitForPageToLoad(5000).
assertTitle('Test').
+ assertTextPresent('Connected').
assertTextPresent('Roger').
assertTextPresent('Wilco').
end(function(err){
@@ -59,6 +60,7 @@ describe('integration testing the client and server', function(){
open("/test.html").
waitForPageToLoad(5000).
assertTitle('Test').
+ assertTextPresent('Connected').
assertTextPresent('Roger').
getText('css=.name', function(name){
// We change this in a getText because I can't find another way of doing this
@@ -78,6 +80,7 @@ describe('integration testing the client and server', function(){
open("/test.html").
waitForPageToLoad(5000).
assertTitle('Test').
+ assertTextPresent('Connected').
type('css=.name', 'Lloyd').
click('css=.add').
assertTextPresent('Lloyd').
@@ -94,6 +97,7 @@ describe('integration testing the client and server', function(){
open("/test.html").
waitForPageToLoad(5000).
assertTitle('Test').
+ assertTextPresent('Connected').
assertTextPresent('Lloyd').
click('css=.reverse').
assertTextPresent('dyolL').
@@ -110,6 +114,7 @@ describe('integration testing the client and server', function(){
open("/test.html").
waitForPageToLoad(5000).
assertTitle('Test').
+ assertTextPresent('Connected').
assertTextPresent('Lloyd').
click('css=.remove').
getText('css=#itemList', function(list){ list.should.eql(''); }).

0 comments on commit 5e18fd0

Please sign in to comment.