Integration of django testserver start in start-test-suite.sh
authorSimon Descarpentries <sid@sopinspace.com>
Thu, 17 Apr 2014 18:38:19 +0200
changeset 637 71d87ca43d6a
parent 636 a8ab808d33c3
child 638 61dc5370b351
Integration of django testserver start in start-test-suite.sh
test-suite/start-test-suite.sh
test-suite/tests/002_comt-logged-admin.js
test-suite/tests/003_comt-admin-text-list.js
test-suite/workspace.info.js.example
--- a/test-suite/start-test-suite.sh	Mon Apr 14 20:51:24 2014 +0200
+++ b/test-suite/start-test-suite.sh	Thu Apr 17 18:38:19 2014 +0200
@@ -1,35 +1,83 @@
 #!/bin/bash
 
+echo "Starting test server"
+
+TESTSERVER_LOGS="/tmp/django_test_server_logs.`date +%F_%T`"
+
+cd ..
+nohup ./bin/django testserver --noinput localhost:8000 initial_data roles_generic test_suite > $TESTSERVER_LOGS 2>&1 &
+TESTSERVER_PID=$!
+cd "test-suite"
+
+# Exports browsers _BIN variables for karma
 export CHROME_BIN=`which chromium`
 if [ -z "$CHROME_BIN" ]; then
-    export CHROME_BIN=`which chrome`
+	export CHROME_BIN=`which chrome`
 fi
 if [[ -z "$CHROME_BIN" && $OSTYPE =~ ^darwin ]]; then
-    CHROME_BIN_BASE=`mdfind "kMDItemCFBundleIdentifier == 'com.google.Chrome'"`
-    export CHROME_BIN="$CHROME_BIN_BASE/Contents/MacOS/Google Chrome"
+	CHROME_BIN_BASE=`mdfind "kMDItemCFBundleIdentifier == 'com.google.Chrome'"`
+	export CHROME_BIN="$CHROME_BIN_BASE/Contents/MacOS/Google Chrome"
 fi
 export PHANTOMJS_BIN=`which phantomjs`
 
 export FIREFOX_BIN=`which firefox`
 if [[ -z "$FIREFOX_BIN" && $OSTYPE =~ ^darwin ]]; then
-    FIREFOX_BIN_BASE=`mdfind "kMDItemCFBundleIdentifier == 'org.mozilla.firefox'"`
-    export FIREFOX_BIN="$FIREFOX_BIN_BASE/Contents/MacOS/firefox"
+	FIREFOX_BIN_BASE=`mdfind "kMDItemCFBundleIdentifier == 'org.mozilla.firefox'"`
+	export FIREFOX_BIN="$FIREFOX_BIN_BASE/Contents/MacOS/firefox"
 fi
 
 export SAFARI_BIN=`which safari`
 if [[ -z "$SAFARI_BIN" && $OSTYPE =~ ^darwin ]]; then
-    SAFARI_BIN_BASE=`mdfind "kMDItemCFBundleIdentifier == 'com.apple.Safari'"`
-    export SAFARI_BIN="$SAFARI_BIN_BASE/Contents/MacOS/safari"
+	SAFARI_BIN_BASE=`mdfind "kMDItemCFBundleIdentifier == 'com.apple.Safari'"`
+	export SAFARI_BIN="$SAFARI_BIN_BASE/Contents/MacOS/safari"
 fi
 
-
-
 if [ -x ./node_modules/.bin/karma ]; then
    KARMA=./node_modules/.bin/karma
 else
    KARMA=`which karma`
 fi
 
