# HG changeset patch # User Simon Descarpentries # Date 1396630175 -7200 # Node ID eb52900a0bbf1395bdfda41237bc4b6cc051a030 # Parent 3dd70d01cec2f4db0bfda42e4a1bfb172010b8e8 [Testsuite] Can create 3 texts diff -r 3dd70d01cec2 -r eb52900a0bbf test-suite/lib/test_hlp.js --- a/test-suite/lib/test_hlp.js Fri Apr 04 18:23:30 2014 +0200 +++ b/test-suite/lib/test_hlp.js Fri Apr 04 18:49:35 2014 +0200 @@ -138,7 +138,7 @@ } /** - * Have the browser waiting + * Have the browser waiting while you inspect what's going on */ exports.pause = function () { test ('pause', dsl(function () { diff -r 3dd70d01cec2 -r eb52900a0bbf test-suite/tests/001_comt-logged-admin.js --- a/test-suite/tests/001_comt-logged-admin.js Fri Apr 04 18:23:30 2014 +0200 +++ b/test-suite/tests/001_comt-logged-admin.js Fri Apr 04 18:49:35 2014 +0200 @@ -8,6 +8,11 @@ test_ = JSON.parse (k.t, new Function (['k','v'], k.r)), // revive helper functions sent from Karma t = {'text_nb': 0, 'user_nb': 4}; +var long_text = ''; + +for (var i = 20; i--;) + long_text += 'Contenu du troisième texte.
Sur plusieurs lignes
'; + const non_visible = false, no_tagline = false, c = { @@ -40,7 +45,7 @@ { '#id_title': 'Text Three Sopinspace-Test éléguant', '#id_format': 'html', - '#id_content': 'Contenu du troisième texte.
Sur plusieurs lignes
', + '#id_content': long_text, '#id_tags': 'test_text, Text Troisième' } ] @@ -185,28 +190,9 @@ }); suite ('create texts', function () { -/* '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' - },*/ - test_.page_loading ('/create/content/', 'Create a text - '+c['#id_workspace_name']); - test ('test creation', dsl(function () { - dropdownlist ('#id_format').option (c['texts'][0]['#id_format']); - })); - test_.fill_field ('#id_title', c['texts'][0]); - test_.fill_field ('#id_content', c['texts'][0]); - test_.fill_field ('#id_tags', c['texts'][0]); - test_.val ('#id_title', 'Text One Sopinspace-Test éléguant'); - //test_.pause (); - //test_.submit ('#save_button'); - //t.text_nb++; + for (var i=3; i--;) + create_text (i); }); - // insert here text creation - // create successively : a markdown text, a html and a rst one - // with tags // check that public texts still work while unlogged // check that non public texts are unavailable @@ -222,7 +208,7 @@ // tester que si Text preferences -> custom -> #textcontainer.custom font: Test_Sopinspace_custom_font // #textcontainer #add_comment_btn span -> #textcontainer font-family: Test_Sopinspace - suite.skip ('texts list page conformity', function () { + suite ('texts list page conformity', function () { test_.page_loading ('/text/', 'Texts\n - '+c['#id_workspace_name']); test_logged_header (k.w.USER_ADMIN); test_default_tabs (t.text_nb, t.user_nb); @@ -489,3 +475,19 @@ 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 (){ + test_.elt ('#id_content').val (c['texts'][i]['#id_content']); + })); + + test_.fill_field ('#id_tags', c['texts'][i]); + test_.submit ('#save_button'); + t.text_nb++; +}