| author | Simon Descarpentries <sid@sopinspace.com> |
| Fri, 04 Apr 2014 18:23:30 +0200 | |
| changeset 624 | 3dd70d01cec2 |
| child 625 | eb52900a0bbf |
| permissions | -rw-r--r-- |
|
624
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
1 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
2 |
// " Vim settings |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
3 |
// set tabstop=4 " number of spaces in a tab |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
4 |
// set softtabstop=4 " as above |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
5 |
// set shiftwidth=4 " as above |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
6 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
7 |
var k = __karma__.config, |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
8 |
test_ = JSON.parse (k.t, new Function (['k','v'], k.r)), // revive helper functions sent from Karma |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
9 |
t = {'text_nb': 0, 'user_nb': 4}; |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
10 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
11 |
const non_visible = false, |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
12 |
no_tagline = false, |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
13 |
c = { |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
14 |
'#id_workspace_name': 'Test workspace name', |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
15 |
'#id_workspace_tagline': 'Test workspace tagline', |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
16 |
'#id_workspace_registration': 'on', // registration |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
17 |
'#id_workspace_registration_moderation':'on', // registration moderation |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
18 |
'#id_workspace_role_model': 'generic', |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
19 |
'#id_workspace_category_1': 'ws_cat_1', |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
20 |
'#id_workspace_category_2': 'ws_cat_2', |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
21 |
'#id_workspace_category_3': 'ws_cat_3', |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
22 |
'#id_workspace_category_4': 'ws_cat_4', |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
23 |
'#id_workspace_category_5': 'ws_cat_5', |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
24 |
'#id_custom_css': "h2 { font-family: Test_Sopinspace !important; }", |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
25 |
'#id_custom_font': 'Test_Sopinspace_custom_font', |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
26 |
'#id_custom_titles_font': 'Test_Sopinspace_custom_titles_font', |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
27 |
'texts': [ |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
28 |
{ |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
29 |
'#id_title': 'Text One Sopinspace-Test éléguant', |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
30 |
'#id_format': 'markdown', |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
31 |
'#id_content': 'Contenu du premier texte.\nSur plusieurs lignes\nPour tester un cas réaliste', |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
32 |
'#id_tags': 'test_text, Text Premier' |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
33 |
}, |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
34 |
{ |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
35 |
'#id_title': 'Text Two Sopinspace-Test éléguant', |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
36 |
'#id_format': 'rst', |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
37 |
'#id_content': 'Contenu du deuxième texte.\nSur plusieurs lignes aussi\nPour tester un cas réaliste', |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
38 |
'#id_tags': 'test_text, Text Second' |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
39 |
}, |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
40 |
{ |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
41 |
'#id_title': 'Text Three Sopinspace-Test éléguant', |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
42 |
'#id_format': 'html', |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
43 |
'#id_content': 'Contenu du troisième texte.<br/>Sur <b>plusieurs</b> lignes<br/>', |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
44 |
'#id_tags': 'test_text, Text Troisième' |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
45 |
} |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
46 |
] |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
47 |
}; |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
48 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
49 |
suite ('comt logged admin', function () { |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
50 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
51 |
this.timeout(20000); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
52 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
53 |
suite ('logs as an admin', function () { |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
54 |
test ('logs an admin in', dsl(function () { |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
55 |
browser.navigateTo ('/'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
56 |
input ('#id_username').enter (k.w.USER_ADMIN); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
57 |
input ('#id_password').enter (k.w.PASS_ADMIN); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
58 |
test_.elt ('#login input[type=submit]').click (); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
59 |
browser.waitForPageLoad (); // Must be done here in this test() block |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
60 |
browser.navigateTo ('/'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
61 |
expect (element ('title').text ()).toMatch (/Dashboard/m); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
62 |
})); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
63 |
}); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
64 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
65 |
suite ('setting settings to test-values', function () { |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
66 |
test_.page_loading ('/settings/', 'Settings'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
67 |
test_fill_settings (c); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
68 |
test_.val ('#id_workspace_name', c['#id_workspace_name']); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
69 |
test_.submit ('#settings input[type="submit"]'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
70 |
test_.page_loading ('/settings/', 'Settings'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
71 |
test_.text ('#content h1.main_title a[href="/"]', c['#id_workspace_name']); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
72 |
test_.page_loading ('/settings/design/', 'Settings'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
73 |
test_fill_design (c); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
74 |
test_.submit ('#settings input[type="submit"]'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
75 |
}); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
76 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
77 |
suite ('admin dashboard page conformity', function () { |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
78 |
test_.page_loading ('/', 'Dashboard\n - '+c['#id_workspace_name']); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
79 |
test_logged_header (k.w.USER_ADMIN); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
80 |
test_default_tabs (t.text_nb, t.user_nb); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
81 |
test_.count ('table.dash_table', 5); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
82 |
test_.text ('table.dash_table th:eq(0)', 'Actions'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
83 |
test_.match ('table.dash_table:eq(0) a:eq(0)[href="/create/content/"]', /\sCreate a text/); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
84 |
test_.text ('table.dash_table:eq(0) a:eq(1).tip[href="#"]', '\xa0'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
85 |
test_.match ('table.dash_table:eq(0) a:eq(2)[href="/create/upload/"]', /\sUpload a text/); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
86 |
test_.text ('table.dash_table:eq(0) a:eq(3).tip[href="#"]', '\xa0'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
87 |
test_.match ('table.dash_table:eq(0) a:eq(4)[href="/create/import/"]', /\sImport a co-mented text/); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
88 |
test_.text ('table.dash_table:eq(0) a:eq(5).tip[href="#"]', '\xa0'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
89 |
test_.match ('table.dash_table:eq(0) a:eq(6)[href="/user/add/"]', /\sInvite user/); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
90 |
test_.match ('table.dash_table:eq(0) a:eq(7)[href="/profile/"]', /\sEdit your profile/); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
91 |
test_.match ('table.dash_table:eq(0) a:eq(8)[href="/text/"]', /\sView text list/); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
92 |
test_.match ('table.dash_table:eq(0) a:eq(9)[href="/settings/"]', /\sConfigure workspace/); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
93 |
test_.text ('table.dash_table th:eq(1)', 'Recent texts (all)'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
94 |
test_.text ('table.dash_table:eq(1) a:eq(0)[href="/text/"]', 'all'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
95 |
test_.text ('table.dash_table th:eq(2)', 'Recent comments'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
96 |
test_.match ('table.dash_table th:eq(3)', /^Workspace activity\n\s+\(month\/week\/24 hours\)$/m); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
97 |
test_.text ('table.dash_table:eq(3) a:eq(0)[href="?span=month"]', 'month'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
98 |
test_.text ('table.dash_table:eq(3) a:eq(1)[href="?span=day"]', '24 hours'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
99 |
test_.text ('table.dash_table th:eq(4) span.em', 'Activities'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
100 |
test_unlogged_footer (); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
101 |
}); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
102 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
103 |
suite ('empty texts list page conformity', function () { |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
104 |
test_.page_loading ('/text/', 'Texts\n - '+c['#id_workspace_name']); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
105 |
test_logged_header (k.w.USER_ADMIN); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
106 |
test_default_tabs (t.text_nb, t.user_nb); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
107 |
test_.count ('#text ul.sub_list:eq(0) a', 3); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
108 |
test_.text ('#text ul.sub_list:eq(0) a:eq(0)[href="/create/content/"]', 'Create a text'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
109 |
test_.text ('#text ul.sub_list:eq(0) a:eq(1)[href="/create/upload/"]', 'Upload a text'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
110 |
test_.text ('#text ul.sub_list:eq(0) a:eq(2)[href="/create/import/"]', 'Import a co-mented text'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
111 |
test_.match ('#text', /No texts yet/m); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
112 |
test_.count ('#texts_form :input', 0); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
113 |
}); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
114 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
115 |
suite ('create a text page conformity', function () { |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
116 |
test_.page_loading ('/create/content/', 'Create a text - '+c['#id_workspace_name']); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
117 |
test_logged_header (k.w.USER_ADMIN); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
118 |
test_default_tabs (t.text_nb, t.user_nb); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
119 |
test_.count ('#text ul.sub_list:eq(0) a', 3); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
120 |
test_.text ('#text ul.sub_list:eq(0) a:eq(0)[href="/text/"]', 'Text list'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
121 |
test_.text ('#text ul.sub_list:eq(0) a:eq(1)[href="/create/upload/"]', 'Upload a text'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
122 |
test_.text ('#text ul.sub_list:eq(0) a:eq(2)[href="/create/import/"]', 'Import a co-mented text'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
123 |
test_.count ('#text form[action="."]:eq(0) :input', 6); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
124 |
test_.field ('text', 'id_title', 'text', 0, 'Title', true); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
125 |
test_.field ('text', 'id_format', 'select', 1, 'Format', true); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
126 |
test_.field ('text', 'id_content', 'textarea', 2, 'Content', true); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
127 |
test_.field ('text', 'id_tags', 'text', 3, 'Tags'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
128 |
test_.val ('#text :input:eq(4)[type=submit]', 'Save'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
129 |
test_.val ('#text :input:eq(5)#cancel_button[type=button]', 'Cancel'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
130 |
test_.count ('select#id_format option', 3); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
131 |
test_.text ('select#id_format option:eq(0)[value="markdown"][selected]', 'markdown', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
132 |
test_.text ('select#id_format option:eq(1)[value="rst"]', 'rst', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
133 |
test_.text ('select#id_format option:eq(2)[value="html"]', 'html', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
134 |
test_.count ('.markdown #markItUpId_content li', 20); // How many buttons in the WYSIWYG editor toolbar ? |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
135 |
test_unlogged_footer (); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
136 |
test_.submit('#text input[type="submit"]'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
137 |
test_.count ('div.help_text span.error-text', 2); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
138 |
test_.field ('text div.error', 'id_title', 'text', 0, 'Title', true); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
139 |
test_.field ('text div.error', 'id_content', 'textarea', 1, 'Content', true); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
140 |
}); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
141 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
142 |
suite ('upload text page conformity', function () { |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
143 |
test_.page_loading ('/create/upload/', 'Upload a text - '+c['#id_workspace_name']); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
144 |
test_logged_header (k.w.USER_ADMIN); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
145 |
test_default_tabs (t.text_nb, t.user_nb); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
146 |
test_.count ('#text ul.sub_list:eq(0) a', 3); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
147 |
test_.text ('#text ul.sub_list:eq(0) a:eq(0)[href="/text/"]', 'Text list'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
148 |
test_.text ('#text ul.sub_list:eq(0) a:eq(1)[href="/create/content/"]', 'Create a text'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
149 |
test_.text ('#text ul.sub_list:eq(0) a:eq(2)[href="/create/import/"]', 'Import a co-mented text'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
150 |
test_.count ('#text form[action="."]:eq(0) :input', 6); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
151 |
test_.field ('text', 'id_title', 'text', 0, 'Title'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
152 |
test_.field ('text', 'id_format', 'select', 1, 'Format', true); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
153 |
test_.field ('text', 'id_tags', 'text', 2, 'Tags'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
154 |
test_.field ('text', 'id_file', 'file', 3, 'Upload file'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
155 |
test_.val ('#text :input:eq(4)[type=submit]', 'Save'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
156 |
test_.val ('#text :input:eq(5)#cancel_button[type=button]', 'Cancel'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
157 |
test_.count ('select#id_format option', 3); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
158 |
test_.text ('select#id_format option:eq(0)[value="markdown"][selected]', 'markdown', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
159 |
test_.text ('select#id_format option:eq(1)[value="rst"]', 'rst', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
160 |
test_.text ('select#id_format option:eq(2)[value="html"]', 'html', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
161 |
test_unlogged_footer (); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
162 |
test_.submit('#text input[type="submit"]'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
163 |
test_.count ('div.help_text span.error-text', 1); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
164 |
test_.field ('text div.error', 'id_file', 'file', 0, 'Upload file'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
165 |
test_.match ('#text div.help_text:eq(3) span.error-text:eq(0)', /You should specify a file to upload/m); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
166 |
}); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
167 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
168 |
suite ('import a co-mented text page conformity', function () { |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
169 |
test_.page_loading ('/create/import/', 'Import a co-mented text - '+c['#id_workspace_name']); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
170 |
test_logged_header (k.w.USER_ADMIN); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
171 |
test_default_tabs (t.text_nb, t.user_nb); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
172 |
test_.count ('#text ul.sub_list:eq(0) a', 3); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
173 |
test_.text ('#text ul.sub_list:eq(0) a:eq(0)[href="/text/"]', 'Text list'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
174 |
test_.text ('#text ul.sub_list:eq(0) a:eq(1)[href="/create/content/"]', 'Create a text'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
175 |
test_.text ('#text ul.sub_list:eq(0) a:eq(2)[href="/create/upload/"]', 'Upload a text'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
176 |
test_.count ('#text form[action="."]:eq(0) :input', 3); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
177 |
test_.field ('text', 'id_file', 'file', 0, 'Upload XML file', true); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
178 |
test_.val ('#text :input:eq(1)[type=submit]', 'Save'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
179 |
test_.val ('#text :input:eq(2)#cancel_button[type=button]', 'Cancel'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
180 |
test_unlogged_footer (); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
181 |
test_.submit('#text input[type="submit"]'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
182 |
test_.count ('div.help_text span.error-text', 1); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
183 |
test_.field ('text div.error', 'id_file', 'file', 0, 'Upload XML file', true); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
184 |
test_.match ('#text div.help_text:eq(0) span.error-text:eq(0)', /You should specify a file to upload/m); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
185 |
}); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
186 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
187 |
suite ('create texts', function () { |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
188 |
/* 'texts': [ |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
189 |
{ |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
190 |
'#id_title': 'Text One Sopinspace-Test éléguant', |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
191 |
'#id_format': 'markdown', |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
192 |
'#id_content': 'Contenu du premier texte.\nSur plusieurs lignes\nPour tester un cas réaliste', |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
193 |
'#id_tags': 'test_.text, Text Premier' |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
194 |
},*/ |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
195 |
test_.page_loading ('/create/content/', 'Create a text - '+c['#id_workspace_name']); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
196 |
test ('test creation', dsl(function () { |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
197 |
dropdownlist ('#id_format').option (c['texts'][0]['#id_format']); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
198 |
})); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
199 |
test_.fill_field ('#id_title', c['texts'][0]); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
200 |
test_.fill_field ('#id_content', c['texts'][0]); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
201 |
test_.fill_field ('#id_tags', c['texts'][0]); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
202 |
test_.val ('#id_title', 'Text One Sopinspace-Test éléguant'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
203 |
//test_.pause (); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
204 |
//test_.submit ('#save_button'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
205 |
//t.text_nb++; |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
206 |
}); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
207 |
// insert here text creation |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
208 |
// create successively : a markdown text, a html and a rst one |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
209 |
// with tags |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
210 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
211 |
// check that public texts still work while unlogged |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
212 |
// check that non public texts are unavailable |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
213 |
// Are the public texts displayed in the login page ? |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
214 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
215 |
// vérifier les valeurs de settings sauvées |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
216 |
// Tester les liens masqués des textes listés si bien créés |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
217 |
// Tester suppression de text |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
218 |
// Tester bulk actions sur les textes |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
219 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
220 |
// tester l'affichage d'un texte |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
221 |
// tester que : #textcontainer.custom h1 font: Test_Sopinspace_custom_titles_font |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
222 |
// tester que si Text preferences -> custom -> #textcontainer.custom font: Test_Sopinspace_custom_font |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
223 |
// #textcontainer #add_comment_btn span -> #textcontainer font-family: Test_Sopinspace |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
224 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
225 |
suite.skip ('texts list page conformity', function () { |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
226 |
test_.page_loading ('/text/', 'Texts\n - '+c['#id_workspace_name']); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
227 |
test_logged_header (k.w.USER_ADMIN); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
228 |
test_default_tabs (t.text_nb, t.user_nb); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
229 |
test_.count ('#text ul.sub_list:eq(0) a', 3); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
230 |
test_.text ('#text ul.sub_list:eq(0) a:eq(0)[href="/create/content/"]', 'Create a text'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
231 |
test_.text ('#text ul.sub_list:eq(0) a:eq(1)[href="/create/upload/"]', 'Upload a text'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
232 |
test_.text ('#text ul.sub_list:eq(0) a:eq(2)[href="/create/import/"]', 'Import a co-mented text'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
233 |
// TOTEST : filter by tag |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
234 |
test_.count ('form#filter_form[action="."] :input', 1); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
235 |
test_.text ('select#tag_selected option:eq(0)[selected][value="0"]', '- All -', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
236 |
test_.count ('#texts_form :input', 3 + t.text_nb % 10); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
237 |
test_.match ('#paginator', new RegExp ('\\s\\d+-\\d+ of '+t.text_nb+'\\s','m')); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
238 |
// TOTEST : pagination |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
239 |
// TOTEST : Bulk Actions -> Apply does enable |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
240 |
test_.text ('select#bulk_actions option:eq(0)[selected][value="-1"]', 'Bulk Actions', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
241 |
test_.text ('select#bulk_actions option:eq(1)[value="delete"]', 'Delete', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
242 |
test_.val ('form#texts_form input#apply[type=button][disabled]', 'Apply'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
243 |
test_.count ('table.large_table:eq(1) th', 6); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
244 |
test_.val ('table.large_table:eq(1) th:eq(0) input#all_check[type="checkbox"]', 'on'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
245 |
test_.text ('table.large_table:eq(1) th:eq(1) a[href="?order=title"]', 'Text'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
246 |
test_.text ('table.large_table:eq(1) th:eq(2)', 'Author'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
247 |
test_.text ('table.large_table:eq(1) th:eq(3) a[href="?order=-modified"]', 'Modified'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
248 |
test_.text ('table.large_table:eq(1) th:eq(4)', '# comments'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
249 |
test_.text ('table.large_table:eq(1) th:eq(5)', 'Last week activity'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
250 |
test_unlogged_footer (); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
251 |
}); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
252 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
253 |
suite ('edit profile page conformity', function () { |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
254 |
test_.page_loading ('/profile/', 'Your profile [(]'+k.w.USER_ADMIN+'[)]\n - '+c['#id_workspace_name']); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
255 |
test_logged_header (k.w.USER_ADMIN, no_tagline); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
256 |
test_.count ('#content ul.sub_list:eq(0) a', 1); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
257 |
test_.text ('#content ul.sub_list:eq(0) a:eq(0)[href="/profile-pw/"]', 'Password'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
258 |
test_.count ('form#profile[action="."]:eq(0) :input', 5); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
259 |
test_.field ('profile', 'id_email', 'text', 0, 'E-mail address', true); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
260 |
test_.field ('profile', 'id_first_name','text', 1, 'First name'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
261 |
test_.field ('profile', 'id_last_name', 'text', 2, 'Last name'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
262 |
test_.field ('profile', 'id_tags', 'text', 3, 'Tags'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
263 |
test_.val ('#profile :input:eq(4)[type=submit]', 'Save'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
264 |
test_unlogged_footer (); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
265 |
}); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
266 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
267 |
suite ('edit password page conformity', function () { |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
268 |
test_.page_loading ('/profile-pw/', 'Your profile [(]'+k.w.USER_ADMIN+'[)]\n - '+c['#id_workspace_name']); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
269 |
test_logged_header (k.w.USER_ADMIN, no_tagline); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
270 |
test_.count ('#content ul.sub_list:eq(0) a', 1); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
271 |
test_.text ('#content ul.sub_list:eq(0) a:eq(0)[href="/profile/"]', 'Profile'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
272 |
test_.count ('form#profile[action="."]:eq(0) :input', 4); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
273 |
test_.field ('profile', 'id_old_password', 'password', 0, 'Old password', true); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
274 |
test_.field ('profile', 'id_new_password1', 'password', 1, 'New password', true); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
275 |
test_.field ('profile', 'id_new_password2', 'password', 2, 'New password confirmation', true); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
276 |
test_.val ('#profile :input:eq(3)[type=submit]', 'Save'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
277 |
test_unlogged_footer (); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
278 |
}); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
279 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
280 |
suite ('people list page conformity', function () { |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
281 |
test_.page_loading ('/user/', 'People\' list\n - '+c['#id_workspace_name']); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
282 |
test_logged_header (k.w.USER_ADMIN); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
283 |
test_default_tabs (t.text_nb, t.user_nb); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
284 |
test_.count ('#user ul.sub_list:eq(0) a', 2); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
285 |
test_.text ('#user ul.sub_list:eq(0) a:eq(0)[href="/user/add/"]', 'Add a new user'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
286 |
test_.text ('#user ul.sub_list:eq(0) a:eq(1)[href="/user/mass-add/"]', 'Add users in bulk'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
287 |
// TOTEST : filter by tag -> commentator user should be tagged commentator (to change in fixture) |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
288 |
test_.count ('form#filter_form[action="."] :input', 1); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
289 |
test_.text ('#filter_form a[href="?display=1"]', 'Display suspended users'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
290 |
test_.text ('select#tag_selected option:eq(0)[selected][value="0"]', '- All -', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
291 |
// TOTEST : pagination |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
292 |
// TOTEST : Bulk Actions -> Apply does enable |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
293 |
// TOTEST display suspended users |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
294 |
test_.text ('select#bulk_actions option:eq(0)[selected][value="-1"]', '- Bulk Actions -', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
295 |
test_.text ('select#bulk_actions option:eq(1)[value="disable"]', 'Suspend access', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
296 |
test_.text ('select#bulk_actions option:eq(2)[value="enable"]', 'Enable access', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
297 |
test_.text ('select#bulk_actions option:eq(3)[value="role_1"]', 'Change role to Manager', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
298 |
test_.text ('select#bulk_actions option:eq(4)[value="role_2"]', 'Change role to Editor', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
299 |
test_.text ('select#bulk_actions option:eq(5)[value="role_3"]', 'Change role to Moderator', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
300 |
test_.text ('select#bulk_actions option:eq(6)[value="role_4"]', 'Change role to Commentator', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
301 |
test_.text ('select#bulk_actions option:eq(7)[value="role_5"]', 'Change role to Observer', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
302 |
test_.val ('form#user_form input#apply[type=button][disabled]', 'Apply'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
303 |
test_.count ('table.large_table:eq(1) th', 6); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
304 |
test_.val ('table.large_table:eq(1) th:eq(0) input#all_check[type="checkbox"]', 'on'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
305 |
test_.text ('table.large_table:eq(1) th:eq(1) a[href="?order=user__username"]', 'User'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
306 |
test_.text ('table.large_table:eq(1) th:eq(2) a[href="?order=user__email"]', 'Email'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
307 |
test_.text ('table.large_table:eq(1) th:eq(3) a[href="?order=-user__date_joined"]', 'Date joined'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
308 |
test_.text ('table.large_table:eq(1) th:eq(4) a[href="?order=role__name"]', 'Role'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
309 |
test_.text ('table.large_table:eq(1) th:eq(5)', 'Last week activity'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
310 |
test_.text ('table.large_table:eq(1) tr:last a[href="/user/-/edit/"]', 'Anonymous users'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
311 |
test_.text ('table.large_table:eq(1) a.main_object_title[href="/profile/"]', k.w.USER_ADMIN); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
312 |
test_.text ('table.large_table:eq(1) div.hidden-user-actions a[href="/profile/"]', 'Your profile'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
313 |
// TOTEST roles of users |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
314 |
test_unlogged_footer (); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
315 |
}); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
316 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
317 |
suite ('check user number', function () { |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
318 |
test_.page_loading ('/user/?display=1', 'People\' list\n - '+c['#id_workspace_name']); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
319 |
test_.count ('#user_form :input', 6 + (t.user_nb % 10) * 2); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
320 |
test_.match ('#paginator', new RegExp ('\\s\\d+-\\d+ of '+t.user_nb+'\\s','m')); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
321 |
}); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
322 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
323 |
suite ('add a user page conformity', function () { |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
324 |
test_.page_loading ('/user/add/', 'Add a new user\n - '+c['#id_workspace_name']); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
325 |
test_logged_header (k.w.USER_ADMIN); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
326 |
test_default_tabs (t.text_nb, t.user_nb); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
327 |
test_.count ('#user ul.sub_list:eq(0) a', 2); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
328 |
test_.text ('#user ul.sub_list:eq(0) a:eq(0)[href="/user/"]', 'Users\' list'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
329 |
test_.text ('#user ul.sub_list:eq(0) a:eq(1)[href="/user/mass-add/"]', 'Add users in bulk'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
330 |
test_.count ('#user form[action="."]:eq(0) :input', 8); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
331 |
test_.field ('user', 'id_email', 'text', 0, 'E-mail address', true); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
332 |
test_.field ('user', 'id_first_name', 'text', 1, 'First name'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
333 |
test_.field ('user', 'id_last_name', 'text', 2, 'Last name'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
334 |
test_.field ('user', 'id_tags', 'text', 3, 'Tags'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
335 |
test_.field ('user', 'id_role', 'select', 4, 'Workspace level role'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
336 |
test_.field ('user', 'id_note', 'textarea', 5, 'Note'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
337 |
test_.count ('select#id_role option', 6); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
338 |
test_.text ('select#id_role option:eq(0)[value][selected]', '---------', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
339 |
test_.text ('select#id_role option:eq(1)[value="1"]', 'Manager', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
340 |
test_.text ('select#id_role option:eq(2)[value="2"]', 'Editor', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
341 |
test_.text ('select#id_role option:eq(3)[value="3"]', 'Moderator', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
342 |
test_.text ('select#id_role option:eq(4)[value="4"]', 'Commentator', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
343 |
test_.text ('select#id_role option:eq(5)[value="5"]', 'Observer', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
344 |
test_.val ('#user :input:eq(6)[type=submit]', 'Add user'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
345 |
test_.val ('#user :input:eq(7)#cancel_button[type=button]', 'Cancel'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
346 |
test_unlogged_footer (); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
347 |
test_.submit('#user input[type="submit"]'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
348 |
test_.count ('div.help_text span.error-text', 1); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
349 |
test_.field ('user div.error', 'id_email', 'text', 0, 'E-mail address', true); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
350 |
test_.match ('#user div.help_text:eq(0) span.error-text:eq(0)', /This field is required/m); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
351 |
// X TOTEST add user (pending) |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
352 |
}); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
353 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
354 |
suite ('add-users-in-bulk page conformity', function () { |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
355 |
test_.page_loading ('/user/mass-add/', 'Add users in bulk\n - '+c['#id_workspace_name']); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
356 |
test_logged_header (k.w.USER_ADMIN); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
357 |
test_default_tabs (t.text_nb, t.user_nb); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
358 |
test_.count ('#user ul.sub_list:eq(0) a', 2); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
359 |
test_.text ('#user ul.sub_list:eq(0) a:eq(0)[href="/user/"]', 'Users\' list'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
360 |
test_.text ('#user ul.sub_list:eq(0) a:eq(1)[href="/user/add/"]', 'Add a new user'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
361 |
test_.count ('#user form[action="."]:eq(0) :input', 6); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
362 |
test_.field ('user', 'id_email', 'textarea', 0, 'Emails', true); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
363 |
test_.field ('user', 'id_tags', 'text', 1, 'Tags'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
364 |
test_.field ('user', 'id_role', 'select', 2, 'Workspace level role'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
365 |
test_.field ('user', 'id_note', 'textarea', 3, 'Note'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
366 |
test_.count ('select#id_role option', 6); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
367 |
test_.text ('select#id_role option:eq(0)[value][selected]', '---------', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
368 |
test_.text ('select#id_role option:eq(1)[value="1"]', 'Manager', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
369 |
test_.text ('select#id_role option:eq(2)[value="2"]', 'Editor', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
370 |
test_.text ('select#id_role option:eq(3)[value="3"]', 'Moderator', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
371 |
test_.text ('select#id_role option:eq(4)[value="4"]', 'Commentator', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
372 |
test_.text ('select#id_role option:eq(5)[value="5"]', 'Observer', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
373 |
test_.val ('#user :input:eq(4)[type=submit]', 'Add users'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
374 |
test_.val ('#user :input:eq(5)#cancel_button[type=button]', 'Cancel'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
375 |
// X TOTEST add users (pending) -> can't be deleted |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
376 |
test_unlogged_footer (); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
377 |
test_.submit('#user input[type="submit"]'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
378 |
test_.count ('div.help_text span.error-text', 1); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
379 |
test_.field ('user div.error', 'id_email', 'textarea', 0, 'Emails', true); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
380 |
test_.match ('#user div.help_text:eq(0) span.error-text:eq(0)', /This field is required/m); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
381 |
}); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
382 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
383 |
suite ('settings page conformity', function () { |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
384 |
test_.page_loading ('/settings/', 'Settings - '+c['#id_workspace_name']); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
385 |
test_logged_header (k.w.USER_ADMIN); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
386 |
test_default_tabs (t.text_nb, t.user_nb); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
387 |
test_.count ('#settings ul.sub_list:eq(0) a', 1); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
388 |
test_.text ('#settings ul.sub_list:eq(0) a:eq(0)[href="/settings/design/"]', 'Appearance'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
389 |
test_.count ('#settings form[action="."]:eq(0) :input', 12); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
390 |
test_.field ('settings', 'id_workspace_name', 'text', 0, 'Workspace name'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
391 |
test_.field ('settings', 'id_workspace_tagline', 'text', 1, 'Workspace tagline'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
392 |
test_.field ('settings', 'id_workspace_registration', 'checkbox', 2, 'Workspace registration'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
393 |
test_.field ('settings', 'id_workspace_registration_moderation', 'checkbox', 3, 'Workspace registration moderation'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
394 |
test_.field ('settings', 'id_workspace_role_model', 'select', 4, 'Role model'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
395 |
test_.text ('select#id_workspace_role_model option:eq(0)[selected][value="generic"]', 'Generic', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
396 |
test_.text ('select#id_workspace_role_model option:eq(1)[value="teacher"]', 'Class (education)', non_visible); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
397 |
test_.field ('settings', 'id_workspace_category_1', 'text', 5, 'Label for the first category of comments'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
398 |
test_.field ('settings', 'id_workspace_category_2', 'text', 6, 'Label for the second category of comments'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
399 |
test_.field ('settings', 'id_workspace_category_3', 'text', 7, 'Label for the third category of comments'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
400 |
test_.field ('settings', 'id_workspace_category_4', 'text', 8, 'Label for the fourth category of comments'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
401 |
test_.field ('settings', 'id_workspace_category_5', 'text', 9, 'Label for the fifth category of comments'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
402 |
test_.val ('#settings :input:eq(10)[type=submit]', 'Save'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
403 |
test_.val ('#settings :input:eq(11)#cancel_button[type=button]', 'Cancel'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
404 |
// TOTEST Workspace registration feature (with newly accessible page) |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
405 |
test_unlogged_footer (); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
406 |
}); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
407 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
408 |
suite ('settings design page conformity', function () { |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
409 |
test_.page_loading ('/settings/design/', 'Settings - '+c['#id_workspace_name']); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
410 |
test_logged_header (k.w.USER_ADMIN); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
411 |
test_default_tabs (t.text_nb, t.user_nb); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
412 |
test_.count ('#settings ul.sub_list:eq(0) a', 1); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
413 |
test_.text ('#settings ul.sub_list:eq(0) a:eq(0)[href="/settings/"]', 'General'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
414 |
test_.count ('#settings form[action="."]:eq(0) :input', 7); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
415 |
test_.field ('settings', 'id_workspace_logo_file', 'file', 0, 'Workspace logo'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
416 |
test_.field ('settings', 'id_custom_css', 'textarea', 1, 'Custom CSS rules'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
417 |
test_.field ('settings', 'id_custom_font', 'text', 2, 'Custom font'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
418 |
test_.field ('settings', 'id_custom_titles_font', 'text', 3, 'Custom font for titles'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
419 |
test_.val ('#settings :input:eq(4)[type=submit]', 'Save'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
420 |
test_.val ('#settings :input:eq(5)#cancel_button[type=button]', 'Cancel'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
421 |
test_.val ('#settings :input:eq(6)#delete_logo_button[type=submit]', 'Delete logo'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
422 |
test_unlogged_footer (); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
423 |
}); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
424 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
425 |
suite ('followup page conformity', function () { |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
426 |
test_.page_loading ('/followup/', 'Followup\n - '+c['#id_workspace_name']); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
427 |
test_logged_header (k.w.USER_ADMIN); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
428 |
test_default_tabs (t.text_nb, t.user_nb); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
429 |
test_.text ('#followup a:eq(0)[href="/help/#public_private_feed"]', '?'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
430 |
test_.match ('#followup a:eq(1)[href$="/feed/"]', new RegExp (k.w.WORKSPACE_URL+'feed/', 'm')); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
431 |
test_.text ('#followup a:eq(2)[href="/help/#public_private_feed"]', '?'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
432 |
test_.count ('form#followup_form[action="."] :input', 3); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
433 |
test_.val ('form#followup_form input[type=submit]', '(Activate private feed|Reset private feed url)'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
434 |
test_.val ('form#followup_form input#workspace_notify_check[type=checkbox]', 'on'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
435 |
test_.val ('form#followup_form input#own_notify_check[type=checkbox]', 'on'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
436 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
437 |
// X TOTEST qu'une fois cliqué, le bouton a le nvo label, et qu'une adresse est disponible |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
438 |
// X TOTEST que si on reclique l'adresse est changée |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
439 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
440 |
test_unlogged_footer (); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
441 |
}); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
442 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
443 |
}); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
444 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
445 |
function test_default_tabs (text_nb, user_nb) { |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
446 |
test_.count ('#main-tabs a', 5); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
447 |
test_.text ('#main-tabs li:nth-of-type(1) a[href="/"]', 'Dashboard'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
448 |
test_.match ('#main-tabs li:nth-of-type(2) a[href="/text/"]', /^Texts \(\d+\) $/); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
449 |
test_.match ('#main-tabs li:nth-of-type(3) a[href="/user/"]', /^People \(\d+\)$/); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
450 |
test_.text ('#main-tabs li:nth-of-type(4) a[href="/settings/"]', 'Settings'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
451 |
test_.text ('#main-tabs li:nth-of-type(5) a[href="/followup/"]', 'Followup'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
452 |
test_.match ('#main-tabs a[href="/text/"]', new RegExp ('^Texts\\s*\\('+text_nb+'\\)\\s*$')); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
453 |
test_.match ('#main-tabs a[href="/user/"]', new RegExp ('^People\\s*\\('+user_nb+'\\)\\s*$')); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
454 |
} |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
455 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
456 |
function test_logged_header (username, is_tagline) { |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
457 |
is_tagline = typeof is_tagline == 'undefined' ? true : is_tagline; |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
458 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
459 |
test_.text ('#header_controls b', username) |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
460 |
test_.count ('#header_controls a', 6); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
461 |
test_.text ('#header_controls a:nth-of-type(1)[href="/"]', 'Home'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
462 |
test_.text ('#header_controls a:nth-of-type(2)[href="/create/content/"]', 'Create a text'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
463 |
test_.text ('#header_controls a:nth-of-type(3)[href="/create/upload/"]', 'Upload a text'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
464 |
test_.text ('#header_controls a:nth-of-type(4)[href="/create/import/"]', 'Import a co-mented text'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
465 |
test_.text ('#header_controls a:nth-of-type(5)[href="/profile/"]', 'Profile'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
466 |
test_.text ('#header_controls a:nth-of-type(6)[href="/logout/"]', 'Logout'); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
467 |
test_.text ('#content h1.main_title a[href="/"]', c['#id_workspace_name']); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
468 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
469 |
if (is_tagline) { |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
470 |
test_.match ('#content h1.main_title + div', new RegExp (c['#id_workspace_tagline'], 'm')); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
471 |
} |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
472 |
} |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
473 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
474 |
function test_fill_settings (s) { |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
475 |
test_.fill_field ('#id_workspace_name', s); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
476 |
test_.fill_field ('#id_workspace_tagline', s); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
477 |
test_.fill_field ('#id_workspace_registration', s); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
478 |
test_.fill_field ('#id_workspace_registration_moderation', s); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
479 |
test_.fill_field ('#id_workspace_role_model', s); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
480 |
test_.fill_field ('#id_workspace_category_1', s); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
481 |
test_.fill_field ('#id_workspace_category_2', s); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
482 |
test_.fill_field ('#id_workspace_category_3', s); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
483 |
test_.fill_field ('#id_workspace_category_4', s); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
484 |
test_.fill_field ('#id_workspace_category_5', s); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
485 |
} |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
486 |
|
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
487 |
function test_fill_design (s) { |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
488 |
test_.fill_field ('#id_custom_css', s); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
489 |
test_.fill_field ('#id_custom_font', s); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
490 |
test_.fill_field ('#id_custom_titles_font', s); |
|
3dd70d01cec2
Divide tests.js in two distinct files, factorize helper functions in lib/test_hlp.js
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
491 |
} |