| author | Simon Descarpentries <sid@sopinspace.com> |
| Wed, 12 Mar 2014 18:33:06 +0100 | |
| changeset 612 | 2bed79bde721 |
| parent 598 | fd0507590413 |
| child 613 | a0b695aace0a |
| permissions | -rw-r--r-- |
|
577
65fab7b5ce5e
Add 1st tests of login page congruency
Simon Descarpentries <sid@sopinspace.com>
parents:
575
diff
changeset
|
1 |
|
|
598
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
2 |
// " Vim settings |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
3 |
// set tabstop=4 " number of spaces in a tab |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
4 |
// set softtabstop=4 " as above |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
5 |
// set shiftwidth=4 " as above |
|
577
65fab7b5ce5e
Add 1st tests of login page congruency
Simon Descarpentries <sid@sopinspace.com>
parents:
575
diff
changeset
|
6 |
|
|
65fab7b5ce5e
Add 1st tests of login page congruency
Simon Descarpentries <sid@sopinspace.com>
parents:
575
diff
changeset
|
7 |
|
|
65fab7b5ce5e
Add 1st tests of login page congruency
Simon Descarpentries <sid@sopinspace.com>
parents:
575
diff
changeset
|
8 |
// check that public texts still work while unlogged |
|
578
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
9 |
// check that non public texts are unavailable |
|
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
10 |
// Are the public texts displayed in the login page ? |
|
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
11 |
|
|
594
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
12 |
var w = __karma__.config.w, |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
13 |
z = {}; |
|
598
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
14 |
const non_visible = false, no_tagline = false; |
|
594
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
15 |
const t = { |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
16 |
'#id_workspace_name': 'Test workspace name', |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
17 |
'#id_workspace_tagline': 'Test workspace tagline', |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
18 |
'#id_workspace_registration': 'on', // registration |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
19 |
'#id_workspace_registration_moderation': 'on', // registration moderation |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
20 |
'#id_workspace_role_model': 'generic', |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
21 |
'#id_workspace_category_1': 'ws_cat_1', |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
22 |
'#id_workspace_category_2': 'ws_cat_2', |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
23 |
'#id_workspace_category_3': 'ws_cat_3', |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
24 |
'#id_workspace_category_4': 'ws_cat_4', |
|
598
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
25 |
'#id_workspace_category_5': 'ws_cat_5', |
|
612
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
26 |
'#id_custom_css': "h2 { font-family: Test_Sopinspace !important; }", |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
27 |
'#id_custom_font': 'Test_Sopinspace_custom_font', |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
28 |
'#id_custom_titles_font': 'Test_Sopinspace_custom_titles_font', |
|
594
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
29 |
}; |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
30 |
|
|
578
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
31 |
|
|
579
869f02c75687
daily progress : suite/test style, config from single config file, attempt to test i18n in footer
Simon Descarpentries <sid@sopinspace.com>
parents:
578
diff
changeset
|
32 |
suite ('comt', function () { |
|
575
8ce80860c3fe
Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
33 |
|
|
8ce80860c3fe
Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
34 |
this.timeout(150000); |
|
8ce80860c3fe
Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
35 |
|
|
598
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
36 |
suite ('contact page conformity', function () { |
|
579
869f02c75687
daily progress : suite/test style, config from single config file, attempt to test i18n in footer
Simon Descarpentries <sid@sopinspace.com>
parents:
578
diff
changeset
|
37 |
test_page_loading ('/contact/', 'Contact'); |
|
869f02c75687
daily progress : suite/test style, config from single config file, attempt to test i18n in footer
Simon Descarpentries <sid@sopinspace.com>
parents:
578
diff
changeset
|
38 |
test_unlogged_header (); |
|
583
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
39 |
test_val ('form#profile[action="."]'); // the form exists |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
40 |
test_count ('form#profile :input', 7); // it has no more than 5 labels (may be no more fields) |
|
582
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
41 |
test_form_field ('profile', 'id_name', 'text', 0, 'Your name', true); // the field id_name is… |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
42 |
test_form_field ('profile', 'id_email', 'text', 1, 'Your email address', true); |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
43 |
test_form_field ('profile', 'id_title', 'text', 2, 'Subject of the message', true); |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
44 |
test_form_field ('profile', 'id_body', 'textarea', 3, 'Body of the message', true); |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
45 |
test_form_field ('profile', 'id_copy', 'checkbox', 4, 'Send me a copy of the email', false); |
|
583
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
46 |
test_val ('#profile input[type=submit]','Send'); // test that a the .val() of the element is |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
47 |
test_val ('input#cancel_button[type=button]', 'Cancel'); |
|
581
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
48 |
test_unlogged_footer (); |
|
583
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
49 |
test ('to check that toBeDefined test still works', dsl(function () { |
|
581
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
50 |
expect (elt ('#header_controls a[href="/xxx/"]').val ()).not ().toBeDefined (); |
|
577
65fab7b5ce5e
Add 1st tests of login page congruency
Simon Descarpentries <sid@sopinspace.com>
parents:
575
diff
changeset
|
51 |
})); |
|
583
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
52 |
test ('get back to / to avoid bugging next page load', dsl(function () { |
|
579
869f02c75687
daily progress : suite/test style, config from single config file, attempt to test i18n in footer
Simon Descarpentries <sid@sopinspace.com>
parents:
578
diff
changeset
|
53 |
browser.navigateTo ('/'); |
|
869f02c75687
daily progress : suite/test style, config from single config file, attempt to test i18n in footer
Simon Descarpentries <sid@sopinspace.com>
parents:
578
diff
changeset
|
54 |
})); |
|
578
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
55 |
}); |
|
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
56 |
|
|
598
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
57 |
suite ('help page conformity', function () { |
|
579
869f02c75687
daily progress : suite/test style, config from single config file, attempt to test i18n in footer
Simon Descarpentries <sid@sopinspace.com>
parents:
578
diff
changeset
|
58 |
test_page_loading ('/help/', 'Help'); |
|
869f02c75687
daily progress : suite/test style, config from single config file, attempt to test i18n in footer
Simon Descarpentries <sid@sopinspace.com>
parents:
578
diff
changeset
|
59 |
test_unlogged_header (); |
|
869f02c75687
daily progress : suite/test style, config from single config file, attempt to test i18n in footer
Simon Descarpentries <sid@sopinspace.com>
parents:
578
diff
changeset
|
60 |
test_unlogged_footer (); |
|
869f02c75687
daily progress : suite/test style, config from single config file, attempt to test i18n in footer
Simon Descarpentries <sid@sopinspace.com>
parents:
578
diff
changeset
|
61 |
}); |
|
578
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
62 |
|
|
612
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
63 |
suite ('contact page mandatory field test', function () { |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
64 |
test_page_loading ('/contact/', 'Contact'); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
65 |
|
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
66 |
test ('submit empty fields', dsl(function () { |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
67 |
elt ('#profile input[type="submit"]').click (); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
68 |
browser.waitForPageLoad (); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
69 |
})); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
70 |
test_count ('div.help_text span.error-text', 4); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
71 |
test_form_field ('profile div.error', 'id_name', 'text', 0, 'Your name', true); // the field id_name is… |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
72 |
test_form_field ('profile div.error', 'id_email', 'text', 1, 'Your email address', true); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
73 |
test_form_field ('profile div.error', 'id_title', 'text', 2, 'Subject of the message', true); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
74 |
test_form_field ('profile div.error', 'id_body', 'textarea', 3, 'Body of the message', true); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
75 |
test_form_field ('profile', 'id_copy', 'checkbox', 4, 'Send me a copy of the email', false); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
76 |
}); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
77 |
|
|
598
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
78 |
suite ('reset password page conformity', function () { |
|
579
869f02c75687
daily progress : suite/test style, config from single config file, attempt to test i18n in footer
Simon Descarpentries <sid@sopinspace.com>
parents:
578
diff
changeset
|
79 |
test_page_loading ('/password_reset/', 'Reset my password'); |
|
869f02c75687
daily progress : suite/test style, config from single config file, attempt to test i18n in footer
Simon Descarpentries <sid@sopinspace.com>
parents:
578
diff
changeset
|
80 |
test_unlogged_header (); |
|
583
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
81 |
test_val ('form#profile[action="."]'); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
82 |
test_count ('form#profile :input', 3); |
|
582
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
83 |
test_form_field ('profile', 'id_email', 'text', 1, 'E-mail', true); |
|
583
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
84 |
test_val ('#profile input[type=submit]', 'Reset my password'); |
|
579
869f02c75687
daily progress : suite/test style, config from single config file, attempt to test i18n in footer
Simon Descarpentries <sid@sopinspace.com>
parents:
578
diff
changeset
|
85 |
test_unlogged_footer (); |
|
612
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
86 |
|
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
87 |
test ('submit empty fields', dsl(function () { |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
88 |
elt ('#profile input[type="submit"]').click (); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
89 |
browser.waitForPageLoad (); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
90 |
})); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
91 |
|
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
92 |
test_count ('div.help_text span.error-text', 1); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
93 |
test_form_field ('profile div.error', 'id_email', 'text', 0, 'E-mail', true); |
|
578
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
94 |
}); |
|
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
95 |
|
|
598
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
96 |
suite ('login page conformity', function () { |
|
579
869f02c75687
daily progress : suite/test style, config from single config file, attempt to test i18n in footer
Simon Descarpentries <sid@sopinspace.com>
parents:
578
diff
changeset
|
97 |
test_page_loading ('/', 'Home'); |
|
869f02c75687
daily progress : suite/test style, config from single config file, attempt to test i18n in footer
Simon Descarpentries <sid@sopinspace.com>
parents:
578
diff
changeset
|
98 |
test_unlogged_header (); |
|
583
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
99 |
test_val ('form#login[action="/login/"]'); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
100 |
test_count ('form#login[action="/login/"] :input', 3); |
|
582
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
101 |
test_form_field ('login', 'id_username', 'text', 0, 'Username', true); |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
102 |
test_form_field ('login', 'id_password', 'password', 1, 'Password', true); |
|
612
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
103 |
test_val ('form#login input[type=submit]', 'Login'); |
|
583
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
104 |
test_text ('form#login a[href="/password_reset/"]', 'Forgot password?'); |
|
579
869f02c75687
daily progress : suite/test style, config from single config file, attempt to test i18n in footer
Simon Descarpentries <sid@sopinspace.com>
parents:
578
diff
changeset
|
105 |
test_unlogged_footer (); |
|
581
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
106 |
// test_i18n (); |
|
612
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
107 |
|
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
108 |
test ('get back to / to avoid bugging next page load', dsl(function () { |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
109 |
browser.navigateTo ('/'); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
110 |
})); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
111 |
test_page_loading ('/login/', 'Login'); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
112 |
test ('submit empty fields', dsl(function () { |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
113 |
elt ('#login input[type="submit"]').click (); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
114 |
browser.waitForPageLoad (); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
115 |
})); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
116 |
test_form_field ('login div.error', 'id_username', 'text', 0, 'Username', true); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
117 |
test_form_field ('login div.error', 'id_password', 'password', 1, 'Password', true); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
118 |
test ('logs an admin in', dsl(function () { |
|
579
869f02c75687
daily progress : suite/test style, config from single config file, attempt to test i18n in footer
Simon Descarpentries <sid@sopinspace.com>
parents:
578
diff
changeset
|
119 |
input ('#id_username').enter (w.USER_ADMIN); |
|
869f02c75687
daily progress : suite/test style, config from single config file, attempt to test i18n in footer
Simon Descarpentries <sid@sopinspace.com>
parents:
578
diff
changeset
|
120 |
input ('#id_password').enter (w.PASS_ADMIN); |
|
578
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
121 |
elt ('#login input[type=submit]').click (); |
|
579
869f02c75687
daily progress : suite/test style, config from single config file, attempt to test i18n in footer
Simon Descarpentries <sid@sopinspace.com>
parents:
578
diff
changeset
|
122 |
// Must be done here in this test() block |
|
578
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
123 |
browser.waitForPageLoad (); |
|
575
8ce80860c3fe
Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
124 |
browser.navigateTo ('/'); |
|
577
65fab7b5ce5e
Add 1st tests of login page congruency
Simon Descarpentries <sid@sopinspace.com>
parents:
575
diff
changeset
|
125 |
expect (element ('title').text ()).toMatch (/Dashboard/m); |
|
575
8ce80860c3fe
Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
126 |
})); |
|
8ce80860c3fe
Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
127 |
}); |
|
578
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
128 |
|
|
598
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
129 |
suite ('reading settings', function () { |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
130 |
test_page_loading ('/settings/', 'Settings'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
131 |
test_readz_field ('#id_workspace_name'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
132 |
test_readz_field ('#id_workspace_tagline'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
133 |
test_readz_field ('#id_workspace_registration'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
134 |
test_readz_field ('#id_workspace_registration_moderation'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
135 |
test_readz_field ('#id_workspace_role_model'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
136 |
test_readz_field ('#id_workspace_category_1'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
137 |
test_readz_field ('#id_workspace_category_2'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
138 |
test_readz_field ('#id_workspace_category_3'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
139 |
test_readz_field ('#id_workspace_category_4'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
140 |
test_readz_field ('#id_workspace_category_5'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
141 |
test_page_loading ('/settings/design/', 'Settings'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
142 |
test_readz_field ('#id_custom_css'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
143 |
test_readz_field ('#id_custom_font'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
144 |
test_readz_field ('#id_custom_titles_font'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
145 |
/*test ('display z', dsl(function () { |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
146 |
elt ('#main-tabs').text (function (t) { |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
147 |
console.log ('z '+JSON.stringify(z)); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
148 |
}); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
149 |
}));*/ |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
150 |
}); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
151 |
|
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
152 |
suite ('setting settings to test values', function () { |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
153 |
test_page_loading ('/settings/', 'Settings'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
154 |
test_fill_settings (t); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
155 |
test_val ('#id_workspace_name', t['#id_workspace_name']); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
156 |
test ('Save test settings ', dsl (function () { |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
157 |
elt ('#settings input[type="submit"]').click (); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
158 |
browser.waitForPageLoad (); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
159 |
})); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
160 |
test_page_loading ('/settings/', 'Settings'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
161 |
test_text ('#content h1.main_title a[href="/"]', t['#id_workspace_name']); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
162 |
test_page_loading ('/settings/design/', 'Settings'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
163 |
test_fill_design (t); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
164 |
test ('Save test design settings ', dsl (function () { |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
165 |
elt ('#settings input[type="submit"]').click (); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
166 |
browser.waitForPageLoad (); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
167 |
})); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
168 |
}); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
169 |
|
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
170 |
suite ('admin dashboard page conformity', function () { |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
171 |
test_page_loading ('/', 'Dashboard\n - '+t['#id_workspace_name']); |
|
579
869f02c75687
daily progress : suite/test style, config from single config file, attempt to test i18n in footer
Simon Descarpentries <sid@sopinspace.com>
parents:
578
diff
changeset
|
172 |
test_logged_header (w.USER_ADMIN); |
|
583
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
173 |
test ('get text and user nb', dsl(function () { |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
174 |
element ('span.metadata:eq(0)').text (function (metadata) { |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
175 |
var r = metadata.match (/(\d+) texts, (\d+) users/); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
176 |
if (r.length != 3) throw 'expected 3 matches got '+r.length; |
|
594
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
177 |
z.text_nb = r[1]; |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
178 |
z.user_nb = r[2]; |
|
583
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
179 |
}); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
180 |
})); |
|
581
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
181 |
test_default_tabs (); |
|
582
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
182 |
test_count ('table.dash_table', 5); |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
183 |
test_text ('table.dash_table th:eq(0)', 'Actions'); |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
184 |
test_match ('table.dash_table:eq(0) a:eq(0)[href="/create/content/"]', /\sCreate a text/); |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
185 |
test_text ('table.dash_table:eq(0) a:eq(1).tip[href="#"]', ' '); |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
186 |
test_match ('table.dash_table:eq(0) a:eq(2)[href="/create/upload/"]', /\sUpload a text/); |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
187 |
test_text ('table.dash_table:eq(0) a:eq(3).tip[href="#"]', ' '); |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
188 |
test_match ('table.dash_table:eq(0) a:eq(4)[href="/create/import/"]', /\sImport a co-mented text/); |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
189 |
test_text ('table.dash_table:eq(0) a:eq(5).tip[href="#"]', ' '); |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
190 |
test_match ('table.dash_table:eq(0) a:eq(6)[href="/user/add/"]', /\sInvite user/); |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
191 |
test_match ('table.dash_table:eq(0) a:eq(7)[href="/profile/"]', /\sEdit your profile/); |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
192 |
test_match ('table.dash_table:eq(0) a:eq(8)[href="/text/"]', /\sView text list/); |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
193 |
test_match ('table.dash_table:eq(0) a:eq(9)[href="/settings/"]', /\sConfigure workspace/); |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
194 |
test_text ('table.dash_table th:eq(1)', 'Recent texts (all)'); |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
195 |
test_text ('table.dash_table:eq(1) a:eq(0)[href="/text/"]', 'all'); |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
196 |
test_text ('table.dash_table th:eq(2)', 'Recent comments'); |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
197 |
test_match ('table.dash_table th:eq(3)', /^Workspace activity\n\s+\(month\/week\/24 hours\)$/m); |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
198 |
test_text ('table.dash_table:eq(3) a:eq(0)[href="?span=month"]', 'month'); |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
199 |
test_text ('table.dash_table:eq(3) a:eq(1)[href="?span=day"]', '24 hours'); |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
200 |
test_text ('table.dash_table th:eq(4) span.em', 'Activities'); |
|
579
869f02c75687
daily progress : suite/test style, config from single config file, attempt to test i18n in footer
Simon Descarpentries <sid@sopinspace.com>
parents:
578
diff
changeset
|
201 |
test_unlogged_footer (); |
|
578
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
202 |
}); |
|
582
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
203 |
|
|
598
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
204 |
suite ('texts list page conformity', function () { |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
205 |
test_page_loading ('/text/', 'Texts\n - '+t['#id_workspace_name']); |
|
594
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
206 |
test_logged_header (w.USER_ADMIN); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
207 |
test_default_tabs (); |
|
583
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
208 |
test_count ('#text ul.sub_list:eq(0) a', 3); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
209 |
test_text ('#text ul.sub_list:eq(0) a:eq(0)[href="/create/content/"]', 'Create a text'); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
210 |
test_text ('#text ul.sub_list:eq(0) a:eq(1)[href="/create/upload/"]', 'Upload a text'); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
211 |
test_text ('#text ul.sub_list:eq(0) a:eq(2)[href="/create/import/"]', 'Import a co-mented text'); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
212 |
// TOTEST : filter by tag |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
213 |
test_count ('form#filter_form[action="."] :input', 1); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
214 |
test_text ('select#tag_selected option:eq(0)[selected][value="0"]', '- All -', non_visible); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
215 |
test ('#texts_form input count', dsl (function () { |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
216 |
elt ('form#texts_form[action="."] :input').count (function (c) { |
|
594
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
217 |
var n = 3 + z.text_nb % 10; |
|
583
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
218 |
if (c != n) throw 'expected computed '+n+' to equal got '+c; |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
219 |
}); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
220 |
})); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
221 |
test ('#paginator "of #" value', dsl (function () { |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
222 |
elt ('span#paginator').text (function (t) { |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
223 |
var r = t.match (/\s\d+-\d+ of (\d+)\s/m); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
224 |
if (r.length != 2) throw 'expected 2 matches got '+r.length; |
|
594
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
225 |
if (r[1] != z.text_nb) throw 'expected paginator total ('+r[1]+') to be '+z.text_nb; |
|
583
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
226 |
}); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
227 |
})); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
228 |
// TOTEST : pagination |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
229 |
// TOTEST : Bulk Actions -> Apply does enable |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
230 |
test_text ('select#bulk_actions option:eq(0)[selected][value="-1"]', 'Bulk Actions', non_visible); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
231 |
test_text ('select#bulk_actions option:eq(1)[value="delete"]', 'Delete', non_visible); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
232 |
test_val ('form#texts_form input#apply[type=button][disabled]', 'Apply'); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
233 |
test_count ('table.large_table:eq(1) th', 6); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
234 |
test_val ('table.large_table:eq(1) th:eq(0) input#all_check[type="checkbox"]', 'on'); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
235 |
test_text ('table.large_table:eq(1) th:eq(1) a[href="?order=title"]', 'Text'); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
236 |
test_text ('table.large_table:eq(1) th:eq(2)', 'Author'); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
237 |
test_text ('table.large_table:eq(1) th:eq(3) a[href="?order=-modified"]', 'Modified'); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
238 |
test_text ('table.large_table:eq(1) th:eq(4)', '# comments'); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
239 |
test_text ('table.large_table:eq(1) th:eq(5)', 'Last week activity'); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
240 |
test_unlogged_footer (); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
241 |
}); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
242 |
|
|
598
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
243 |
suite ('create a text page conformity', function () { |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
244 |
test_page_loading ('/create/content/', 'Create a text - '+t['#id_workspace_name']); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
245 |
test_logged_header (w.USER_ADMIN); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
246 |
test_default_tabs (); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
247 |
test_count ('#text ul.sub_list:eq(0) a', 3); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
248 |
test_text ('#text ul.sub_list:eq(0) a:eq(0)[href="/text/"]', 'Text list'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
249 |
test_text ('#text ul.sub_list:eq(0) a:eq(1)[href="/create/upload/"]', 'Upload a text'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
250 |
test_text ('#text ul.sub_list:eq(0) a:eq(2)[href="/create/import/"]', 'Import a co-mented text'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
251 |
test_count ('#text form[action="."]:eq(0) :input', 6); |
|
612
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
252 |
test_form_field ('text', 'id_title', 'text', 0, 'Title', true); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
253 |
test_form_field ('text', 'id_format', 'select', 1, 'Format', true); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
254 |
test_form_field ('text', 'id_content', 'textarea', 2, 'Content', true); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
255 |
test_form_field ('text', 'id_tags', 'text', 3, 'Tags'); |
|
598
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
256 |
test_val ('#text :input:eq(4)[type=submit]', 'Save'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
257 |
test_val ('#text :input:eq(5)#cancel_button[type=button]', 'Cancel'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
258 |
test_count ('select#id_format option', 3); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
259 |
test_text ('select#id_format option:eq(0)[value="markdown"][selected]', 'markdown', non_visible); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
260 |
test_text ('select#id_format option:eq(1)[value="rst"]', 'rst', non_visible); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
261 |
test_text ('select#id_format option:eq(2)[value="html"]', 'html', non_visible); |
|
612
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
262 |
test_count ('#markItUpId_content li', 20); // How many buttons are in the WYSIWYG editor toolbar ? |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
263 |
test ('submit empty fields', dsl(function () { |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
264 |
elt ('#text input[type="submit"]').click (); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
265 |
browser.waitForPageLoad (); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
266 |
})); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
267 |
test_count ('div.help_text span.error-text', 2); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
268 |
test_form_field ('text div.error', 'id_title', 'text', 0, 'Title', true); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
269 |
test_form_field ('text div.error', 'id_content', 'textarea', 2, 'Content', true); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
270 |
|
|
598
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
271 |
test_unlogged_footer (); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
272 |
}); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
273 |
|
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
274 |
suite ('upload text page conformity', function () { |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
275 |
test_page_loading ('/create/upload/', 'Upload a text - '+t['#id_workspace_name']); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
276 |
test_logged_header (w.USER_ADMIN); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
277 |
test_default_tabs (); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
278 |
test_count ('#text ul.sub_list:eq(0) a', 3); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
279 |
test_text ('#text ul.sub_list:eq(0) a:eq(0)[href="/text/"]', 'Text list'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
280 |
test_text ('#text ul.sub_list:eq(0) a:eq(1)[href="/create/content/"]', 'Create a text'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
281 |
test_text ('#text ul.sub_list:eq(0) a:eq(2)[href="/create/import/"]', 'Import a co-mented text'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
282 |
test_count ('#text form[action="."]:eq(0) :input', 6); |
|
612
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
283 |
test_form_field ('text', 'id_title', 'text', 0, 'Title'); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
284 |
test_form_field ('text', 'id_format', 'select', 1, 'Format', true); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
285 |
test_form_field ('text', 'id_tags', 'text', 2, 'Tags'); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
286 |
test_form_field ('text', 'id_file', 'file', 3, 'Upload file (optional)'); |
|
598
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
287 |
test_val ('#text :input:eq(4)[type=submit]', 'Save'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
288 |
test_val ('#text :input:eq(5)#cancel_button[type=button]', 'Cancel'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
289 |
test_count ('select#id_format option', 3); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
290 |
test_text ('select#id_format option:eq(0)[value="markdown"][selected]', 'markdown', non_visible); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
291 |
test_text ('select#id_format option:eq(1)[value="rst"]', 'rst', non_visible); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
292 |
test_text ('select#id_format option:eq(2)[value="html"]', 'html', non_visible); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
293 |
test_unlogged_footer (); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
294 |
}); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
295 |
|
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
296 |
suite ('import a co-mented text page conformity', function () { |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
297 |
test_page_loading ('/create/import/', 'Import a co-mented text - '+t['#id_workspace_name']); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
298 |
test_logged_header (w.USER_ADMIN); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
299 |
test_default_tabs (); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
300 |
test_count ('#text ul.sub_list:eq(0) a', 3); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
301 |
test_text ('#text ul.sub_list:eq(0) a:eq(0)[href="/text/"]', 'Text list'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
302 |
test_text ('#text ul.sub_list:eq(0) a:eq(1)[href="/create/content/"]', 'Create a text'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
303 |
test_text ('#text ul.sub_list:eq(0) a:eq(2)[href="/create/upload/"]', 'Upload a text'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
304 |
test_count ('#text form[action="."]:eq(0) :input', 3); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
305 |
test_form_field ('text', 'id_file', 'file', 0, 'Upload XML file', true); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
306 |
test_val ('#text :input:eq(1)[type=submit]', 'Save'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
307 |
test_val ('#text :input:eq(2)#cancel_button[type=button]', 'Cancel'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
308 |
test_unlogged_footer (); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
309 |
}); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
310 |
|
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
311 |
suite ('edit profile page conformity', function () { |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
312 |
test_page_loading ('/profile/', 'Your profile [(]'+w.USER_ADMIN+'[)]\n - '+t['#id_workspace_name']); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
313 |
test_logged_header (w.USER_ADMIN, no_tagline); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
314 |
test_count ('#content ul.sub_list:eq(0) a', 1); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
315 |
test_text ('#content ul.sub_list:eq(0) a:eq(0)[href="/profile-pw/"]', 'Password'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
316 |
test_count ('form#profile[action="."]:eq(0) :input', 5); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
317 |
test_form_field ('profile', 'id_email', 'text', 0, 'E-mail address', true); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
318 |
test_form_field ('profile', 'id_first_name','text', 1, 'First name'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
319 |
test_form_field ('profile', 'id_last_name', 'text', 2, 'Last name'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
320 |
test_form_field ('profile', 'id_tags', 'text', 3, 'Tags'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
321 |
test_val ('#profile :input:eq(4)[type=submit]', 'Save'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
322 |
test_unlogged_footer (); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
323 |
}); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
324 |
|
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
325 |
suite ('edit password page conformity', function () { |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
326 |
test_page_loading ('/profile-pw/', 'Your profile [(]'+w.USER_ADMIN+'[)]\n - '+t['#id_workspace_name']); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
327 |
test_logged_header (w.USER_ADMIN, no_tagline); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
328 |
test_count ('#content ul.sub_list:eq(0) a', 1); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
329 |
test_text ('#content ul.sub_list:eq(0) a:eq(0)[href="/profile/"]', 'Profile'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
330 |
test_count ('form#profile[action="."]:eq(0) :input', 4); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
331 |
test_form_field ('profile', 'id_old_password', 'password', 0, 'Old password', true); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
332 |
test_form_field ('profile', 'id_new_password1', 'password', 1, 'New password', true); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
333 |
test_form_field ('profile', 'id_new_password2', 'password', 2, 'New password confirmation', true); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
334 |
test_val ('#profile :input:eq(3)[type=submit]', 'Save'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
335 |
test_unlogged_footer (); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
336 |
}); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
337 |
|
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
338 |
suite ('people list page conformity', function () { |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
339 |
test_page_loading ('/user/', 'People\' list\n - '+t['#id_workspace_name']); |
|
594
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
340 |
test_logged_header (w.USER_ADMIN); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
341 |
test_default_tabs (); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
342 |
test_count ('#user ul.sub_list:eq(0) a', 2); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
343 |
test_text ('#user ul.sub_list:eq(0) a:eq(0)[href="/user/add/"]', 'Add a new user'); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
344 |
test_text ('#user ul.sub_list:eq(0) a:eq(1)[href="/user/mass-add/"]', 'Add users in bulk'); |
|
612
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
345 |
// TOTEST : filter by tag -> commentator user should be tagged commentator |
|
594
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
346 |
test_count ('form#filter_form[action="."] :input', 1); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
347 |
test_text ('#filter_form a[href="?display=1"]', 'Display suspended users'); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
348 |
test_text ('select#tag_selected option:eq(0)[selected][value="0"]', '- All -', non_visible); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
349 |
// TOTEST : pagination |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
350 |
// TOTEST : Bulk Actions -> Apply does enable |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
351 |
test_text ('select#bulk_actions option:eq(0)[selected][value="-1"]', '- Bulk Actions -', non_visible); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
352 |
test_text ('select#bulk_actions option:eq(1)[value="disable"]', 'Suspend access', non_visible); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
353 |
test_text ('select#bulk_actions option:eq(2)[value="enable"]', 'Enable access', non_visible); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
354 |
test_text ('select#bulk_actions option:eq(3)[value="role_1"]', 'Change role to Manager', non_visible); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
355 |
test_text ('select#bulk_actions option:eq(4)[value="role_2"]', 'Change role to Editor', non_visible); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
356 |
test_text ('select#bulk_actions option:eq(5)[value="role_3"]', 'Change role to Moderator', non_visible); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
357 |
test_text ('select#bulk_actions option:eq(6)[value="role_4"]', 'Change role to Commentator', non_visible); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
358 |
test_text ('select#bulk_actions option:eq(7)[value="role_5"]', 'Change role to Observer', non_visible); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
359 |
test_val ('form#user_form input#apply[type=button][disabled]', 'Apply'); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
360 |
test_count ('table.large_table:eq(1) th', 6); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
361 |
test_val ('table.large_table:eq(1) th:eq(0) input#all_check[type="checkbox"]', 'on'); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
362 |
test_text ('table.large_table:eq(1) th:eq(1) a[href="?order=user__username"]', 'User'); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
363 |
test_text ('table.large_table:eq(1) th:eq(2) a[href="?order=user__email"]', 'Email'); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
364 |
test_text ('table.large_table:eq(1) th:eq(3) a[href="?order=-user__date_joined"]', 'Date joined'); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
365 |
test_text ('table.large_table:eq(1) th:eq(4) a[href="?order=role__name"]', 'Role'); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
366 |
test_text ('table.large_table:eq(1) th:eq(5)', 'Last week activity'); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
367 |
test_text ('table.large_table:eq(1) tr:last a[href="/user/-/edit/"]', 'Anonymous users'); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
368 |
test_text ('table.large_table:eq(1) a.main_object_title[href="/profile/"]', w.USER_ADMIN); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
369 |
test_text ('table.large_table:eq(1) div.hidden-user-actions a[href="/profile/"]', 'Your profile'); |
|
612
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
370 |
// TOTEST presence of commentator and editor user |
|
594
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
371 |
test_unlogged_footer (); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
372 |
}); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
373 |
|
|
598
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
374 |
suite ('check user number', function () { |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
375 |
test_page_loading ('/user/?display=1', 'People\' list\n - '+t['#id_workspace_name']); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
376 |
test ('#user_form input count', dsl (function () { |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
377 |
elt ('form#user_form[action="."] :input').count (function (c) { |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
378 |
var n = 6 + (z.user_nb % 10) * 2; |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
379 |
if (c != n) throw 'expected computed '+n+' to equal got '+c; |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
380 |
}); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
381 |
})); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
382 |
test ('#paginator "of #" value', dsl (function () { |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
383 |
elt ('span#paginator').text (function (t) { |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
384 |
var r = t.match (/\s\d+-\d+ of (\d+)\s/m); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
385 |
if (r.length != 2) throw 'expected 2 matches got '+r.length; |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
386 |
if (r[1] != z.user_nb) throw 'expected paginator total ('+r[1]+') to be '+z.user_nb; |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
387 |
}); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
388 |
})); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
389 |
}); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
390 |
|
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
391 |
suite ('add a user page conformity', function () { |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
392 |
test_page_loading ('/user/add/', 'Add a new user\n - '+t['#id_workspace_name']); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
393 |
test_logged_header (w.USER_ADMIN); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
394 |
test_default_tabs (); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
395 |
test_count ('#user ul.sub_list:eq(0) a', 2); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
396 |
test_text ('#user ul.sub_list:eq(0) a:eq(0)[href="/user/"]', 'Users\' list'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
397 |
test_text ('#user ul.sub_list:eq(0) a:eq(1)[href="/user/mass-add/"]', 'Add users in bulk'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
398 |
test_count ('#user form[action="."]:eq(0) :input', 8); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
399 |
test_form_field ('user', 'id_email', 'text', 0, 'E-mail address', true); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
400 |
test_form_field ('user', 'id_first_name', 'text', 1, 'First name'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
401 |
test_form_field ('user', 'id_last_name', 'text', 2, 'Last name'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
402 |
test_form_field ('user', 'id_tags', 'text', 3, 'Tags'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
403 |
test_form_field ('user', 'id_role', 'select', 4, 'Workspace level role'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
404 |
test_form_field ('user', 'id_note', 'textarea', 5, 'Note'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
405 |
test_count ('select#id_role option', 6); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
406 |
test_text ('select#id_role option:eq(0)[value][selected]', '---------', non_visible); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
407 |
test_text ('select#id_role option:eq(1)[value="1"]', 'Manager', non_visible); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
408 |
test_text ('select#id_role option:eq(2)[value="2"]', 'Editor', non_visible); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
409 |
test_text ('select#id_role option:eq(3)[value="3"]', 'Moderator', non_visible); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
410 |
test_text ('select#id_role option:eq(4)[value="4"]', 'Commentator', non_visible); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
411 |
test_text ('select#id_role option:eq(5)[value="5"]', 'Observer', non_visible); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
412 |
test_val ('#user :input:eq(6)[type=submit]', 'Add user'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
413 |
test_val ('#user :input:eq(7)#cancel_button[type=button]', 'Cancel'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
414 |
test_unlogged_footer (); |
|
612
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
415 |
// X TOTEST add user (pending) |
|
598
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
416 |
}); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
417 |
|
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
418 |
suite ('add users in bulk page conformity', function () { |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
419 |
test_page_loading ('/user/mass-add/', 'Add users in bulk\n - '+t['#id_workspace_name']); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
420 |
test_logged_header (w.USER_ADMIN); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
421 |
test_default_tabs (); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
422 |
test_count ('#user ul.sub_list:eq(0) a', 2); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
423 |
test_text ('#user ul.sub_list:eq(0) a:eq(0)[href="/user/"]', 'Users\' list'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
424 |
test_text ('#user ul.sub_list:eq(0) a:eq(1)[href="/user/add/"]', 'Add a new user'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
425 |
test_count ('#user form[action="."]:eq(0) :input', 6); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
426 |
test_form_field ('user', 'id_email', 'textarea', 0, 'Emails', true); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
427 |
test_form_field ('user', 'id_tags', 'text', 1, 'Tags'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
428 |
test_form_field ('user', 'id_role', 'select', 2, 'Workspace level role'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
429 |
test_form_field ('user', 'id_note', 'textarea', 3, 'Note'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
430 |
test_count ('select#id_role option', 6); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
431 |
test_text ('select#id_role option:eq(0)[value][selected]', '---------', non_visible); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
432 |
test_text ('select#id_role option:eq(1)[value="1"]', 'Manager', non_visible); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
433 |
test_text ('select#id_role option:eq(2)[value="2"]', 'Editor', non_visible); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
434 |
test_text ('select#id_role option:eq(3)[value="3"]', 'Moderator', non_visible); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
435 |
test_text ('select#id_role option:eq(4)[value="4"]', 'Commentator', non_visible); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
436 |
test_text ('select#id_role option:eq(5)[value="5"]', 'Observer', non_visible); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
437 |
test_val ('#user :input:eq(4)[type=submit]', 'Add users'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
438 |
test_val ('#user :input:eq(5)#cancel_button[type=button]', 'Cancel'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
439 |
// X TOTEST add users (pending) -> can't be deleted |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
440 |
test_unlogged_footer (); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
441 |
}); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
442 |
|
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
443 |
suite ('settings page conformity', function () { |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
444 |
test_page_loading ('/settings/', 'Settings - '+t['#id_workspace_name']); |
|
594
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
445 |
test_logged_header (w.USER_ADMIN); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
446 |
test_default_tabs (); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
447 |
test_count ('#settings ul.sub_list:eq(0) a', 1); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
448 |
test_text ('#settings ul.sub_list:eq(0) a:eq(0)[href="/settings/design/"]', 'Appearance'); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
449 |
test_count ('#settings form[action="."]:eq(0) :input', 12); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
450 |
test_form_field ('settings', 'id_workspace_name', 'text', 0, 'Workspace name'); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
451 |
test_form_field ('settings', 'id_workspace_tagline', 'text', 1, 'Workspace tagline'); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
452 |
test_form_field ('settings', 'id_workspace_registration', 'checkbox', 2, 'Workspace registration'); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
453 |
test_form_field ('settings', 'id_workspace_registration_moderation', 'checkbox', 3, 'Workspace registration moderation'); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
454 |
test_form_field ('settings', 'id_workspace_role_model', 'select', 4, 'Role model'); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
455 |
test_text ('select#id_workspace_role_model option:eq(0)[selected][value="generic"]', 'Generic', non_visible); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
456 |
test_text ('select#id_workspace_role_model option:eq(1)[value="teacher"]', 'Class (education)', non_visible); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
457 |
test_form_field ('settings', 'id_workspace_category_1', 'text', 5, 'Label for the first category of comments'); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
458 |
test_form_field ('settings', 'id_workspace_category_2', 'text', 6, 'Label for the second category of comments'); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
459 |
test_form_field ('settings', 'id_workspace_category_3', 'text', 7, 'Label for the third category of comments'); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
460 |
test_form_field ('settings', 'id_workspace_category_4', 'text', 8, 'Label for the fourth category of comments'); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
461 |
test_form_field ('settings', 'id_workspace_category_5', 'text', 9, 'Label for the fifth category of comments'); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
462 |
test_val ('#settings :input:eq(10)[type=submit]', 'Save'); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
463 |
test_val ('#settings :input:eq(11)#cancel_button[type=button]', 'Cancel'); |
|
612
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
464 |
// TOTEST Workspace registration feature (with newly accessible page) |
|
594
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
465 |
test_unlogged_footer (); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
466 |
}); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
467 |
|
|
598
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
468 |
suite ('settings design page conformity', function () { |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
469 |
test_page_loading ('/settings/design/', 'Settings - '+t['#id_workspace_name']); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
470 |
test_logged_header (w.USER_ADMIN); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
471 |
test_default_tabs (); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
472 |
test_count ('#settings ul.sub_list:eq(0) a', 1); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
473 |
test_text ('#settings ul.sub_list:eq(0) a:eq(0)[href="/settings/"]', 'General'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
474 |
test_count ('#settings form[action="."]:eq(0) :input', 7); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
475 |
test_form_field ('settings', 'id_workspace_logo_file', 'file', 0, 'Workspace logo'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
476 |
test_form_field ('settings', 'id_custom_css', 'textarea', 1, 'Custom CSS rules'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
477 |
test_form_field ('settings', 'id_custom_font', 'text', 2, 'Custom font'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
478 |
test_form_field ('settings', 'id_custom_titles_font', 'text', 3, 'Custom font for titles'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
479 |
test_val ('#settings :input:eq(4)[type=submit]', 'Save'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
480 |
test_val ('#settings :input:eq(5)#cancel_button[type=button]', 'Cancel'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
481 |
test_val ('#settings :input:eq(6)#delete_logo_button[type=submit]', 'Delete logo'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
482 |
test_unlogged_footer (); |
|
594
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
483 |
}); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
484 |
|
|
598
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
485 |
suite ('followup page conformity', function () { |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
486 |
test_page_loading ('/followup/', 'Followup\n - '+t['#id_workspace_name']); |
|
594
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
487 |
test_logged_header (w.USER_ADMIN); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
488 |
test_default_tabs (); |
|
582
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
489 |
test_text ('#followup a:eq(0)[href="/help/#public_private_feed"]', '?'); |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
490 |
test_match ('#followup a:eq(1)[href$="/feed/"]', new RegExp (w.WORKSPACE_URL+'feed/', 'm')); |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
491 |
test_text ('#followup a:eq(2)[href="/help/#public_private_feed"]', '?'); |
|
583
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
492 |
test_count ('form#followup_form[action="."] :input', 3); |
|
582
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
493 |
test_val ('form#followup_form input[type=submit]', '(Activate private feed|Reset private feed url)'); |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
494 |
test_val ('form#followup_form input#workspace_notify_check[type=checkbox]', 'on'); |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
495 |
test_val ('form#followup_form input#own_notify_check[type=checkbox]', 'on'); |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
496 |
|
|
612
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
497 |
// X TOTEST qu'une fois cliqué, le bouton a le nvo label, et qu'une adresse est disponible |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
498 |
// X TOTEST que si on reclique l'adresse est changée |
|
582
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
499 |
|
|
583
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
500 |
test_unlogged_footer (); |
|
582
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
501 |
}); |
|
594
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
502 |
|
|
612
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
503 |
// Tester les créations de textes |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
504 |
// Tester les champs obligatoires |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
505 |
// Tester les liens masqués des textes listés si bien créés |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
506 |
// Tester suppression de text |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
507 |
// Tester bulk actions sur les textes |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
508 |
|
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
509 |
// tester l'affichage d'un texte |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
510 |
// tester que : #textcontainer.custom h1 font: Test_Sopinspace_custom_titles_font |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
511 |
// tester que si Text preferences -> custom -> #textcontainer.custom font: Test_Sopinspace_custom_font |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
512 |
// #textcontainer #add_comment_btn span -> #textcontainer font-family: Test_Sopinspace |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
513 |
|
|
594
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
514 |
suite ('settings restoration', function () { |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
515 |
test_page_loading ('/settings/', 'Settings'); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
516 |
test_fill_settings (z); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
517 |
test ('Restore settings ', dsl (function () { |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
518 |
elt ('#settings input[type="submit"]').click (); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
519 |
browser.waitForPageLoad (); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
520 |
})); |
|
598
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
521 |
test_page_loading ('/settings/design/', 'Settings'); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
522 |
test_fill_design (z); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
523 |
test ('Restore design settings ', dsl (function () { |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
524 |
elt ('#settings input[type="submit"]').click (); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
525 |
browser.waitForPageLoad (); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
526 |
})); |
|
594
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
527 |
// next instruction must be a page loading |
|
598
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
528 |
// test_page_loading ('/settings/', 'Settings'); |
|
594
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
529 |
}); |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
530 |
|
|
575
8ce80860c3fe
Add the skeleton of the future comt test-suite
Simon Descarpentries <sid@sopinspace.com>
parents:
diff
changeset
|
531 |
}); |
|
578
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
532 |
|
|
581
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
533 |
function test_default_tabs () { |
|
582
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
534 |
test_count ('#main-tabs a', 5); |
|
583
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
535 |
test_text ('#main-tabs li:nth-of-type(1) a[href="/"]', 'Dashboard'); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
536 |
test_match ('#main-tabs li:nth-of-type(2) a[href="/text/"]', /^Texts \(\d+\) $/); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
537 |
test_match ('#main-tabs li:nth-of-type(3) a[href="/user/"]', /^People \(\d+\)$/); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
538 |
test_text ('#main-tabs li:nth-of-type(4) a[href="/settings/"]', 'Settings'); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
539 |
test_text ('#main-tabs li:nth-of-type(5) a[href="/followup/"]', 'Followup'); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
540 |
test ('right tab nb', dsl(function () { |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
541 |
elt ('#main-tabs a[href="/text/"]').text (function (t) { |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
542 |
var r = t.match (/^Texts \((\d+)\) $/); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
543 |
if (r.length != 2) throw 'for Texts expected 2 matches got '+r.length; |
|
594
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
544 |
if (z.text_nb != r[1]) throw 'expected tab text nb ('+r[1]+') to be '+z.text_nb; |
|
583
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
545 |
}); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
546 |
elt ('#main-tabs a[href="/user/"]').text (function (t) { |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
547 |
var r = t.match (/^People \((\d+)\)$/); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
548 |
if (r.length != 2) throw 'for People expected 2 matches got '+r.length; |
|
594
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
549 |
if (z.user_nb != r[1]) throw 'expected tab people nb ('+r[1]+') to be '+z.user_nb; |
|
583
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
550 |
}); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
551 |
})); |
|
581
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
552 |
} |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
553 |
|
|
598
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
554 |
function test_logged_header (username, is_tagline) { |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
555 |
is_tagline = typeof is_tagline == 'undefined' ? true : is_tagline; |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
556 |
|
|
581
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
557 |
test_text ('#header_controls b', username) |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
558 |
test_count ('#header_controls a', 6); |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
559 |
test_text ('#header_controls a:nth-of-type(1)[href="/"]', 'Home'); |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
560 |
test_text ('#header_controls a:nth-of-type(2)[href="/create/content/"]', 'Create a text'); |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
561 |
test_text ('#header_controls a:nth-of-type(3)[href="/create/upload/"]', 'Upload a text'); |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
562 |
test_text ('#header_controls a:nth-of-type(4)[href="/create/import/"]', 'Import a co-mented text'); |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
563 |
test_text ('#header_controls a:nth-of-type(5)[href="/profile/"]', 'Profile'); |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
564 |
test_text ('#header_controls a:nth-of-type(6)[href="/logout/"]', 'Logout'); |
|
598
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
565 |
test_text ('#content h1.main_title a[href="/"]', t['#id_workspace_name']); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
566 |
|
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
567 |
if (is_tagline) { |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
568 |
test_match ('#content h1.main_title + div', new RegExp (t['#id_workspace_tagline'], 'm')); |
|
fd0507590413
668 tests, 80% of the workspace tested
Simon Descarpentries <sid@sopinspace.com>
parents:
594
diff
changeset
|
569 |
} |
|
581
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
570 |
} |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
571 |
|
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
572 |
function test_unlogged_header () { |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
573 |
test_count ('#header_controls a', 2); |
|
583
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
574 |
test_text ('#header_controls a[href="/"]', 'Home'); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
575 |
test_text ('#header_controls a[href="/login/"]', 'Login'); |
|
581
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
576 |
} |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
577 |
|
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
578 |
function test_unlogged_footer (url) { |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
579 |
test_count ('#footer a', 9); |
|
583
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
580 |
test_text ('#footer a:nth-of-type(1)[href="/contact/"]', 'Contact'); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
581 |
test_match ('#footer #comentlink[href="http://www.co-ment.com"]', /Powered by/m); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
582 |
test_text ('#footer a:nth-of-type(3)[href="/help/"]', 'Help'); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
583 |
test_text ('#footer a:nth-of-type(4)[href="/i18n/setlang/fr/"]', 'Français'); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
584 |
test_text ('#footer a:nth-of-type(5)[href="/i18n/setlang/no/"]', 'Norsk'); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
585 |
test_text ('#footer a:nth-of-type(6)[href="/i18n/setlang/pt_BR/"]', 'Português Brasileiro'); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
586 |
test_text ('#footer a:nth-of-type(7)[href="/i18n/setlang/es/"]', 'Español'); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
587 |
test_text ('#footer a:nth-of-type(8)[href="/i18n/setlang/bg/"]', 'Български'); |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
588 |
test_text ('#footer a:nth-of-type(9)[href="/i18n/setlang/it/"]', 'Italiano'); |
|
581
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
589 |
} |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
590 |
|
|
612
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
591 |
function test_readz_field (field_id) { |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
592 |
test ('get '+field_id, dsl(function () { |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
593 |
element (field_id).val (function (v) { |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
594 |
z[field_id] = v; |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
595 |
}); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
596 |
})); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
597 |
} |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
598 |
|
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
599 |
function test_fill_field (field_id, stored) { |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
600 |
test ('set '+field_id, dsl(function () { |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
601 |
input (field_id).enter (stored[field_id]); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
602 |
})); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
603 |
} |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
604 |
|
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
605 |
function test_fill_settings (s) { |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
606 |
test_fill_field ('#id_workspace_name', s); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
607 |
test_fill_field ('#id_workspace_tagline', s); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
608 |
test_fill_field ('#id_workspace_registration', s); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
609 |
test_fill_field ('#id_workspace_registration_moderation', s); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
610 |
test_fill_field ('#id_workspace_role_model', s); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
611 |
test_fill_field ('#id_workspace_category_1', s); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
612 |
test_fill_field ('#id_workspace_category_2', s); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
613 |
test_fill_field ('#id_workspace_category_3', s); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
614 |
test_fill_field ('#id_workspace_category_4', s); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
615 |
test_fill_field ('#id_workspace_category_5', s); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
616 |
} |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
617 |
|
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
618 |
function test_fill_design (s) { |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
619 |
test_fill_field ('#id_custom_css', s); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
620 |
test_fill_field ('#id_custom_font', s); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
621 |
test_fill_field ('#id_custom_titles_font', s); |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
622 |
} |
|
2bed79bde721
Start testing mandatory fields being highlighted with empty values are submitted.
Simon Descarpentries <sid@sopinspace.com>
parents:
598
diff
changeset
|
623 |
|
|
581
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
624 |
function test_i18n () { |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
625 |
test ('can change lang to french', dsl(function () { |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
626 |
element ('#footer a[href="/i18n/setlang/fr/"]').click (); |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
627 |
// browser.waitForPageLoad (); |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
628 |
// browser.navigateTo ('/'); |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
629 |
// browser.reload (); |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
630 |
expect (elt ('#footer a[href="/help/"]').text ()).toBe ('Aide'); |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
631 |
element ('#footer a[href="/i18n/setlang/en/"]').click (); |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
632 |
// browser.waitForPageLoad (); |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
633 |
// browser.navigateTo ('/'); |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
634 |
})); |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
635 |
} |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
636 |
|
|
579
869f02c75687
daily progress : suite/test style, config from single config file, attempt to test i18n in footer
Simon Descarpentries <sid@sopinspace.com>
parents:
578
diff
changeset
|
637 |
function test_page_loading (url, title) { |
|
583
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
638 |
test (url+' loads', dsl(function () { |
|
578
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
639 |
// here we are in Karma page |
|
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
640 |
browser.navigateTo (url); |
|
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
641 |
expect (element ('title').text ()).toMatch (new RegExp (title,'m')); |
|
581
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
642 |
// The same test agin vaniller javascript |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
643 |
element ('title').text (function (page_title) { |
|
578
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
644 |
// here we got a value from the test iframe |
|
581
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
645 |
// to display the tested value : console.log (page_title); |
|
578
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
646 |
if (!(new RegExp (title, 'm').test (page_title))) throw 'got page '+page_title+' instead'; |
|
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
647 |
}); |
|
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
648 |
})); |
|
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
649 |
} |
|
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
650 |
|
|
581
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
651 |
/** Test if the selected DOM element is defined or has a given value : .val() |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
652 |
* s : CSS selector |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
653 |
* e : expected value, if omited, test existence |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
654 |
*/ |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
655 |
function test_val (s, e) { |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
656 |
e = typeof e == 'undefined' ? '' : e; // .val() returns defined ? '' : undefined; // if no value |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
657 |
test (s+' is '+e, dsl(function () { |
|
582
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
658 |
expect (elt (s).val ()).toMatch (new RegExp (e, 'm')); |
|
578
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
659 |
})); |
|
581
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
660 |
} |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
661 |
|
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
662 |
/** Test if the selected DOM element has the given text : .text() |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
663 |
* s : CSS selector |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
664 |
* e : expected value |
|
583
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
665 |
* v : should we test a visible value ? |
|
581
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
666 |
*/ |
|
583
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
667 |
function test_text (s, e, v) { |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
668 |
v = typeof v == 'undefined' ? true : v; |
|
581
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
669 |
test (s+' has text '+e, dsl(function () { |
|
583
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
670 |
expect (elt (s, v).text ()).toBe (e); |
|
578
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
671 |
})); |
|
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
672 |
} |
|
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
673 |
|
|
581
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
674 |
/** Test if the selected DOM element .text() value match the given regexp |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
675 |
* s : CSS selector |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
676 |
* r : regexp to match |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
677 |
*/ |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
678 |
function test_match (s, r) { |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
679 |
test (s+' text match '+r, dsl(function () { |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
680 |
expect (elt (s).text ()).toMatch (r); |
|
578
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
681 |
})); |
|
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
682 |
} |
|
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
683 |
|
|
581
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
684 |
/** Count selector occurences |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
685 |
* s : CSS selector |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
686 |
* e : expected count |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
687 |
*/ |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
688 |
function test_count (s, e) { |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
689 |
test (s+' count is '+e, dsl(function () { |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
690 |
expect (elt (s).count ()).toBe (e); |
|
578
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
691 |
})); |
|
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
692 |
} |
|
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
693 |
|
|
581
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
694 |
/** Test Django form field presence |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
695 |
*/ |
|
582
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
696 |
function test_form_field (form_id, field_id, type, position, label, mandatory) { |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
697 |
test ('has a '+label+' form field', dsl(function () { |
|
594
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
698 |
var s = ''; |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
699 |
switch (type) { |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
700 |
case 'textarea':s = 'textarea#'+field_id; break; |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
701 |
case 'select': s = 'select#'+field_id; break; |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
702 |
default: s = 'input#'+field_id+'[type="'+type+'"]'; |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
703 |
} |
|
daf4516b022d
Set and restore settings during test suite
Simon Descarpentries <sid@sopinspace.com>
parents:
583
diff
changeset
|
704 |
// var s = type == 'textarea' ? 'textarea#'+field_id : 'input#'+field_id+'[type='+type+']'; |
|
578
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
705 |
expect (elt (s).val ()).toBeDefined (); |
|
582
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
706 |
expect (elt ('#'+form_id+' :input:eq('+position+')#'+field_id).val ()).toBeDefined (); |
|
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
707 |
expect (elt ('label[for='+field_id+']').text ()).toBe (label); |
|
578
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
708 |
|
|
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
709 |
if (mandatory) |
|
582
63b489ad02a3
rewritting and new tests
Simon Descarpentries <sid@sopinspace.com>
parents:
581
diff
changeset
|
710 |
expect (elt ('label[for='+field_id+'] + span.required_star').val ()).toBeDefined (); |
|
578
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
711 |
})); |
|
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
712 |
} |
|
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
713 |
|
|
581
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
714 |
/** Ensure the given element is visible |
|
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
715 |
* s : CSS selector of the DOM element to check |
|
583
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
716 |
* v : should the element being visible |
|
581
d50d457e7e39
rewritting of up to 102 tests, admin dashboard conformity
Simon Descarpentries <sid@sopinspace.com>
parents:
579
diff
changeset
|
717 |
*/ |
|
583
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
718 |
function elt (s, v) { |
|
084934fe912e
construction de la suite de test, pages followup et Texts
Simon Descarpentries <sid@sopinspace.com>
parents:
582
diff
changeset
|
719 |
return element (s + (v ? ':visible' : '')); |
|
578
1793daa8df8a
Add tests for other unloggedely accessible webpages
Simon Descarpentries <sid@sopinspace.com>
parents:
577
diff
changeset
|
720 |
} |