toolGroup.feature 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  1. Feature: Group tool
  2. In order to use the group tool
  3. The teachers should be able to create groups
  4. Background:
  5. Given I am a platform administrator
  6. And I am on course "TEMP" homepage
  7. Scenario: Delete default category
  8. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  9. Then I should see "Default groups"
  10. Then I follow "Delete"
  11. Then I confirm the popup
  12. Then I should see "The category has been deleted"
  13. Scenario: Create a group directory
  14. Given I am on "/main/group/group_category.php?cidReq=TEMP&id_session=0&action=add_category"
  15. When I fill in the following:
  16. | title | Group category 1 |
  17. And I press "group_category_submit"
  18. Then I should see "Category created"
  19. Scenario: Create 4 groups
  20. Given I am on "/main/group/group_creation.php?cidReq=TEMP&id_session=0"
  21. When I fill in the following:
  22. | number_of_groups | 5 |
  23. And I press "submit"
  24. Then I should see "New groups creation"
  25. When I fill in the following:
  26. | group_0_places | 1 |
  27. | group_1_places | 1 |
  28. | group_2_places | 1 |
  29. | group_3_places | 1 |
  30. | group_4_places | 2 |
  31. And I fill in select bootstrap static by text "#category_0" select "Group category 1"
  32. And I fill in select bootstrap static by text "#category_1" select "Group category 1"
  33. And I fill in select bootstrap static by text "#category_2" select "Group category 1"
  34. And I fill in select bootstrap static by text "#category_3" select "Group category 1"
  35. And I fill in select bootstrap static by text "#category_4" select "Group category 1"
  36. And I press "submit"
  37. Then I should see "group(s) has (have) been added"
  38. Scenario: Create document folder in group
  39. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  40. And I follow "Group 0001"
  41. Then I should see "Group 0001"
  42. And I follow "Documents"
  43. Then I should see "There are no documents to be displayed"
  44. Then I follow "Create folder"
  45. Then I should see "Create folder"
  46. Then I fill in the following:
  47. | dirname | My folder in group |
  48. And I press "create_dir_form_submit"
  49. Then I should see "Folder created"
  50. Scenario: Create document inside folder in group
  51. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  52. And I follow "Group 0001"
  53. Then I should see "Group 0001"
  54. And I follow "Documents"
  55. Then I should see "My folder in group"
  56. Then I follow "My folder in group"
  57. Then I follow "Create a rich media page / activity"
  58. Then I should see "Create a rich media page"
  59. Then I fill in the following:
  60. | title | html test |
  61. And I fill in ckeditor field "content" with "My first HTML!!"
  62. Then I press "create_document_submit"
  63. Then I should see "Item added"
  64. Scenario: Upload a document inside folder in group
  65. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  66. And I follow "Group 0001"
  67. Then I should see "Group 0001"
  68. And I follow "Documents"
  69. Then I should see "My folder in group"
  70. Then I follow "My folder in group"
  71. Then I follow "Upload documents"
  72. Then I follow "Upload (Simple)"
  73. Then I attach the file "web/css/base.css" to "file"
  74. Then wait for the page to be loaded
  75. Then I press "upload_submitDocument"
  76. Then wait for the page to be loaded
  77. Then I should see "File upload succeeded"
  78. Scenario: Delete 2 uploaded files
  79. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  80. And I follow "Group 0001"
  81. Then I should see "Group 0001"
  82. And I follow "Documents"
  83. Then I should see "My folder in group"
  84. Then I follow "My folder in group"
  85. Then I follow "Delete"
  86. Then wait for the page to be loaded
  87. Then I should see "Are you sure to delete"
  88. Then I follow "delete_item"
  89. Scenario: Delete directory
  90. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  91. And I follow "Group 0001"
  92. Then I should see "Group 0001"
  93. And I follow "Documents"
  94. Then I should see "My folder in group"
  95. Then I follow "Delete"
  96. Then wait for the page to be loaded
  97. Then I should see "Are you sure to delete"
  98. Then I follow "delete_item"
  99. Scenario: Add fapple to the Group 0001
  100. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  101. And I follow "Group 0001"
  102. Then I should see "Group 0001"
  103. Then I follow "Edit this group"
  104. Then I should see "Group members"
  105. Then wait for the page to be loaded
  106. Then I follow "group_members_tab"
  107. Then I select "Fiona Apple Maggart (fapple)" from "group_members"
  108. Then I press "group_members_rightSelected"
  109. Then I press "Save settings"
  110. And wait for the page to be loaded
  111. Then I should see "Group settings modified"
  112. Then I follow "Group 0001"
  113. Then I should see "Fiona"
  114. Scenario: Add fapple to the Group 0003 not allowed because group category allows 1 user per group
  115. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  116. And I follow "Group 0003"
  117. Then I should see "Group 0003"
  118. Then I follow "Edit this group"
  119. Then I should see "Group members"
  120. Then wait for the page to be loaded
  121. Then I follow "group_members_tab"
  122. Then I select "Fiona Apple Maggart (fapple)" from "group_members"
  123. Then I press "group_members_rightSelected"
  124. Then I press "Save settings"
  125. And wait for the page to be loaded
  126. Then I should see "Group settings modified"
  127. Then I follow "Group 0003"
  128. Then I should not see "Fiona"
  129. # Group category overwrites all other groups settings.
  130. Scenario: Change Group category to allow multiple inscription of the user
  131. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  132. And I follow "Edit this category"
  133. Then I should see "Edit group category: Group category 1"
  134. Then I fill in select bootstrap static by text "#groups_per_user" select "10"
  135. Then I press "Edit"
  136. Then I should see "Group settings have been modified"
  137. Scenario: Change Group 0003 settings to make announcements private
  138. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  139. And I follow "Group 0003"
  140. Then I should see "Group 0003"
  141. Then I follow "Edit this group"
  142. Then I check the "announcements_state" radio button with "2" value
  143. Then I press "Save settings"
  144. Then I should see "Group settings modified"
  145. Scenario: Change Group 0004 settings to make it private
  146. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  147. And I follow "Group 0004"
  148. Then I should see "Group 0004"
  149. Then I follow "Edit this group"
  150. Then I check the "announcements_state" radio button with "2" value
  151. Then I press "Save settings"
  152. Then I should see "Group settings modified"
  153. Scenario: Change Group 0005 settings to make announcements private between users
  154. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  155. And I follow "Group 0005"
  156. Then I should see "Group 0005"
  157. Then I follow "Edit this group"
  158. Then I check the "announcements_state" radio button with "3" value
  159. Then I press "Save settings"
  160. Then I should see "Group settings modified"
  161. Scenario: Add fapple and acostea to Group 0005
  162. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  163. And I follow "Group 0005"
  164. Then I should see "Group 0005"
  165. Then I follow "Edit this group"
  166. Then I should see "Group members"
  167. Then wait for the page to be loaded
  168. Then I follow "group_members_tab"
  169. Then I additionally select "Fiona Apple Maggart (fapple)" from "group_members"
  170. Then I additionally select "Andrea Costea (acostea)" from "group_members"
  171. Then I press "group_members_rightSelected"
  172. Then I press "Save settings"
  173. And wait for the page to be loaded
  174. Then I should see "Group settings modified"
  175. Then I follow "Group 0005"
  176. Then I should see "Fiona"
  177. Then I should see "Andrea"
  178. Scenario: Add fapple to the Group 0003
  179. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  180. And I follow "Group 0003"
  181. Then I should see "Group 0003"
  182. Then I follow "Edit this group"
  183. Then I should see "Group members"
  184. Then wait for the page to be loaded
  185. Then I follow "group_members_tab"
  186. Then I select "Fiona Apple Maggart (fapple)" from "group_members"
  187. Then I press "group_members_rightSelected"
  188. Then I press "Save settings"
  189. And wait for the page to be loaded
  190. Then I should see "Group settings modified"
  191. Then I follow "Group 0003"
  192. Then I should see "Fiona"
  193. Scenario: Add acostea to the Group 0002
  194. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  195. And I follow "Group 0002"
  196. Then I should see "Group 0002"
  197. Then I follow "Edit this group"
  198. Then I should see "Group members"
  199. Then wait for the page to be loaded
  200. Then I follow "group_members_tab"
  201. Then I select "Andrea Costea (acostea)" from "group_members"
  202. Then I press "group_members_rightSelected"
  203. Then I press "Save settings"
  204. And wait for the page to be loaded
  205. Then I should see "Group settings modified"
  206. Then I follow "Group 0002"
  207. Then I should see "Andrea"
  208. Scenario: Create an announcement for everybody inside Group 0001
  209. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  210. And I follow "Group 0001"
  211. Then I should see "Group 0001"
  212. And I follow "Announcements"
  213. Then I should see "Announcements"
  214. Then I follow "Add an announcement"
  215. Then I should see "Add an announcement"
  216. Then wait for the page to be loaded
  217. Then I fill in the following:
  218. | title | Announcement for all users inside Group 0001 |
  219. And I fill in ckeditor field "content" with "Announcement description in Group 0001"
  220. Then I follow "announcement_preview"
  221. And wait for the page to be loaded
  222. Then I should see "Announcement will be sent to"
  223. Then I press "submit"
  224. Then I should see "Announcement has been added"
  225. Scenario: Create an announcement for fapple inside Group 0001
  226. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  227. And I follow "Group 0001"
  228. Then I should see "Group 0001"
  229. And I follow "Announcements"
  230. Then I should see "Announcements"
  231. Then I follow "Add an announcement"
  232. Then I should see "Add an announcement"
  233. Then wait for the page to be loaded
  234. Then I press "choose_recipients"
  235. Then I select "Fiona Apple" from "users"
  236. Then I press "users_rightSelected"
  237. Then I fill in the following:
  238. | title | Announcement for user fapple inside Group 0001 |
  239. And I fill in ckeditor field "content" with "Announcement description for user fapple inside Group 0001"
  240. Then I follow "announcement_preview"
  241. And wait for the page to be loaded
  242. Then I should see "Announcement will be sent to"
  243. Then I press "submit"
  244. Then I should see "Announcement has been added"
  245. Scenario: Create an announcement for everybody inside Group 0003 (private)
  246. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  247. And I follow "Group 0003"
  248. Then I should see "Group 0003"
  249. And I follow "Announcements"
  250. Then I should see "Announcements"
  251. Then I follow "Add an announcement"
  252. Then I should see "Add an announcement"
  253. Then wait for the page to be loaded
  254. Then I fill in the following:
  255. | title | Announcement for all users inside Group 0003 |
  256. And I fill in ckeditor field "content" with "Announcement description in Group 0003"
  257. Then I follow "announcement_preview"
  258. And wait for the page to be loaded
  259. Then I should see "Announcement will be sent to"
  260. Then I press "submit"
  261. Then I should see "Announcement has been added"
  262. Scenario: Create an announcement for fapple inside Group 0003
  263. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  264. And I follow "Group 0003"
  265. Then I should see "Group 0003"
  266. And I follow "Announcements"
  267. Then I should see "Announcements"
  268. Then I follow "Add an announcement"
  269. Then I should see "Add an announcement"
  270. Then wait for the page to be loaded
  271. Then I press "choose_recipients"
  272. Then I select "Fiona Apple" from "users"
  273. Then I press "users_rightSelected"
  274. Then I fill in the following:
  275. | title | Announcement for user fapple inside Group 0003 |
  276. And I fill in ckeditor field "content" with "Announcement description for user fapple inside Group 0003"
  277. Then I follow "announcement_preview"
  278. And wait for the page to be loaded
  279. Then I should see "Announcement will be sent to"
  280. Then I press "submit"
  281. Then I should see "Announcement has been added"
  282. Scenario: Create an announcement as acostea and send only to fapple
  283. Given I am logged as "acostea"
  284. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  285. And I follow "Group 0005"
  286. Then I should see "Group 0005"
  287. And I follow "Announcements"
  288. Then I should see "Announcements"
  289. Then I follow "Add an announcement"
  290. Then I should see "Add an announcement"
  291. Then wait for the page to be loaded
  292. Then I press "choose_recipients"
  293. Then I select "Fiona Apple Maggart" from "users"
  294. Then I press "users_rightSelected"
  295. Then I fill in the following:
  296. | title | Announcement only for fapple Group 0005 |
  297. And I fill in ckeditor field "content" with "Announcement description only for fapple Group 0005"
  298. Then I follow "announcement_preview"
  299. And wait for the page to be loaded
  300. Then I should see "Announcement will be sent to"
  301. Then I press "submit"
  302. Then I should see "Announcement has been added"
  303. Scenario: Check fapple/acostea access of announcements
  304. Given I am logged as "fapple"
  305. And I am on course "TEMP" homepage
  306. And I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  307. And I follow "Group 0001"
  308. Then I should see "Group 0001"
  309. Then I follow "Announcements"
  310. And wait for the page to be loaded
  311. Then I should see "Announcement for all users inside Group 0001"
  312. Then I should see "Announcement for user fapple inside Group 0001"
  313. Then I follow "Announcement for user fapple inside Group 0001 Group"
  314. Then I should see "Announcement description for user fapple inside Group 0001"
  315. Then I save current URL with name "announcement_for_user_fapple_group_0001_public"
  316. Then I move backward one page
  317. Then wait for the page to be loaded
  318. Then I should see "Announcement for all users inside Group 0001"
  319. Then I follow "Announcement for all users inside Group 0001"
  320. Then I save current URL with name "announcement_for_all_users_group_0001_public"
  321. Then I should see "Announcement description in Group 0001"
  322. And I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  323. And I follow "Group 0003"
  324. Then I should see "Group 0003"
  325. Then I follow "Announcements"
  326. And wait for the page to be loaded
  327. Then I should see "Announcement for all users inside Group 0003"
  328. Then I should see "Announcement for user fapple inside Group 0003"
  329. Then I follow "Announcement for user fapple inside Group 0003 Group"
  330. Then I should see "Announcement description for user fapple inside Group 0003"
  331. Then I save current URL with name "announcement_for_user_fapple_group_0003_private"
  332. Then I move backward one page
  333. Then wait for the page to be loaded
  334. Then I should see "Announcement for all users inside Group 0003"
  335. Then I follow "Announcement for all users inside Group 0003"
  336. Then I should see "Announcement description in Group 0003"
  337. Then I save current URL with name "announcement_for_all_users_group_0003_private"
  338. And I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  339. And I follow "Group 0005"
  340. Then I should see "Group 0005"
  341. Then I follow "Announcements"
  342. And wait for the page to be loaded
  343. Then I should see "Announcement only for fapple Group 0005"
  344. Then I follow "Announcement only for fapple Group 0005"
  345. Then I save current URL with name "announcement_only_for_fapple_private"
  346. ## Finish tests with fapple now check access with acostea ##
  347. Given I am logged as "acostea"
  348. And I am on course "TEMP" homepage
  349. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  350. Then I should see "Group 0001"
  351. And I should see "Group 0002"
  352. And I should see "Group 0003"
  353. And I should see "Group 0004"
  354. Then I visit URL saved with name "announcement_for_user_fapple_group_0001_public"
  355. Then I should see "Sorry, you are not allowed to access this page"
  356. Then I visit URL saved with name "announcement_for_all_users_group_0001_public"
  357. Then I should see "Sorry, you are not allowed to access this page"
  358. Then I visit URL saved with name "announcement_only_for_fapple_private"
  359. Then I should see "Sorry, you are not allowed to access this page"
  360. Given I am logged as "acostea"
  361. And I am on course "TEMP" homepage
  362. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  363. Then I should see "Group 0001"
  364. And I should see "Group 0002"
  365. And I should see "Group 0003"
  366. And I should see "Group 0004"
  367. And I should see "Group 0005"
  368. Then I visit URL saved with name "announcement_for_user_fapple_group_0001_public"
  369. Then I should see "Sorry, you are not allowed to access this page"
  370. Then I visit URL saved with name "announcement_for_all_users_group_0001_public"
  371. Then I should see "Sorry, you are not allowed to access this page"
  372. Then I visit URL saved with name "announcement_for_user_fapple_group_0003_private"
  373. Then I should see "Sorry, you are not allowed to access this page"
  374. Then I visit URL saved with name "announcement_for_all_users_group_0003_private"
  375. Then I should see "Sorry, you are not allowed to access this page"
  376. Then I visit URL saved with name "announcement_only_for_fapple_private"
  377. Then I should see "Sorry, you are not allowed to access this page"