-"$KARMA" start $@
+
+CONNECTION_TIMEOUT=10
+TESTSERVER_START_WAIT=15
+TESTSERVER_LOOP_WAIT=5
+TESTSERVER_WAIT_LOOP_NB=5
+
+SERVER_IP=`grep WORKSPACE_URL workspace.info.js | sed "s|^.*http://\([-._[:alnum:]]*\):.*$|\1|"`
+SERVER_PORT=`grep WORKSPACE_URL workspace.info.js | sed "s|^.*http://[-._[:alnum:]]*:\([0-9]*\)/.*$|\1|"`
+
+if [[ -x `which nc` ]]; then
+	SERVER_TEST_CMD="nc -w $CONNECTION_TIMEOUT -z $SERVER_IP $SERVER_PORT"
+elif [[ -x `which curl` ]]; then
+	SERVER_TEST_CMD="curl -m $CONNECTION_TIMEOUT --output /dev/null --silent --head --fail http://$SERVER_IP:$SERVER_PORT"
+elif [[ -x `which wget` ]]; then
+	SERVER_TEST_CMD="wget --timeout=$CONNECTION_TIMEOUT -q --spider http://$SERVER_IP:$SERVER_PORT"
+fi
+
+echo "Using '$SERVER_TEST_CMD' to probe test server $SERVER_IP:$SERVER_PORT availability"
 
+if [[ -z "$SERVER_TEST_CMD" ]]; then
+	echo "No http tool available so blindly waiting $TESTSERVER_START_WAIT seconds to let test server start"
+	sleep $TESTSERVER_START_WAIT
+else
+	for i in $(seq 1 $TESTSERVER_WAIT_LOOP_NB); do
+		echo "and waiting $TESTSERVER_LOOP_WAIT seconds"
+		sleep $TESTSERVER_LOOP_WAIT
+		if $SERVER_TEST_CMD; then
+			break
+		fi
+	done
+	if [ $i -eq $TESTSERVER_WAIT_LOOP_NB ]; then
+		 echo "timeouted waiting for test server $SERVER_IP:$SERVER_PORT to start"
+		 exit 1
+	fi
+fi
 
+echo "---------------------"
+echo "$KARMA start $@"
+"$KARMA" start $@
+# echo "Kill test server pid $TESTSERVER_PID"
+# echo "---------------------"
+# kill $TESTSERVER_PID
+
--- a/test-suite/tests/002_comt-logged-admin.js	Mon Apr 14 20:51:24 2014 +0200
+++ b/test-suite/tests/002_comt-logged-admin.js	Thu Apr 17 18:38:19 2014 +0200
@@ -5,11 +5,7 @@
 // set shiftwidth=4		  " as above
 
 var w = __karma__.config.w,
-	t = {'text_nb': 0, 'user_nb': 4},
-	long_text = '';
-
-for (var i = 20; i--;)
-	long_text += 'Contenu du troisième texte.<br/>Sur <b>plusieurs</b> lignes<br/>';
+	t = {'text_nb': 0, 'user_nb': 4};
 
 const hidden = false,
 	no_tagline = false,
@@ -27,35 +23,15 @@
 	'#id_workspace_category_5':	'ws_cat_5',
 	'#id_custom_css': "h2 {  font-family: Test_Sopinspace !important; }",
 	'#id_custom_font': 'Test_Sopinspace_custom_font',
