| author | Simon Descarpentries <sid@sopinspace.com> |
| Thu, 17 Apr 2014 18:38:19 +0200 | |
| changeset 637 | 71d87ca43d6a |
| permissions | -rw-r--r-- |
|
637
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
1 |
|
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
2 |
// " Vim settings |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
3 |
// set tabstop=4 " number of spaces in a tab |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
4 |
// set softtabstop=4 " as above |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
5 |
// set shiftwidth=4 " as above |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
6 |
|
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
7 |
var long_text = ''; |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
8 |
|
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
9 |
for (var i = 20; i--;) |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
10 |
long_text += 'Contenu du troisième texte.<br/>Sur <b>plusieurs</b> lignes<br/>'; |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
11 |
|
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
12 |
const ctexts = [ |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
13 |
{ |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
14 |
'#id_title': 'Text One Sopinspace-Test éléguant', |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
15 |
'#id_format': 'markdown', |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
16 |
'#id_content': 'Contenu du premier texte.\nSur plusieurs lignes\nPour tester un cas réaliste', |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
17 |
'#id_tags': 'test_text, Text Premier' |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
18 |
}, |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
19 |
{ |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
20 |
'#id_title': 'Text Two Sopinspace-Test éléguant', |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
21 |
'#id_format': 'rst', |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
22 |
'#id_content': 'Contenu du deuxième texte.\nSur plusieurs lignes aussi\nPour tester un cas réaliste', |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
23 |
'#id_tags': 'test_text, Text Second' |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
24 |
}, |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
25 |
{ |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
26 |
'#id_title': 'Text Three Sopinspace-Test éléguant', |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
27 |
'#id_format': 'html', |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
28 |
'#id_content': long_text, |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
29 |
'#id_tags': 'test_text, Text Troisième' |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
30 |
} |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
31 |
]; |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
32 |
|
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
33 |
suite ('comt admin text list', function () { |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
34 |
|
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
35 |
this.timeout(200000); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
36 |
|
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
37 |
suite ('empty texts list page conformity', function () { |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
38 |
test_page_loading ('/text/', 'Texts\n - '+c['#id_workspace_name']); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
39 |
test_logged_header (w.USER_ADMIN); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
40 |
test_default_tabs (t.text_nb, t.user_nb); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
41 |
test_count ('#text ul.sub_list:eq(0) a', 3); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
42 |
test_text ('#text ul.sub_list:eq(0) a:eq(0)[href="/create/content/"]', 'Create a text'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
43 |
test_text ('#text ul.sub_list:eq(0) a:eq(1)[href="/create/upload/"]', 'Upload a text'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
44 |
test_text ('#text ul.sub_list:eq(0) a:eq(2)[href="/create/import/"]', 'Import a co-mented text'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
45 |
test_match ('#text', /No texts yet/m); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
46 |
test_count ('#texts_form :input', 0); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
47 |
}); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
48 |
|
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
49 |
suite ('create texts', function () { |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
50 |
for (var j=4; j--;) |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
51 |
for (var i=3; i--;) |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
52 |
create_text (i); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
53 |
}); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
54 |
|
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
55 |
suite ('texts list page conformity', function () { |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
56 |
test_page_loading ('/text/', 'Texts\n - '+c['#id_workspace_name']); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
57 |
test_logged_header (w.USER_ADMIN); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
58 |
test_default_tabs (t.text_nb, t.user_nb); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
59 |
test_count ('#text ul.sub_list:eq(0) a', 3); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
60 |
test_text ('#text ul.sub_list:eq(0) a:eq(0)[href="/create/content/"]', 'Create a text'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
61 |
test_text ('#text ul.sub_list:eq(0) a:eq(1)[href="/create/upload/"]', 'Upload a text'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
62 |
test_text ('#text ul.sub_list:eq(0) a:eq(2)[href="/create/import/"]', 'Import a co-mented text'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
63 |
test_count ('form#filter_form[action="."] :input', 1); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
64 |
test_text ('select#tag_selected option:eq(0)[selected][value="0"]', '- All -', hidden); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
65 |
test_text ('select#bulk_actions option:eq(0)[selected][value="-1"]', 'Bulk Actions', hidden); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
66 |
test_text ('select#bulk_actions option:eq(1)[value="delete"]', 'Delete', hidden); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
67 |
test_val ('form#texts_form input#apply[type=button][disabled]', 'Apply'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
68 |
test_count ('table.large_table:eq(1) th', 6); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
69 |
test_val ('table.large_table:eq(1) th:eq(0) input#all_check[type="checkbox"]', 'on'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
70 |
test_text ('table.large_table:eq(1) th:eq(1) a[href="?order=title"]', 'Text'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
71 |
test_text ('table.large_table:eq(1) th:eq(2)', 'Author'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
72 |
test_text ('table.large_table:eq(1) th:eq(3) a[href="?order=-modified"]', 'Modified'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
73 |
test_text ('table.large_table:eq(1) th:eq(4)', '# comments'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
74 |
test_text ('table.large_table:eq(1) th:eq(5)', 'Last week activity'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
75 |
test_unlogged_footer (); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
76 |
}); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
77 |
|
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
78 |
suite ('texts list filter', function () { |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
79 |
test_page_loading ('/text/?tag_selected=Text+Troisième', 'Texts\n - '+c['#id_workspace_name']); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
80 |
test_count ('#texts_form :input', 4 + 3); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
81 |
test_match ('#paginator', /\s1-4 of 4\s/m); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
82 |
|
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
83 |
for (var i=4; i--;) { |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
84 |
test_text ('a.main_object_title:eq('+i+')', ctexts[2]['#id_title']); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
85 |
test_match ('.tag_list:eq('+i+')', /tags: test_text Text Troisième /); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
86 |
test_text ('.tag_list:eq('+i+') a:eq(0)[href="?tag_selected=test_text"]', 'test_text'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
87 |
test_text ('.tag_list:eq('+i+') a:eq(1)[href="?tag_selected=Text+Troisi%C3%A8me"]','Text Troisième'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
88 |
test_text ('#text .hidden-text-actions:eq('+i+') a:eq(0)[href^="/text/"][href$="/view/"]', 'View'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
89 |
test_text ('#text .hidden-text-actions:eq('+i+') a:eq(1)[href^="/text/"][href$="/edit/"]', 'Edit'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
90 |
test_text ('#text .hidden-text-actions:eq('+i+') a:eq(2)[href="#"][id*="text-delete-"]', 'Delete'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
91 |
test_text ('#text .hidden-text-actions:eq('+i+') a:eq(3)[href^="/text/"][href$="/share/"]', 'Users'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
92 |
test_text ('#text .hidden-text-actions:eq('+i+') a:eq(4)[href^="/text/"][href$="/settings/"]', 'Settings'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
93 |
test_text ('#text a[title="Edit user"][href^="/user/"][href$="/edit/"]:eq('+i+')', 'admin'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
94 |
test_text ('#text table[summary="text list"] tr:eq('+(i+1)+') td:eq(4)', '0'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
95 |
} |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
96 |
}); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
97 |
|
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
98 |
suite ('texts list pagination conformity', function () { |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
99 |
test_page_loading ('/text/', 'Texts\n - '+c['#id_workspace_name']); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
100 |
test_count ('#texts_form :input', (t.text_nb < 10 ? t.text_nb : 10) + 3); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
101 |
test_match ('#paginator', new RegExp ('\\s1-10 of '+t.text_nb+'\\s','m')); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
102 |
test_text ('#paginator a:eq(0)[href="?page=2"]', '»'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
103 |
test_text ('#paginator a:eq(1)[href="?paginate=0"]', 'all'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
104 |
test_click ('#paginator a:eq(0)[href="?page=2"]'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
105 |
test_match ('#paginator', new RegExp ('\\s11-12 of '+t.text_nb+'\\s','m')); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
106 |
test_count ('#texts_form :input', t.text_nb % 10 + 3); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
107 |
test_click ('#paginator a:eq(0)[href="?page=1"]'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
108 |
test_match ('#paginator', new RegExp ('\\s1-10 of '+t.text_nb+'\\s','m')); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
109 |
test_count ('#texts_form :input', (t.text_nb < 10 ? t.text_nb : 10) + 3); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
110 |
test_click ('#paginator a:eq(1)[href="?paginate=0&page=1"]'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
111 |
test_match ('#paginator', /\s\(paginate\)\s/m); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
112 |
test_count ('#texts_form :input', t.text_nb + 3); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
113 |
test_click ('#paginator a:eq(0)[href="?paginate=&page=1"]'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
114 |
test_count ('#texts_form :input', (t.text_nb < 10 ? t.text_nb : 10) + 3); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
115 |
test_match ('#paginator', new RegExp ('\\s1-10 of '+t.text_nb+'\\s','m')); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
116 |
}); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
117 |
|
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
118 |
suite ('texts list bulk deletion', function () { |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
119 |
test_page_loading ('/text/?page=2', 'Texts\n - '+c['#id_workspace_name']); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
120 |
test ('choose bulk action Delete', dsl(function () { input('#bulk_actions').option('delete'); })); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
121 |
test_click ('#all_check'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
122 |
test_count ('form#texts_form input:checked', t.text_nb % 10 + 1); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
123 |
test_val ('form#texts_form input#apply[type=button]:not([disabled])', 'Apply'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
124 |
/* test_click ('#texts_form #apply'); // can't click on the confirm dialog */ |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
125 |
test_submit ('#texts_form'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
126 |
test_page_loading ('/text/', 'Texts\n - '+c['#id_workspace_name']); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
127 |
t.text_nb -= 2; |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
128 |
test_count ('form#texts_form :input', t.text_nb + 3); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
129 |
test_match ('#paginator', new RegExp ('\\s1-'+t.text_nb+' of '+t.text_nb+'\\s','m')); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
130 |
}); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
131 |
|
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
132 |
suite ('texts list single deletion', function () { |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
133 |
test ('choose bulk action Delete', dsl(function () { input('#bulk_actions').option('delete'); })); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
134 |
test_click ('.text_check:eq(0)'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
135 |
test_count ('form#texts_form input:checked', 1); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
136 |
test_val ('form#texts_form input#apply[type=button]:not([disabled])', 'Apply'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
137 |
test_submit ('#texts_form'); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
138 |
test_page_loading ('/text/', 'Texts\n - '+c['#id_workspace_name']); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
139 |
t.text_nb -= 1; |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
140 |
test_count ('form#texts_form :input', t.text_nb + 3); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
141 |
test_match ('#paginator', new RegExp ('\\s1-'+t.text_nb+' of '+t.text_nb+'\\s','m')); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
142 |
}); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
143 |
|
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
144 |
}); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
145 |
|
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
146 |
function create_text (i) { |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
147 |
test_page_loading ('/create/content/', 'Create a text - '+c['#id_workspace_name']); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
148 |
test ('test creation', dsl(function () { |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
149 |
dropdownlist ('#id_format').option (ctexts[i]['#id_format']); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
150 |
})); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
151 |
|
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
152 |
test_fill_field ('#id_title', ctexts[i]); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
153 |
test ('fill content', dsl(function (){ |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
154 |
elt ('#id_content').val (ctexts[i]['#id_content']); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
155 |
})); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
156 |
|
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
157 |
test_fill_field ('#id_tags', ctexts[i]); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
158 |
test_click ('#save_button', wait_page_load); |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
159 |
t.text_nb++; |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
160 |
} |
|
71d87ca43d6a
Integration of django testserver start in start-test-suite.sh
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
161 |