toolGroup.feature 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  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. # File path is located in behat.yml
  74. Then I attach the file "build/css/base.css" to "file"
  75. Then wait for the page to be loaded
  76. Then I press "upload_submitDocument"
  77. Then wait for the page to be loaded
  78. Then I should see "File upload succeeded"
  79. Scenario: Delete 2 uploaded files
  80. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  81. And I follow "Group 0001"
  82. Then I should see "Group 0001"
  83. And I follow "Documents"
  84. Then I should see "My folder in group"
  85. Then I follow "My folder in group"
  86. Then I follow "Delete"
  87. Then wait for the page to be loaded
  88. Then I should see "Are you sure to delete"
  89. Then I follow "delete_item"
  90. Scenario: Delete directory
  91. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  92. And I follow "Group 0001"
  93. Then I should see "Group 0001"
  94. And I follow "Documents"
  95. Then I should see "My folder in group"
  96. Then I follow "Delete"
  97. Then wait for the page to be loaded
  98. Then I should see "Are you sure to delete"
  99. Then I follow "delete_item"
  100. Scenario: Add fapple to the Group 0001
  101. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  102. And I follow "Group 0001"
  103. Then I should see "Group 0001"
  104. Then I follow "Edit this group"
  105. Then I should see "Group members"
  106. Then wait for the page to be loaded
  107. Then I follow "group_members_tab"
  108. Then I select "Fiona Apple Maggart (fapple)" from "group_members"
  109. Then I press "group_members_rightSelected"
  110. Then I press "Save settings"
  111. And wait for the page to be loaded
  112. Then I should see "Group settings modified"
  113. Then I follow "Group 0001"
  114. Then I should see "Fiona"
  115. Scenario: Add fapple to the Group 0003 not allowed because group category allows 1 user per group
  116. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  117. And I follow "Group 0003"
  118. Then I should see "Group 0003"
  119. Then I follow "Edit this group"
  120. Then I should see "Group members"
  121. Then wait for the page to be loaded
  122. Then I follow "group_members_tab"
  123. Then I select "Fiona Apple Maggart (fapple)" from "group_members"
  124. Then I press "group_members_rightSelected"
  125. Then I press "Save settings"
  126. And wait for the page to be loaded
  127. Then I should see "Group settings modified"
  128. Then I follow "Group 0003"
  129. Then I should not see "Fiona"
  130. # Group category overwrites all other groups settings.
  131. Scenario: Change Group category to allow multiple inscription of the user
  132. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  133. And I follow "Edit this category"
  134. Then I should see "Edit group category: Group category 1"
  135. Then I fill in select bootstrap static by text "#groups_per_user" select "10"
  136. Then I press "Edit"
  137. Then I should see "Group settings have been modified"
  138. Scenario: Change Group 0003 settings to make announcements private
  139. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  140. And I follow "Group 0003"
  141. Then I should see "Group 0003"
  142. Then I follow "Edit this group"
  143. Then I check the "announcements_state" radio button with "2" value
  144. Then I press "Save settings"
  145. Then I should see "Group settings modified"
  146. Scenario: Change Group 0004 settings to make it private
  147. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  148. And I follow "Group 0004"
  149. Then I should see "Group 0004"
  150. Then I follow "Edit this group"
  151. Then I check the "announcements_state" radio button with "2" value
  152. Then I press "Save settings"
  153. Then I should see "Group settings modified"
  154. Scenario: Change Group 0005 settings to make announcements private between users
  155. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  156. And I follow "Group 0005"
  157. Then I should see "Group 0005"
  158. Then I follow "Edit this group"
  159. Then I check the "announcements_state" radio button with "3" value
  160. Then I press "Save settings"
  161. Then I should see "Group settings modified"
  162. Scenario: Add fapple and acostea to Group 0005
  163. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  164. And I follow "Group 0005"
  165. Then I should see "Group 0005"
  166. Then I follow "Edit this group"
  167. Then I should see "Group members"
  168. Then wait for the page to be loaded
  169. Then I follow "group_members_tab"
  170. Then I additionally select "Fiona Apple Maggart (fapple)" from "group_members"
  171. Then I additionally select "Andrea Costea (acostea)" from "group_members"
  172. Then I press "group_members_rightSelected"
  173. Then I press "Save settings"
  174. And wait for the page to be loaded
  175. Then I should see "Group settings modified"
  176. Then I follow "Group 0005"
  177. Then I should see "Fiona"
  178. Then I should see "Andrea"
  179. Scenario: Add fapple to the Group 0003
  180. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  181. And I follow "Group 0003"
  182. Then I should see "Group 0003"
  183. Then I follow "Edit this group"
  184. Then I should see "Group members"
  185. Then wait for the page to be loaded
  186. Then I follow "group_members_tab"
  187. Then I select "Fiona Apple Maggart (fapple)" from "group_members"
  188. Then I press "group_members_rightSelected"
  189. Then I press "Save settings"
  190. And wait for the page to be loaded
  191. Then I should see "Group settings modified"
  192. Then I follow "Group 0003"
  193. Then I should see "Fiona"
  194. Scenario: Add acostea to the Group 0002
  195. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  196. And I follow "Group 0002"
  197. Then I should see "Group 0002"
  198. Then I follow "Edit this group"
  199. Then I should see "Group members"
  200. Then wait for the page to be loaded
  201. Then I follow "group_members_tab"
  202. Then I select "Andrea Costea (acostea)" from "group_members"
  203. Then I press "group_members_rightSelected"
  204. Then I press "Save settings"
  205. And wait for the page to be loaded
  206. Then I should see "Group settings modified"
  207. Then I follow "Group 0002"
  208. Then I should see "Andrea"
  209. Scenario: Create an announcement for everybody inside Group 0001
  210. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  211. And I follow "Group 0001"
  212. Then I should see "Group 0001"
  213. And I follow "Announcements"
  214. Then I should see "Announcements"
  215. Then I follow "Add an announcement"
  216. Then I should see "Add an announcement"
  217. Then wait for the page to be loaded
  218. Then I fill in the following:
  219. | title | Announcement for all users inside Group 0001 |
  220. And I fill in ckeditor field "content" with "Announcement description in Group 0001"
  221. Then I follow "announcement_preview"
  222. And wait for the page to be loaded
  223. Then I should see "Announcement will be sent to"
  224. Then I press "submit"
  225. Then I should see "Announcement has been added"
  226. Scenario: Create an announcement for fapple inside Group 0001
  227. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  228. And I follow "Group 0001"
  229. Then I should see "Group 0001"
  230. And I follow "Announcements"
  231. Then I should see "Announcements"
  232. Then I follow "Add an announcement"
  233. Then I should see "Add an announcement"
  234. Then wait for the page to be loaded
  235. Then I press "choose_recipients"
  236. Then I select "Fiona Apple" from "users"
  237. Then I press "users_rightSelected"
  238. Then I fill in the following:
  239. | title | Announcement for user fapple inside Group 0001 |
  240. And I fill in ckeditor field "content" with "Announcement description for user fapple inside Group 0001"
  241. Then I follow "announcement_preview"
  242. And wait for the page to be loaded
  243. Then I should see "Announcement will be sent to"
  244. Then I press "submit"
  245. Then I should see "Announcement has been added"
  246. Scenario: Create an announcement for everybody inside Group 0003 (private)
  247. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  248. And I follow "Group 0003"
  249. Then I should see "Group 0003"
  250. And I follow "Announcements"
  251. Then I should see "Announcements"
  252. Then I follow "Add an announcement"
  253. Then I should see "Add an announcement"
  254. Then wait for the page to be loaded
  255. Then I fill in the following:
  256. | title | Announcement for all users inside Group 0003 |
  257. And I fill in ckeditor field "content" with "Announcement description in Group 0003"
  258. Then I follow "announcement_preview"
  259. And wait for the page to be loaded
  260. Then I should see "Announcement will be sent to"
  261. Then I press "submit"
  262. Then I should see "Announcement has been added"
  263. Scenario: Create an announcement for fapple inside Group 0003
  264. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  265. And I follow "Group 0003"
  266. Then I should see "Group 0003"
  267. And I follow "Announcements"
  268. Then I should see "Announcements"
  269. Then I follow "Add an announcement"
  270. Then I should see "Add an announcement"
  271. Then wait for the page to be loaded
  272. Then I press "choose_recipients"
  273. Then I select "Fiona Apple" from "users"
  274. Then I press "users_rightSelected"
  275. Then I fill in the following:
  276. | title | Announcement for user fapple inside Group 0003 |
  277. And I fill in ckeditor field "content" with "Announcement description for user fapple inside Group 0003"
  278. Then I follow "announcement_preview"
  279. And wait for the page to be loaded
  280. Then I should see "Announcement will be sent to"
  281. Then I press "submit"
  282. Then I should see "Announcement has been added"
  283. Scenario: Create an announcement as acostea and send only to fapple
  284. Given I am logged as "acostea"
  285. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  286. And I follow "Group 0005"
  287. Then I should see "Group 0005"
  288. And I follow "Announcements"
  289. Then I should see "Announcements"
  290. Then I follow "Add an announcement"
  291. Then I should see "Add an announcement"
  292. Then wait for the page to be loaded
  293. Then I press "choose_recipients"
  294. Then I select "Fiona Apple Maggart" from "users"
  295. Then I press "users_rightSelected"
  296. Then I fill in the following:
  297. | title | Announcement only for fapple Group 0005 |
  298. And I fill in ckeditor field "content" with "Announcement description only for fapple Group 0005"
  299. Then I follow "announcement_preview"
  300. And wait for the page to be loaded
  301. Then I should see "Announcement will be sent to"
  302. Then I press "submit"
  303. Then I should see "Announcement has been added"
  304. Scenario: Check fapple/acostea access of announcements
  305. Given I am logged as "fapple"
  306. And I am on course "TEMP" homepage
  307. And I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  308. And I follow "Group 0001"
  309. Then I should see "Group 0001"
  310. Then I follow "Announcements"
  311. And wait for the page to be loaded
  312. Then I should see "Announcement for all users inside Group 0001"
  313. Then I should see "Announcement for user fapple inside Group 0001"
  314. Then I follow "Announcement for user fapple inside Group 0001 Group"
  315. Then I should see "Announcement description for user fapple inside Group 0001"
  316. Then I save current URL with name "announcement_for_user_fapple_group_0001_public"
  317. Then I move backward one page
  318. Then wait for the page to be loaded
  319. Then I should see "Announcement for all users inside Group 0001"
  320. Then I follow "Announcement for all users inside Group 0001"
  321. Then I save current URL with name "announcement_for_all_users_group_0001_public"
  322. Then I should see "Announcement description in Group 0001"
  323. And I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  324. And I follow "Group 0003"
  325. Then I should see "Group 0003"
  326. Then I follow "Announcements"
  327. And wait for the page to be loaded
  328. Then I should see "Announcement for all users inside Group 0003"
  329. Then I should see "Announcement for user fapple inside Group 0003"
  330. Then I follow "Announcement for user fapple inside Group 0003 Group"
  331. Then I should see "Announcement description for user fapple inside Group 0003"
  332. Then I save current URL with name "announcement_for_user_fapple_group_0003_private"
  333. Then I move backward one page
  334. Then wait for the page to be loaded
  335. Then I should see "Announcement for all users inside Group 0003"
  336. Then I follow "Announcement for all users inside Group 0003"
  337. Then I should see "Announcement description in Group 0003"
  338. Then I save current URL with name "announcement_for_all_users_group_0003_private"
  339. And I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  340. And I follow "Group 0005"
  341. Then I should see "Group 0005"
  342. Then I follow "Announcements"
  343. And wait for the page to be loaded
  344. Then I should see "Announcement only for fapple Group 0005"
  345. Then I follow "Announcement only for fapple Group 0005"
  346. Then I save current URL with name "announcement_only_for_fapple_private"
  347. ## Finish tests with fapple now check access with acostea ##
  348. Given I am logged as "acostea"
  349. And I am on course "TEMP" homepage
  350. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  351. Then I should see "Group 0001"
  352. And I should see "Group 0002"
  353. And I should see "Group 0003"
  354. And I should see "Group 0004"
  355. Then I visit URL saved with name "announcement_for_user_fapple_group_0001_public"
  356. Then I should see "Sorry, you are not allowed to access this page"
  357. Then I visit URL saved with name "announcement_for_all_users_group_0001_public"
  358. Then I should see "Sorry, you are not allowed to access this page"
  359. Then I visit URL saved with name "announcement_only_for_fapple_private"
  360. Then I should see "Sorry, you are not allowed to access this page"
  361. Given I am logged as "acostea"
  362. And I am on course "TEMP" homepage
  363. Given I am on "/main/group/group.php?cidReq=TEMP&id_session=0"
  364. Then I should see "Group 0001"
  365. And I should see "Group 0002"
  366. And I should see "Group 0003"
  367. And I should see "Group 0004"
  368. And I should see "Group 0005"
  369. Then I visit URL saved with name "announcement_for_user_fapple_group_0001_public"
  370. Then I should see "Sorry, you are not allowed to access this page"
  371. Then I visit URL saved with name "announcement_for_all_users_group_0001_public"
  372. Then I should see "Sorry, you are not allowed to access this page"
  373. Then I visit URL saved with name "announcement_for_user_fapple_group_0003_private"
  374. Then I should see "Sorry, you are not allowed to access this page"
  375. Then I visit URL saved with name "announcement_for_all_users_group_0003_private"
  376. Then I should see "Sorry, you are not allowed to access this page"
  377. Then I visit URL saved with name "announcement_only_for_fapple_private"
  378. Then I should see "Sorry, you are not allowed to access this page"