-	'#id_custom_titles_font': 'Test_Sopinspace_custom_titles_font',
-	'texts':	[
-		{
-			'#id_title':	'Text One Sopinspace-Test éléguant',
-			'#id_format':	'markdown',
-			'#id_content':	'Contenu du premier texte.\nSur plusieurs lignes\nPour tester un cas réaliste',
-			'#id_tags':		'test_text, Text Premier'
-		},
-		{
-			'#id_title':	'Text Two Sopinspace-Test éléguant',
-			'#id_format':	'rst',
-			'#id_content':	'Contenu du deuxième texte.\nSur plusieurs lignes aussi\nPour tester un cas réaliste',
-			'#id_tags':		'test_text, Text Second'
-		},
-		{
-			'#id_title':	'Text Three Sopinspace-Test éléguant',
-			'#id_format':	'html',
-			'#id_content':	long_text,
-			'#id_tags':		'test_text, Text Troisième'
-		}
-	]
+	'#id_custom_titles_font': 'Test_Sopinspace_custom_titles_font'
 };
 
 suite ('comt logged admin', function () {
 
-	this.timeout(200000);
+	this.timeout(20000);
 
 	suite ('logs as an admin', function () {
-		test ('logs an admin in', dsl(function () {
+		test ('with '+w.USER_ADMIN+' - '+w.PASS_ADMIN, dsl(function () {
 			browser.navigateTo ('/');
 			input ('#id_username').enter (w.USER_ADMIN);
 			input ('#id_password').enter (w.PASS_ADMIN);
@@ -104,18 +80,6 @@
 		test_unlogged_footer ();
 	});
 
-	suite ('empty texts list page conformity', function () {
-		test_page_loading	('/text/', 'Texts\n - '+c['#id_workspace_name']);
-		test_logged_header	(w.USER_ADMIN);
-		test_default_tabs	(t.text_nb, t.user_nb);
-		test_count	('#text ul.sub_list:eq(0) a', 3);
-		test_text	('#text ul.sub_list:eq(0) a:eq(0)[href="/create/content/"]', 'Create a text');
-		test_text	('#text ul.sub_list:eq(0) a:eq(1)[href="/create/upload/"]', 'Upload a text');
-		test_text	('#text ul.sub_list:eq(0) a:eq(2)[href="/create/import/"]', 'Import a co-mented text');
-		test_match	('#text', /No texts yet/m);
-		test_count	('#texts_form :input', 0);
-	});
-
 	suite ('create a text page conformity', function () {
 		test_page_loading	('/create/content/', 'Create a text - '+c['#id_workspace_name']);
 		test_logged_header	(w.USER_ADMIN);
@@ -188,98 +152,6 @@
 		test_match	('#text div.help_text:eq(0) span.error-text:eq(0)', /You should specify a file to upload/m);
 	});
 
-	suite ('create texts', function () {
-		for (var j=4; j--;)
-			for (var i=3; i--;)
-				 create_text (i);
-	});
-
-	// check that public texts still worwhile unlogged
-	// check that non public texts are unavailable
-	// Are the public texts displayed in the login page ?
-
-	// vérifier les valeurs de settings sauvées
-	// Tester les liens masqués des textes listés si bien créés
-	// Tester suppression de text
-	// Tester bulk actions sur les textes
-
-	// tester l'affichage d'un texte
-	// tester que : #textcontainer.custom h1 font: Test_Sopinspace_custom_titles_font
-	// tester que si Text preferences -> custom -> #textcontainer.custom font: Test_Sopinspace_custom_font
-	// #textcontainer #add_comment_btn span -> #textcontainer font-family: Test_Sopinspace
-
-	suite ('texts list page conformity', function () {
-		test_page_loading	('/text/', 'Texts\n - '+c['#id_workspace_name']);
-		test_logged_header	(w.USER_ADMIN);
-		test_default_tabs	(t.text_nb, t.user_nb);
-		test_count	('#text ul.sub_list:eq(0) a', 3);
-		test_text	('#text ul.sub_list:eq(0) a:eq(0)[href="/create/content/"]', 'Create a text');
-		test_text	('#text ul.sub_list:eq(0) a:eq(1)[href="/create/upload/"]', 'Upload a text');
-		test_text	('#text ul.sub_list:eq(0) a:eq(2)[href="/create/import/"]', 'Import a co-mented text');
-		test_count	('form#filter_form[action="."] :input', 1);
-		test_text	('select#tag_selected option:eq(0)[selected][value="0"]', '- All -', hidden);
-		test_page_loading ('/text/?tag_selected=Text+Troisième', 'Texts\n - '+c['#id_workspace_name']);
-		test_count	('#texts_form :input', 4 + 3);
-		test_match	('#paginator', /\s1-4 of 4\s/m);
-
-		for (var i=4; i--;) {
-			test_text	('a.main_object_title:eq('+i+')', c.texts[2]['#id_title']);
-			test_match	('.tag_list:eq('+i+')', /tags: test_text Text Troisième /);
-			test_text	('.tag_list:eq('+i+') a:eq(0)[href="?tag_selected=test_text"]', 'test_text');
-			test_text	('.tag_list:eq('+i+') a:eq(1)[href="?tag_selected=Text+Troisi%C3%A8me"]','Text Troisième');
-			test_text	('#text .hidden-text-actions:eq('+i+') a:eq(0)[href^="/text/"][href$="/view/"]', 'View');
-			test_text	('#text .hidden-text-actions:eq('+i+') a:eq(1)[href^="/text/"][href$="/edit/"]', 'Edit');
-			test_text	('#text .hidden-text-actions:eq('+i+') a:eq(2)[href$="#"][id*=delete]', 'Delete');
-			test_text	('#text .hidden-text-actions:eq('+i+') a:eq(3)[href^="/text/"][href$="/share/"]', 'Users');
-			test_text	('#text .hidden-text-actions:eq('+i+') a:eq(4)[href^="/text/"][href$="/settings/"]', 'Settings');
-			test_text	('#text a[title="Edit user"][href^="/user/"][href$="/edit/"]:eq('+i+')', 'admin');
-			test_text	('#text table[summary="text list"] tr:eq('+(i+1)+') td:eq(4)', '0');
-		}
-
-		test_page_loading ('/text/', 'Texts\n - '+c['#id_workspace_name']);
-		test_count	('#texts_form :input', (t.text_nb < 10 ? t.text_nb : 10) + 3);
-		test_match	('#paginator', new RegExp ('\\s1-10 of '+t.text_nb+'\\s','m'));
-		test_text	('#paginator a:eq(0)[href="?page=2"]', '»');
-		test_text	('#paginator a:eq(1)[href="?paginate=0"]', 'all');
-		test_click	('#paginator a:eq(0)[href="?page=2"]');
-		test_match	('#paginator', new RegExp ('\\s11-12 of '+t.text_nb+'\\s','m'));
-		test_count	('#texts_form :input', t.text_nb % 10 + 3);
-		test_click	('#paginator a:eq(0)[href="?page=1"]');
-		test_match	('#paginator', new RegExp ('\\s1-10 of '+t.text_nb+'\\s','m'));
-		test_count	('#texts_form :input', (t.text_nb < 10 ? t.text_nb : 10) + 3);
-		test_click	('#paginator a:eq(1)[href="?paginate=0&page=1"]');
-		test_match	('#paginator', /\s\(paginate\)\s/m);
-		test_count	('#texts_form :input', t.text_nb + 3);
-		test_click	('#paginator a:eq(0)[href="?paginate=&page=1"]');
-		test_count	('#texts_form :input', (t.text_nb < 10 ? t.text_nb : 10) + 3);
-		test_match	('#paginator', new RegExp ('\\s1-10 of '+t.text_nb+'\\s','m'));
-		test_page_loading	('/text/', 'Texts\n - '+c['#id_workspace_name']);
-		test_text	('select#bulk_actions option:eq(0)[selected][value="-1"]', 'Bulk Actions', hidden);
-		test_text	('select#bulk_actions option:eq(1)[value="delete"]', 'Delete', hidden);
-		test_val	('form#texts_form input#apply[type=button][disabled]', 'Apply');
-		test_count	('table.large_table:eq(1) th', 6);
-		test_val	('table.large_table:eq(1) th:eq(0) input#all_check[type="checkbox"]', 'on');
-		test_text	('table.large_table:eq(1) th:eq(1) a[href="?order=title"]', 'Text');
-		test_text	('table.large_table:eq(1) th:eq(2)', 'Author');
-		test_text	('table.large_table:eq(1) th:eq(3) a[href="?order=-modified"]', 'Modified');
-		test_text	('table.large_table:eq(1) th:eq(4)', '# comments');
-		test_text	('table.large_table:eq(1) th:eq(5)', 'Last week activity');
-		test_page_loading ('/text/?page=2', 'Texts\n - '+c['#id_workspace_name']);
-		test		('choose bulk action Delete', dsl(function () { input ('#bulk_actions').option ('delete'); }));
-		test_click	('#all_check');
-		test_count	('form#texts_form input:checked', t.text_nb % 10 + 1);
-		test_val	('form#texts_form input#apply[type=button]:not([disabled])', 'Apply');
-		// test_click	('#texts_form #apply'); // can't click on the confirm dialog
-		test_submit	('#texts_form');
-		test_page_loading ('/text/', 'Texts\n - '+c['#id_workspace_name']);
-		t.text_nb -= 2;
-		test_count	('form#texts_form :input', t.text_nb + 3);
-		test_match	('#paginator', new RegExp ('\\s1-10 of '+t.text_nb+'\\s','m'));
-		// TOTEST : unitary delete 
-
-		test_unlogged_footer ();
-	});
-
 	suite ('edit profile page conformity', function () {
 		test_page_loading	('/profile/', 'Your profile \\('+w.USER_ADMIN+'\\)\n - '+c['#id_workspace_name']);
 		test_logged_header	(w.USER_ADMIN, no_tagline);
@@ -519,19 +391,3 @@
 	test_fill_field ('#id_custom_font', s);
 	test_fill_field ('#id_custom_titles_font', s);
 }
-
-function create_text (i) {
-	test_page_loading	('/create/content/', 'Create a text - '+c['#id_workspace_name']);
-	test ('test creation', dsl(function () {
-		dropdownlist ('#id_format').option (c['texts'][i]['#id_format']);
-	}));
-
-	test_fill_field ('#id_title', c['texts'][i]);
-	test ('fill content', dsl(function (){
-		elt ('#id_content').val (c['texts'][i]['#id_content']);
-	}));
-
-	test_fill_field ('#id_tags', c['texts'][i]);
-	test_click	 ('#save_button', wait_page_load);
-	t.text_nb++;
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/003_comt-admin-text-list.js	Thu Apr 17 18:38:19 2014 +0200
@@ -0,0 +1,161 @@
+
+// " Vim settings
+// set tabstop=4          " number of spaces in a tab
+// set softtabstop=4      " as above
+// set shiftwidth=4       " as above
+
+var long_text = '';
+
+for (var i = 20; i--;)
+    long_text += 'Contenu du troisième texte.<br/>Sur <b>plusieurs</b> lignes<br/>';
+
+const ctexts = [ 
+    { 
+        '#id_title':    'Text One Sopinspace-Test éléguant', 
+        '#id_format':   'markdown', 
+        '#id_content':  'Contenu du premier texte.\nSur plusieurs lignes\nPour tester un cas réaliste', 
+        '#id_tags':     'test_text, Text Premier' 
+    }, 
+    { 
+        '#id_title':    'Text Two Sopinspace-Test éléguant', 
+        '#id_format':   'rst', 
+        '#id_content':  'Contenu du deuxième texte.\nSur plusieurs lignes aussi\nPour tester un cas réaliste', 
+        '#id_tags':     'test_text, Text Second' 
+    }, 
+    { 
+        '#id_title':    'Text Three Sopinspace-Test éléguant', 
+        '#id_format':   'html', 
+        '#id_content':  long_text, 
+        '#id_tags':     'test_text, Text Troisième' 
+    } 
+];
+
+suite ('comt admin text list', function () {
+
+    this.timeout(200000);
+
+    suite ('empty texts list page conformity', function () {
+        test_page_loading   ('/text/', 'Texts\n - '+c['#id_workspace_name']);
+        test_logged_header  (w.USER_ADMIN);
+        test_default_tabs   (t.text_nb, t.user_nb);
+        test_count  ('#text ul.sub_list:eq(0) a', 3);
+        test_text   ('#text ul.sub_list:eq(0) a:eq(0)[href="/create/content/"]', 'Create a text');
+        test_text   ('#text ul.sub_list:eq(0) a:eq(1)[href="/create/upload/"]', 'Upload a text');
+        test_text   ('#text ul.sub_list:eq(0) a:eq(2)[href="/create/import/"]', 'Import a co-mented text');
+        test_match  ('#text', /No texts yet/m);
+        test_count  ('#texts_form :input', 0);
+    });
+
+    suite ('create texts', function () {
+        for (var j=4; j--;)
+            for (var i=3; i--;)
+                 create_text (i);
+    });
+
+    suite ('texts list page conformity', function () {
+        test_page_loading   ('/text/', 'Texts\n - '+c['#id_workspace_name']);
+        test_logged_header  (w.USER_ADMIN);
+        test_default_tabs   (t.text_nb, t.user_nb);
+        test_count  ('#text ul.sub_list:eq(0) a', 3);
+        test_text   ('#text ul.sub_list:eq(0) a:eq(0)[href="/create/content/"]', 'Create a text');
+        test_text   ('#text ul.sub_list:eq(0) a:eq(1)[href="/create/upload/"]', 'Upload a text');
+        test_text   ('#text ul.sub_list:eq(0) a:eq(2)[href="/create/import/"]', 'Import a co-mented text');
+        test_count  ('form#filter_form[action="."] :input', 1);
+        test_text   ('select#tag_selected option:eq(0)[selected][value="0"]', '- All -', hidden);
+        test_text   ('select#bulk_actions option:eq(0)[selected][value="-1"]', 'Bulk Actions', hidden);
+        test_text   ('select#bulk_actions option:eq(1)[value="delete"]', 'Delete', hidden);
+        test_val    ('form#texts_form input#apply[type=button][disabled]', 'Apply');
+        test_count  ('table.large_table:eq(1) th', 6);
+        test_val    ('table.large_table:eq(1) th:eq(0) input#all_check[type="checkbox"]', 'on');
+        test_text   ('table.large_table:eq(1) th:eq(1) a[href="?order=title"]', 'Text');
+        test_text   ('table.large_table:eq(1) th:eq(2)', 'Author');
+        test_text   ('table.large_table:eq(1) th:eq(3) a[href="?order=-modified"]', 'Modified');
+        test_text   ('table.large_table:eq(1) th:eq(4)', '# comments');
+        test_text   ('table.large_table:eq(1) th:eq(5)', 'Last week activity');
+        test_unlogged_footer ();
+    });
+
+    suite ('texts list filter', function () {
+        test_page_loading ('/text/?tag_selected=Text+Troisième', 'Texts\n - '+c['#id_workspace_name']);
+        test_count  ('#texts_form :input', 4 + 3);
+        test_match  ('#paginator', /\s1-4 of 4\s/m);
+
+        for (var i=4; i--;) {
+            test_text   ('a.main_object_title:eq('+i+')', ctexts[2]['#id_title']);
+            test_match  ('.tag_list:eq('+i+')', /tags: test_text Text Troisième /);
+            test_text   ('.tag_list:eq('+i+') a:eq(0)[href="?tag_selected=test_text"]', 'test_text');
+            test_text   ('.tag_list:eq('+i+') a:eq(1)[href="?tag_selected=Text+Troisi%C3%A8me"]','Text Troisième');
+            test_text   ('#text .hidden-text-actions:eq('+i+') a:eq(0)[href^="/text/"][href$="/view/"]', 'View');
+            test_text   ('#text .hidden-text-actions:eq('+i+') a:eq(1)[href^="/text/"][href$="/edit/"]', 'Edit');
+            test_text   ('#text .hidden-text-actions:eq('+i+') a:eq(2)[href="#"][id*="text-delete-"]', 'Delete');
+            test_text   ('#text .hidden-text-actions:eq('+i+') a:eq(3)[href^="/text/"][href$="/share/"]', 'Users');
+            test_text   ('#text .hidden-text-actions:eq('+i+') a:eq(4)[href^="/text/"][href$="/settings/"]', 'Settings');
+            test_text   ('#text a[title="Edit user"][href^="/user/"][href$="/edit/"]:eq('+i+')', 'admin');
+            test_text   ('#text table[summary="text list"] tr:eq('+(i+1)+') td:eq(4)', '0');
+        }
+    });
+
+    suite ('texts list pagination conformity', function () {
+        test_page_loading ('/text/', 'Texts\n - '+c['#id_workspace_name']);
+        test_count  ('#texts_form :input', (t.text_nb < 10 ? t.text_nb : 10) + 3);
+        test_match  ('#paginator', new RegExp ('\\s1-10 of '+t.text_nb+'\\s','m'));
+        test_text   ('#paginator a:eq(0)[href="?page=2"]', '»');
+        test_text   ('#paginator a:eq(1)[href="?paginate=0"]', 'all');
+        test_click  ('#paginator a:eq(0)[href="?page=2"]');
+        test_match  ('#paginator', new RegExp ('\\s11-12 of '+t.text_nb+'\\s','m'));
+        test_count  ('#texts_form :input', t.text_nb % 10 + 3);
+        test_click  ('#paginator a:eq(0)[href="?page=1"]');
+        test_match  ('#paginator', new RegExp ('\\s1-10 of '+t.text_nb+'\\s','m'));
+        test_count  ('#texts_form :input', (t.text_nb < 10 ? t.text_nb : 10) + 3);
+        test_click  ('#paginator a:eq(1)[href="?paginate=0&page=1"]');
+        test_match  ('#paginator', /\s\(paginate\)\s/m);
+        test_count  ('#texts_form :input', t.text_nb + 3);
+        test_click  ('#paginator a:eq(0)[href="?paginate=&page=1"]');
+        test_count  ('#texts_form :input', (t.text_nb < 10 ? t.text_nb : 10) + 3);
+        test_match  ('#paginator', new RegExp ('\\s1-10 of '+t.text_nb+'\\s','m'));
+    });
+
+    suite ('texts list bulk deletion', function () {
+        test_page_loading ('/text/?page=2', 'Texts\n - '+c['#id_workspace_name']);
+        test        ('choose bulk action Delete', dsl(function () { input('#bulk_actions').option('delete'); }));
+        test_click  ('#all_check');
+        test_count  ('form#texts_form input:checked', t.text_nb % 10 + 1);
+        test_val    ('form#texts_form input#apply[type=button]:not([disabled])', 'Apply');
+        /* test_click   ('#texts_form #apply'); // can't click on the confirm dialog */
+        test_submit ('#texts_form');
+        test_page_loading ('/text/', 'Texts\n - '+c['#id_workspace_name']);
+        t.text_nb -= 2;
+        test_count  ('form#texts_form :input', t.text_nb + 3);
+        test_match  ('#paginator', new RegExp ('\\s1-'+t.text_nb+' of '+t.text_nb+'\\s','m'));
+    });
+
+    suite ('texts list single deletion', function () {
+        test        ('choose bulk action Delete', dsl(function () { input('#bulk_actions').option('delete'); }));
+        test_click  ('.text_check:eq(0)');
+        test_count  ('form#texts_form input:checked', 1);
+        test_val    ('form#texts_form input#apply[type=button]:not([disabled])', 'Apply');
+        test_submit ('#texts_form');
+        test_page_loading ('/text/', 'Texts\n - '+c['#id_workspace_name']);
+        t.text_nb -= 1;
+        test_count  ('form#texts_form :input', t.text_nb + 3);
+        test_match  ('#paginator', new RegExp ('\\s1-'+t.text_nb+' of '+t.text_nb+'\\s','m'));
+    });
+
+});
+
+function create_text (i) {
+    test_page_loading   ('/create/content/', 'Create a text - '+c['#id_workspace_name']);
+    test ('test creation', dsl(function () {
+        dropdownlist ('#id_format').option (ctexts[i]['#id_format']);
+    }));
+
+    test_fill_field ('#id_title', ctexts[i]);
+    test ('fill content', dsl(function (){
+        elt ('#id_content').val (ctexts[i]['#id_content']);
+    }));
+
+    test_fill_field ('#id_tags', ctexts[i]);
+    test_click   ('#save_button', wait_page_load);
+    t.text_nb++;
+}
+
--- a/test-suite/workspace.info.js.example	Mon Apr 14 20:51:24 2014 +0200
+++ b/test-suite/workspace.info.js.example	Thu Apr 17 18:38:19 2014 +0200
@@ -1,7 +1,5 @@
 
-define ("DEBUG", false); // in DEBUG mode tests stop at first fail to let you check what happen
 define ("BROWSERS", ['Chrome']);
-
 define ("WORKSPACE_URL", '<workspace-url>'); // In http://IP_ADDRESS:PORT_NUM/ format
 define ("USER_ADMIN", '<admin-login>');
 define ("PASS_ADMIN", '<admin-password>');