option-correctness.feature 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. Feature: Full vote correctness evaluator on non-encrypted values
  2. Scenario: No rule specified
  3. When evaluating correctness for a ballot containing selection vo1, vo2
  4. Then the correctness should pass
  5. Then finish correctness test
  6. Scenario: 2 voting sections, minimum selections is not reached in one section, FAIL
  7. Given a voting section with name section1, with minimum non-blank selections 1 and maximum selections 3 and with non-blank options vo1, vo2, vo3
  8. Given a voting section with name section2, with minimum non-blank selections 1 and maximum selections 2 and with non-blank options vo4, vo5, vo6
  9. When evaluating correctness for a ballot containing selection vo5
  10. Then the correctness should fail
  11. Then the error should be MIN_ERROR, section1
  12. Then the error should be MAX_ERROR, section1
  13. Then the error should be MAX_ERROR, section2
  14. Then the error does not contain any additional messages
  15. Then finish correctness test
  16. Scenario: 2 voting sections, minimum selections is not reached in both of the sections, FAIL
  17. Given a voting section with name section1, with minimum non-blank selections 1 and maximum selections 3 and with non-blank options vo1, vo2, vo3
  18. Given a voting section with name section2, with minimum non-blank selections 2 and maximum selections 2 and with non-blank options vo4, vo5, vo6
  19. When evaluating correctness for a ballot containing selection vo4
  20. Then the correctness should fail
  21. Then the error should be MIN_ERROR, section1
  22. Then the error should be MIN_ERROR, section2
  23. Then the error should be MAX_ERROR, section1
  24. Then the error should be MAX_ERROR, section2
  25. Then the error does not contain any additional messages
  26. Then finish correctness test
  27. Scenario: 1 voting section, min blank options respected with full selection PASS
  28. Given a voting section with name section1, with minimum non-blank selections 2 and maximum selections 5, and with blank options vo1, vo2, vo3 and with non-blank options vo4, vo5, vo6, vo7
  29. When evaluating correctness for a ballot containing selection vo4, vo5, vo1, vo2, vo3
  30. Then the correctness should pass
  31. Then finish correctness test
  32. Scenario: 1 voting section, min non-blank options not respected FAIL
  33. Given allow full blank false
  34. Given a voting section with name section1, with minimum non-blank selections 2 and maximum selections 3, and with blank options vo1 and with non-blank options vo2, vo3, vo4, vo5
  35. When evaluating correctness for a ballot containing selection vo1, vo2
  36. Then the correctness should fail
  37. Then the error should be MIN_NON_BLANK_ERROR, section1
  38. Then the error should be MAX_ERROR, section1
  39. Then the error does not contain any additional messages
  40. Then finish correctness test
  41. Scenario: 1 voting section, min non-blank options respected with some selections there is allow blank FAIL
  42. Given allow full blank true
  43. Given a voting section with name section1, with minimum non-blank selections 2 and maximum selections 3, and with blank options vo1, vo2, vo3 and with non-blank options vo4, vo5
  44. When evaluating correctness for a ballot containing selection vo1, vo4
  45. Then the correctness should fail
  46. Then the error should be MIN_NON_BLANK_ERROR, section1
  47. Then the error should be MAX_ERROR, section1
  48. Then the error does not contain any additional messages
  49. Then finish correctness test
  50. Scenario: 1 voting section, min non-blank options not respected but there is allow blank PASS
  51. Given allow full blank true
  52. Given a voting section with name section1, with minimum non-blank selections 2 and maximum selections 3, and with blank options vo1, vo2, vo3 and with non-blank options vo4, vo5
  53. When evaluating correctness for a ballot containing selection vo1, vo2, vo3
  54. Then the correctness should pass
  55. Then finish correctness test
  56. Scenario: 1 voting section, min non-blank options not respected but there is allow blank FAIL
  57. Given allow full blank false
  58. Given a voting section with name section1, with minimum non-blank selections 2 and maximum selections 3, and with blank options vo1, vo2, vo3 and with non-blank options vo4, vo5
  59. When evaluating correctness for a ballot containing selection vo1, vo2, vo4
  60. Then the correctness should fail
  61. Then the error should be MIN_NON_BLANK_ERROR, section1
  62. Then the error does not contain any additional messages
  63. Then finish correctness test
  64. Scenario: 1 voting section, min blank options not respected but there is allow blank FAIL
  65. Given allow full blank false
  66. Given a voting section with name section1, with minimum non-blank selections 2 and maximum selections 3, and with blank options vo1, vo2, vo3 and with non-blank options vo4, vo5
  67. When evaluating correctness for a ballot containing selection vo1, vo2
  68. Then the correctness should fail
  69. Then the error should be MIN_NON_BLANK_ERROR, section1
  70. Then the error should be MAX_ERROR, section1
  71. Then the error does not contain any additional messages
  72. Then finish correctness test
  73. Scenario: 3 voting section, min selection not respected in selection that has no blank FAIL
  74. Given allow full blank false
  75. Given a voting section with name ed339b83ba544b28a97931f41b85088a, with minimum non-blank selections 1 and maximum selections 1 and with non-blank options 2, 11
  76. Given a voting section with name 11fb4d75dabb4f1ca180f690ed4e76f8, with minimum non-blank selections 0 and maximum selections 1, and with blank options 29 and with non-blank options 5, 17
  77. Given a voting section with name 76cf7bc5e07b4013ab8945a87b7758a3, with minimum non-blank selections 0 and maximum selections 1, and with blank options 13 and with non-blank options 3, 23
  78. When evaluating correctness for a ballot containing selection 29, 13
  79. Then the correctness should fail
  80. Then the error should be MIN_ERROR, ed339b83ba544b28a97931f41b85088a
  81. Then the error should be MAX_ERROR, ed339b83ba544b28a97931f41b85088a
  82. Then the error does not contain any additional messages
  83. Then finish correctness test
  84. Scenario: 2 voting section, min non-blank options not respected in one of them FAIL
  85. Given allow full blank false
  86. Given a voting section with name section1, with minimum non-blank selections 2 and maximum selections 3, and with blank options vo1 and with non-blank options vo2, vo3, vo4, vo5
  87. Given a voting section with name section2, with minimum non-blank selections 2 and maximum selections 3, and with blank options vo6 and with non-blank options vo7, vo8, vo9, vo10
  88. When evaluating correctness for a ballot containing selection vo2, vo3, vo6, vo7
  89. Then the correctness should fail
  90. Then the error should be MIN_NON_BLANK_ERROR, section2
  91. Then the error should be MAX_ERROR, section1
  92. Then the error should be MAX_ERROR, section2
  93. Then the error does not contain any additional messages
  94. Then finish correctness test
  95. Scenario: 2 voting section, min non-blank options not respected in one of them even if there is allow blank FAIL
  96. Given allow full blank true
  97. Given a voting section with name section1, with minimum non-blank selections 2 and maximum selections 3, and with blank options vo1, vo12, vo13 and with non-blank options vo2, vo3, vo4, vo5
  98. Given a voting section with name section2, with minimum non-blank selections 2 and maximum selections 3, and with blank options vo6, vo61, vo62 and with non-blank options vo7, vo8, vo9, vo10
  99. When evaluating correctness for a ballot containing selection vo1, vo12, vo3, vo6, vo61, vo62
  100. Then the error should be MIN_NON_BLANK_ERROR, section1
  101. Then the error should be MIN_NON_BLANK_ERROR, section2
  102. Then the error does not contain any additional messages
  103. Then finish correctness test
  104. Scenario: 2 voting section, min blank options are not respected in either of them because no selections but there is allow blank PASS
  105. Given allow full blank true
  106. Given a voting section with name section1, with minimum non-blank selections 2 and maximum selections 3, and with blank options vo1, vo12, vo13 and with non-blank options vo2, vo3, vo4, vo5
  107. Given a voting section with name section2, with minimum non-blank selections 2 and maximum selections 3, and with blank options vo6, vo61, vo62 and with non-blank options vo7, vo8, vo9, vo10
  108. When evaluating correctness for a ballot containing selection vo1, vo12, vo13, vo6, vo61, vo62
  109. Then the correctness should pass
  110. Then finish correctness test
  111. Scenario: 2 voting section, full blank is false, but min non-blank selections are 0, only blanks selected PASS
  112. Given allow full blank false
  113. Given a voting section with name section1, with minimum non-blank selections 0 and maximum selections 1, and with blank options vo1 and with non-blank options vo2, vo3
  114. Given a voting section with name section2, with minimum non-blank selections 0 and maximum selections 1, and with blank options vo6 and with non-blank options vo7, vo8
  115. When evaluating correctness for a ballot containing selection vo1, vo6
  116. Then the correctness should pass
  117. Then finish correctness test
  118. Scenario: 2 voting section, min non-blank options not respected in one of them even if there is allow blank FAIL
  119. Given allow full blank true
  120. Given a voting section with name section1, with minimum non-blank selections 2 and maximum selections 3, and with blank options vo1, vo12, vo13 and with non-blank options vo2, vo3, vo4, vo5
  121. Given a voting section with name section2, with minimum non-blank selections 2 and maximum selections 3, and with blank options vo6, vo61, vo62 and with non-blank options vo7, vo8, vo9, vo10
  122. When evaluating correctness for a ballot containing selection vo1, vo2, vo3, vo6, vo61, vo62
  123. Then the error should be MIN_NON_BLANK_ERROR, section2
  124. Then the error does not contain any additional messages
  125. Then finish correctness test
  126. Scenario: Correctness fails if selection is not present in the available voting options and the minimum selections is not reached in one of the 2 different voting sections
  127. Given a voting section with name section1, with minimum non-blank selections 1 and maximum selections 3 and with non-blank options vo1, vo2, vo3
  128. Given a voting section with name section2, with minimum non-blank selections 1 and maximum selections 2 and with non-blank options vo4, vo5, vo6
  129. When evaluating correctness for a ballot containing selection vo8
  130. Then the correctness should fail
  131. Then the error should be MIN_ERROR, section1
  132. Then the error should be MIN_ERROR, section2
  133. Then the error should be MAX_ERROR, section1
  134. Then the error should be MAX_ERROR, section2
  135. Then the error does not contain any additional messages
  136. Then finish correctness test
  137. Scenario: Correctness fails if selection is not present in the available voting options and the minimum selections is not reached in both of the 2 different voting sections
  138. Given a voting section with name section1, with minimum non-blank selections 2 and maximum selections 3 and with non-blank options vo1, vo2, vo3
  139. Given a voting section with name section2, with minimum non-blank selections 2 and maximum selections 2 and with non-blank options vo4, vo5, vo6
  140. When evaluating correctness for a ballot containing selection vo7, vo8
  141. Then the correctness should fail
  142. Then the error should be MIN_ERROR, section1
  143. Then the error should be MIN_ERROR, section2
  144. Then the error should be MAX_ERROR, section1
  145. Then the error should be MAX_ERROR, section2
  146. Then the error does not contain any additional messages
  147. Then finish correctness test
  148. Scenario: Correctness fails if the maximum selections is exceeded in one of the 2 different voting sections
  149. Given a voting section with name section1, with minimum non-blank selections 1 and maximum selections 2 and with non-blank options vo1, vo2, vo3
  150. Given a voting section with name section2, with minimum non-blank selections 1 and maximum selections 1 and with non-blank options vo4, vo5, vo6
  151. When evaluating correctness for a ballot containing selection vo5, vo1, vo2, vo6
  152. Then the correctness should fail
  153. Then the error should be MAX_ERROR, section2
  154. Then finish correctness test
  155. Scenario: Correctness fails if the maximum selections is exceeded in both of the 2 different voting sections
  156. Given a voting section with name section1, with minimum non-blank selections 1 and maximum selections 1 and with non-blank options vo1, vo2, vo3
  157. Given a voting section with name section2, with minimum non-blank selections 1 and maximum selections 1 and with non-blank options vo4, vo5, vo6
  158. When evaluating correctness for a ballot containing selection vo5, vo1, vo2, vo6
  159. Then the correctness should fail
  160. Then the error should be MAX_ERROR, section1
  161. Then the error should be MAX_ERROR, section2
  162. Then finish correctness test
  163. Scenario: 1 voting section + 3 candidates + Accumulation 1, PASS
  164. Given a voting section with name section1, with minimum non-blank selections 1 and maximum selections 3 and with non-blank options vo1, vo2, vo3
  165. # Given accumulation not allowed (accumulation 1)
  166. When evaluating correctness for a ballot containing selection vo1, vo2, vo3
  167. Then the correctness should pass
  168. Then the error does not contain any additional messages
  169. Then finish correctness test
  170. Scenario: 1 voting section + 3 candidates + Accumulation 2, PASS
  171. Given a voting section with name section1, with minimum non-blank selections 1 and maximum selections 3 and with non-blank options vo1, vo2, vo3, vo4, vo5, vo6
  172. # Given accumulation allowed (accumulation 2)
  173. When evaluating correctness for a ballot containing selection vo1, vo2, vo3
  174. Then the correctness should pass
  175. Then the error does not contain any additional messages
  176. Then finish correctness test
  177. Scenario: 2 voting sections + Accumulation 2, PASS
  178. Given a voting section with name section1, with minimum non-blank selections 2 and maximum selections 5 and with non-blank options vo1, vo2, vo3, vo4, vo5, vo6, vo11, vo12, vo13, vo14, vo15, vo16
  179. Given a voting section with name section2, with minimum non-blank selections 1 and maximum selections 3 and with non-blank options vo21, vo22, vo23, vo24, vo25, vo26, vo31, vo32, vo33, vo34, vo35, vo36
  180. # Given accumulation allowed (accumulation 2)
  181. When evaluating correctness for a ballot containing selection vo1, vo2, vo3, vo4, vo5, vo21, vo32, vo22
  182. Then the correctness should pass
  183. Then finish correctness test
  184. Scenario: Fusion + Accumulation 1, PASS
  185. Given a voting section with name section1, with minimum non-blank selections 1 and maximum selections 2 and with non-blank options vo1, vo2, vo3, vo4, vo5, vo6
  186. Given fusion with accumulation 1 is defined for section1 with values [vo1, vo2, vo3], [vo4, vo5, vo6]
  187. When evaluating correctness for a ballot containing selection vo1, vo4
  188. Then the correctness should pass
  189. Then finish correctness test
  190. Scenario: Fusion + Accumulation 1, fusion violation, FAIL
  191. Given a voting section with name section1, with minimum non-blank selections 1 and maximum selections 2 and with non-blank options vo1, vo2, vo3, vo4, vo5, vo6
  192. Given fusion with accumulation 1 is defined for section1 with values [vo1, vo2, vo3], [vo4, vo5, vo6]
  193. When evaluating correctness for a ballot containing selection vo1, vo2
  194. Then the correctness should fail
  195. Then the error should be ACCUMULATION_ERROR, vo1
  196. Then the error should be ACCUMULATION_ERROR, vo2
  197. Then finish correctness test
  198. Scenario: Fusion + Accumulation 2, voting the same candidate on different lists, PASS
  199. Given a voting section with name section1, with minimum non-blank selections 1 and maximum selections 2 and with non-blank options vo1, vo2, vo3, vo4, vo5, vo6, vo7, vo8, vo9, vo10, vo11, vo12
  200. Given fusion with accumulation 2 is defined for section1 with values [vo1, vo2, vo3, vo7, vo8, vo9], [vo4, vo5, vo6, vo10, vo11, vo12]
  201. When evaluating correctness for a ballot containing selection vo1, vo2
  202. Then the correctness should pass
  203. Then finish correctness test
  204. Scenario: Fusion + Accumulation 2, voting the same candidate on different lists, FAIL
  205. Given a voting section with name section1, with minimum non-blank selections 1 and maximum selections 4 and with non-blank options vo1, vo2, vo3, vo4, vo5, vo6, vo7, vo8, vo9, vo10, vo11, vo12
  206. Given fusion with accumulation 2 is defined for section1 with values [vo1, vo2, vo3, vo7, vo8, vo9], [vo4, vo5, vo6, vo10, vo11, vo12]
  207. When evaluating correctness for a ballot containing selection vo1, vo2, vo3, vo4
  208. Then the correctness should fail
  209. Then the error should be ACCUMULATION_ERROR, vo1
  210. Then the error should be ACCUMULATION_ERROR, vo2
  211. Then the error should be ACCUMULATION_ERROR, vo3
  212. Then the error does not contain any additional messages
  213. Then finish correctness test
  214. Scenario: Fusion + Accumulation 2, voting the same candidate on different lists, FAIL
  215. Given a voting section with name section1, with minimum non-blank selections 1 and maximum selections 4 and with non-blank options vo1, vo2, vo3, vo4, vo5, vo6, vo7, vo8, vo9
  216. Given fusion with accumulation 2 is defined for section1 with values [vo1, vo2, vo3, vo7, vo8, vo9], [vo4, vo5, vo6]
  217. Given a voting section with name section2, with minimum non-blank selections 1 and maximum selections 4 and with non-blank options vo11, vo12, vo13, vo14, vo15, vo16, vo17, vo18, vo19
  218. Given fusion with accumulation 2 is defined for section2 with values [vo11, vo12, vo13, vo17, vo18, vo19], [vo14, vo15, vo16]
  219. When evaluating correctness for a ballot containing selection vo1, vo2, vo3, vo7, vo8, vo11, vo12, vo13, vo17, vo18
  220. Then the correctness should fail
  221. Then the error should be ACCUMULATION_ERROR, vo1
  222. Then the error should be ACCUMULATION_ERROR, vo2
  223. Then the error should be ACCUMULATION_ERROR, vo3
  224. Then the error should be ACCUMULATION_ERROR, vo7
  225. Then the error should be ACCUMULATION_ERROR, vo8
  226. Then the error should be ACCUMULATION_ERROR, vo11
  227. Then the error should be ACCUMULATION_ERROR, vo12
  228. Then the error should be ACCUMULATION_ERROR, vo13
  229. Then the error should be ACCUMULATION_ERROR, vo17
  230. Then the error should be ACCUMULATION_ERROR, vo18
  231. Then the error should be MAX_ERROR, section1
  232. Then the error should be MAX_ERROR, section2
  233. Then the error does not contain any additional messages
  234. Then finish correctness test
  235. Scenario: Fusion + Accumulation 2, voting the same candidate on different lists, PASS
  236. Given a voting section with name section1, with minimum non-blank selections 1 and maximum selections 6 and with non-blank options vo1, vo2, vo3, vo4, vo5, vo6, vo7, vo8, vo9
  237. Given fusion with accumulation 3 is defined for section1 with values [vo1, vo2, vo3, vo7, vo8, vo9], [vo4, vo5, vo6]
  238. Given a voting section with name section2, with minimum non-blank selections 1 and maximum selections 6 and with non-blank options vo11, vo12, vo13, vo14, vo15, vo16, vo17, vo18, vo19
  239. Given fusion with accumulation 3 is defined for section2 with values [vo11, vo12, vo13, vo17, vo18, vo19], [vo14, vo15, vo16]
  240. When evaluating correctness for a ballot containing selection vo1, vo2, vo3, vo4, vo5, vo6, vo11, vo12, vo13, vo14, vo15, vo16
  241. Then the correctness should pass
  242. Then finish correctness test
  243. Scenario: Fusion + Accumulation 2, fusion violation, FAIL
  244. Given a voting section with name section1, with minimum non-blank selections 1 and maximum selections 2 and with non-blank options vo1, vo2, vo3, vo4, vo5, vo6, vo7, vo8, vo9, vo10, vo11, vo12
  245. Given fusion with accumulation 2 is defined for section1 with values [vo1, vo2, vo3, vo7, vo8, vo9], [vo4, vo5, vo6, vo10, vo11, vo12]
  246. When evaluating correctness for a ballot containing selection vo1, vo2, vo8, vo11
  247. Then the correctness should fail
  248. Then the error should be ACCUMULATION_ERROR, vo1
  249. Then the error should be ACCUMULATION_ERROR, vo2
  250. Then the error should be ACCUMULATION_ERROR, vo8
  251. Then the error should be MAX_ERROR, section1
  252. Then the error does not contain any additional messages
  253. Then finish correctness test
  254. Scenario: Fusion + Accumulation 2, maximum selections is exceeded, FAIL
  255. Given a voting section with name section1, with minimum non-blank selections 1 and maximum selections 2 and with non-blank options vo1, vo2, vo3, vo4, vo5, vo6, vo7, vo8, vo9, vo10, vo11, vo12
  256. Given fusion with accumulation 2 is defined for section1 with values [vo1, vo2, vo3, vo7, vo8, vo9], [vo4, vo5, vo6, vo10, vo11, vo12]
  257. When evaluating correctness for a ballot containing selection vo1, vo2, vo11
  258. Then the correctness should fail
  259. Then the error should be MAX_ERROR, section1
  260. Then finish correctness test
  261. Scenario: Fusion + Accumulation 2, maximum selections is exceeded + invalid selection + fusion violation, FAIL
  262. Given a voting section with name section1, with minimum non-blank selections 2 and maximum selections 3 and with non-blank options vo1, vo2, vo3, vo4, vo5, vo6
  263. Given fusion with accumulation 2 is defined for section1 with values [vo1, vo2, vo3], [vo4, vo5, vo6]
  264. When evaluating correctness for a ballot containing selection vo1, vo2, vo3, vo11, vo21
  265. Then the correctness should fail
  266. Then the error should be ACCUMULATION_ERROR, vo1
  267. Then the error should be ACCUMULATION_ERROR, vo2
  268. Then the error should be ACCUMULATION_ERROR, vo3
  269. Then the error does not contain any additional messages
  270. Then finish correctness test