/mod/quiz/accessrule/seb/tests/behat/edit_form.feature

https://github.com/sbourget/moodle · Gherkin Specification · 247 lines · 236 code · 9 blank · 2 comment · 2 complexity · f9fe3d903f0e4248166b7e6d1db74bcd MD5 · raw file

  1. @javascript @mod_quiz @quizaccess @quizaccess_seb
  2. Feature: Safe Exam Browser settings in quiz edit form
  3. Background:
  4. Given the following "courses" exist:
  5. | fullname | shortname |
  6. | Course 1 | C1 |
  7. Scenario: Quiz setting "Require the use of Safe Exam Browser" has all types, except "Use an existing template".
  8. When I log in as "admin"
  9. And I am on "Course 1" course homepage with editing mode on
  10. And I add a "Quiz" to section "1"
  11. And I expand all fieldsets
  12. And the "Require the use of Safe Exam Browser" select box should contain "Yes – Configure manually"
  13. And the "Require the use of Safe Exam Browser" select box should not contain "Yes – Use an existing template"
  14. And the "Require the use of Safe Exam Browser" select box should contain "Yes – Upload my own config"
  15. And the "Require the use of Safe Exam Browser" select box should contain "Yes – Use SEB client config"
  16. And the field "Require the use of Safe Exam Browser" matches value "No"
  17. Scenario: Quiz setting "Require the use of Safe Exam Browser" has all types if at least one template has been added.
  18. Given the following "quizaccess_seb > seb templates" exist:
  19. | name |
  20. | Template 1 |
  21. And I log in as "admin"
  22. And I am on "Course 1" course homepage with editing mode on
  23. When I add a "Quiz" to section "1"
  24. And I expand all fieldsets
  25. And the "Require the use of Safe Exam Browser" select box should contain "Yes – Configure manually"
  26. And the "Require the use of Safe Exam Browser" select box should contain "Yes – Use an existing template"
  27. And the "Require the use of Safe Exam Browser" select box should contain "Yes – Upload my own config"
  28. And the "Require the use of Safe Exam Browser" select box should contain "Yes – Use SEB client config"
  29. And the field "Require the use of Safe Exam Browser" matches value "No"
  30. Scenario: Quiz can be edited without capability to select SEB template
  31. Given the following "permission override" exists:
  32. | role | editingteacher |
  33. | capability | quizaccess/seb:manage_seb_templateid |
  34. | permission | Prevent |
  35. | contextlevel | System |
  36. | reference | |
  37. And the following "user" exists:
  38. | username | teacher |
  39. | firstname | Teacher |
  40. | lastname | One |
  41. And the following "course enrolment" exists:
  42. | user | teacher |
  43. | course | C1 |
  44. | role | editingteacher |
  45. And I log in as "teacher"
  46. And I am on "Course 1" course homepage with editing mode on
  47. # Create the quiz.
  48. When I add a "Quiz" to section "0" and I fill the form with:
  49. | Name | My quiz |
  50. Then I should not see "Adding a new Quiz"
  51. # Edit the quiz.
  52. And I open "My quiz" actions menu
  53. And I click on "Edit settings" "link" in the "My quiz" activity
  54. And I set the field "Name" to "My quiz edited"
  55. And I press "Save and return to course"
  56. And I should not see "Updating: Quiz"
  57. Scenario: SEB settings if using No SEB
  58. Given the following "quizaccess_seb > seb templates" exist:
  59. | name |
  60. | Template 1 |
  61. And I log in as "admin"
  62. And I am on "Course 1" course homepage with editing mode on
  63. When I add a "Quiz" to section "1"
  64. And I expand all fieldsets
  65. And I set the field "Require the use of Safe Exam Browser" to "No"
  66. Then I should not see "Upload Safe Exam Browser config file"
  67. Then I should not see "Safe Exam Browser config template"
  68. Then I should not see "Template 1"
  69. Then I should not see "Show Safe Exam Browser download button"
  70. Then I should not see "Enable quitting of SEB"
  71. Then I should not see "Quit password"
  72. Then I should not see "Allowed browser exam keys"
  73. Then I should not see "Show Exit Safe Exam Browser button, configured with this quit link"
  74. Then I should not see "Ask user to confirm quitting"
  75. Then I should not see "Enable reload in exam"
  76. Then I should not see "Show SEB task bar"
  77. Then I should not see "Show reload button"
  78. Then I should not see "Show time"
  79. Then I should not see "Show keyboard layout"
  80. Then I should not see "Show Wi-Fi control"
  81. Then I should not see "Enable audio controls"
  82. Then I should not see "Mute on startup"
  83. Then I should not see "Enable spell checking"
  84. Then I should not see "Enable URL filtering"
  85. Then I should not see "Filter also embedded content"
  86. Then I should not see "Expressions allowed"
  87. Then I should not see "Regex allowed"
  88. Then I should not see "Expressions blocked"
  89. Then I should not see "Regex blocked"
  90. Scenario: SEB settings if using Use SEB client config
  91. Given the following "quizaccess_seb > seb templates" exist:
  92. | name |
  93. | Template 1 |
  94. And I log in as "admin"
  95. And I am on "Course 1" course homepage with editing mode on
  96. When I add a "Quiz" to section "1"
  97. And I expand all fieldsets
  98. And I set the field "Require the use of Safe Exam Browser" to "Yes – Use SEB client config"
  99. Then I should see "Show Safe Exam Browser download button"
  100. Then I should see "Allowed browser exam keys"
  101. Then I should not see "Upload Safe Exam Browser config file"
  102. Then I should not see "Safe Exam Browser config template"
  103. Then I should not see "Template 1"
  104. Then I should not see "Enable quitting of SEB"
  105. Then I should not see "Quit password"
  106. Then I should not see "Show Exit Safe Exam Browser button, configured with this quit link"
  107. Then I should not see "Ask user to confirm quitting"
  108. Then I should not see "Enable reload in exam"
  109. Then I should not see "Show SEB task bar"
  110. Then I should not see "Show reload button"
  111. Then I should not see "Show time"
  112. Then I should not see "Show keyboard layout"
  113. Then I should not see "Show Wi-Fi control"
  114. Then I should not see "Enable audio controls"
  115. Then I should not see "Mute on startup"
  116. Then I should not see "Enable spell checking"
  117. Then I should not see "Enable URL filtering"
  118. Then I should not see "Filter also embedded content"
  119. Then I should not see "Expressions allowed"
  120. Then I should not see "Regex allowed"
  121. Then I should not see "Expressions blocked"
  122. Then I should not see "Regex blocked"
  123. Scenario: SEB settings if using Upload my own config
  124. Given the following "quizaccess_seb > seb templates" exist:
  125. | name |
  126. | Template 1 |
  127. And I log in as "admin"
  128. And I am on "Course 1" course homepage with editing mode on
  129. When I add a "Quiz" to section "1"
  130. And I expand all fieldsets
  131. And I set the field "Require the use of Safe Exam Browser" to "Yes – Upload my own config"
  132. Then I should see "Upload Safe Exam Browser config file"
  133. Then I should see "Show Safe Exam Browser download button"
  134. Then I should not see "Enable quitting of SEB"
  135. Then I should not see "Quit password"
  136. Then I should see "Allowed browser exam keys"
  137. Then I should not see "Show Exit Safe Exam Browser button, configured with this quit link"
  138. Then I should not see "Ask user to confirm quitting"
  139. Then I should not see "Enable reload in exam"
  140. Then I should not see "Show SEB task bar"
  141. Then I should not see "Show reload button"
  142. Then I should not see "Show time"
  143. Then I should not see "Show keyboard layout"
  144. Then I should not see "Show Wi-Fi control"
  145. Then I should not see "Enable audio controls"
  146. Then I should not see "Mute on startup"
  147. Then I should not see "Enable spell checking"
  148. Then I should not see "Enable URL filtering"
  149. Then I should not see "Filter also embedded content"
  150. Then I should not see "Expressions allowed"
  151. Then I should not see "Regex allowed"
  152. Then I should not see "Expressions blocked"
  153. Then I should not see "Regex blocked"
  154. Then I should not see "Safe Exam Browser config template"
  155. Then I should not see "Template 1"
  156. Scenario: SEB settings if using Use an existing template
  157. Given the following "quizaccess_seb > seb templates" exist:
  158. | name |
  159. | Template 1 |
  160. And I log in as "admin"
  161. And I am on "Course 1" course homepage with editing mode on
  162. When I add a "Quiz" to section "1"
  163. And I expand all fieldsets
  164. And I set the field "Require the use of Safe Exam Browser" to "Yes – Use an existing template"
  165. Then I should see "Safe Exam Browser config template"
  166. Then I should see "Template 1"
  167. Then I should see "Show Safe Exam Browser download button"
  168. Then I should see "Enable quitting of SEB"
  169. Then I should see "Quit password"
  170. Then I should not see "Allowed browser exam keys"
  171. Then I should not see "Upload Safe Exam Browser config file"
  172. Then I should not see "Show Exit Safe Exam Browser button, configured with this quit link"
  173. Then I should not see "Ask user to confirm quitting"
  174. Then I should not see "Enable reload in exam"
  175. Then I should not see "Show SEB task bar"
  176. Then I should not see "Show reload button"
  177. Then I should not see "Show time"
  178. Then I should not see "Show keyboard layout"
  179. Then I should not see "Show Wi-Fi control"
  180. Then I should not see "Enable audio controls"
  181. Then I should not see "Mute on startup"
  182. Then I should not see "Enable spell checking"
  183. Then I should not see "Enable URL filtering"
  184. Then I should not see "Filter also embedded content"
  185. Then I should not see "Expressions allowed"
  186. Then I should not see "Regex allowed"
  187. Then I should not see "Expressions blocked"
  188. Then I should not see "Regex blocked"
  189. And I set the field "Enable quitting of SEB" to "No"
  190. Then I should not see "Quit password"
  191. Scenario: SEB settings if using Configure manually
  192. Given the following "quizaccess_seb > seb templates" exist:
  193. | name |
  194. | Template 1 |
  195. And I log in as "admin"
  196. And I am on "Course 1" course homepage with editing mode on
  197. When I add a "Quiz" to section "1"
  198. And I expand all fieldsets
  199. And I set the field "Require the use of Safe Exam Browser" to "Yes – Configure manually"
  200. Then I should see "Show Safe Exam Browser download button"
  201. Then I should see "Enable quitting of SEB"
  202. Then I should see "Quit password"
  203. Then I should see "Show Exit Safe Exam Browser button, configured with this quit link"
  204. Then I should see "Ask user to confirm quitting"
  205. Then I should see "Enable reload in exam"
  206. Then I should see "Show SEB task bar"
  207. Then I should see "Show reload button"
  208. Then I should see "Show time"
  209. Then I should see "Show keyboard layout"
  210. Then I should see "Show Wi-Fi control"
  211. Then I should see "Enable audio controls"
  212. Then I should not see "Mute on startup"
  213. Then I should see "Enable spell checking"
  214. Then I should see "Enable URL filtering"
  215. Then I should not see "Filter also embedded content"
  216. Then I should not see "Expressions allowed"
  217. Then I should not see "Regex allowed"
  218. Then I should not see "Expressions blocked"
  219. Then I should not see "Regex blocked"
  220. And I set the field "Enable quitting of SEB" to "No"
  221. Then I should not see "Quit password"
  222. And I set the field "Show SEB task bar" to "No"
  223. Then I should not see "Show reload button"
  224. Then I should not see "Show time"
  225. Then I should not see "Show keyboard layout"
  226. Then I should not see "Show Wi-Fi control"
  227. And I set the field "Enable audio controls" to "Yes"
  228. Then I should see "Mute on startup"
  229. And I set the field "Enable URL filtering" to "Yes"
  230. Then I should see "Filter also embedded content"
  231. Then I should see "Expressions allowed"
  232. Then I should see "Regex allowed"
  233. Then I should see "Expressions blocked"
  234. Then I should see "Regex blocked"
  235. Then I should not see "Upload Safe Exam Browser config file"
  236. Then I should not see "Allowed browser exam keys"
  237. Then I should not see "Safe Exam Browser config template"
  238. Then I should not see "Template 1"