src/cm/scripts/test-suite/tests/tests.js
changeset 575 8ce80860c3fe
child 577 65fab7b5ce5e
equal deleted inserted replaced
565:95a5c06c4008 575:8ce80860c3fe
       
     1 
       
     2 // console.log ('args '+args);
       
     3 
       
     4 describe ('comt', function () {
       
     5 
       
     6 	this.timeout(150000);
       
     7 
       
     8 	describe ('connexion', function () {
       
     9 		it ('should load login page', dsl(function () {
       
    10 			// here we are in Karma page
       
    11 			browser.navigateTo ('/');
       
    12 
       
    13 			/*element ('title').text (function (page_title) {
       
    14 				// here we got a value from the test iframe
       
    15 				if (typeof page_title != 'string') throw 'page_title not a string, network problem ?';
       
    16 				if (!/(Accueil|Home) - Workspace/.test (page_title)) throw 'got page '+page_title+' instead';
       
    17 			});*/
       
    18 
       
    19 			expect (element ('title').text ()).toBeDefined ();
       
    20 			expect (element ('title').text ()).toMatch (/Home - Workspace/);
       
    21 
       
    22 			// it should have a header
       
    23 				// with visible homepage and login links
       
    24 			// it should have a title
       
    25 				// with workspace name in it… ?
       
    26 			// it may have public texts
       
    27 				// how many max ?
       
    28 				// do we announce the right number of texts ?
       
    29 			// it should have a login form
       
    30 				// with labels
       
    31 				// with red stars
       
    32 				// green button
       
    33 				// forgoten password link
       
    34 			// it should have a footer
       
    35 				// with contact link, powered by co-ment logo, help link, languages links
       
    36 
       
    37 			// we should try the links
       
    38 			// we should try urls as not logged to check the access avoidance
       
    39 
       
    40 		}));
       
    41 		it ('should log in', dsl(function () {
       
    42 			browser.navigateTo ('/');
       
    43 			input ('#id_username').enter ('siltaar');
       
    44 			input ('#id_password').enter ('oaueoaue');
       
    45 			element ('#login input[type=submit]').click ();
       
    46 			browser.waitForPageLoad ()
       
    47 			browser.navigateTo ('/');
       
    48 			expect (element ('title').text ()).toMatch (/Dashboard\n - Workspace/m);
       
    49 
       
    50 		}));
       
    51 	});
       
    52 });