| 
					
				 | 
			
			
				@@ -4,6 +4,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 var execSync = require('child_process').execSync, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     expect = require('expect.js'), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    superagent = require('superagent'), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     path = require('path'), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     webdriver = require('selenium-webdriver'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -61,6 +62,14 @@ describe('Application life cycle test', function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    function invalidPassword(callback) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        superagent.get('https://' + app.fqdn).auth(username, password + 'x').end(function (error, result) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            expect(result.status).to.eql(401); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            callback(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     function loadPage(callback) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         browser.manage().deleteAllCookies().then(function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return browser.get('https://' + username + ':' + encodeURIComponent(password) + '@' + app.fqdn).then(function () { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -135,6 +144,7 @@ describe('Application life cycle test', function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         expect(app).to.be.an('object'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    it('fails with invalid password', invalidPassword); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     it('can load page', loadPage); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     it('can add folder', addFolder); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 |