Advertisement
Guest User

Untitled

a guest
May 20th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.54 KB | None | 0 0
  1. # Sample Test Definition Template
  2. # Possible steps:
  3. # Given
  4. # a fresh chess clock
  5. # When / And
  6. # I press the WHITE button
  7. # I press the BLACK button
  8. # I press the START button
  9. # I press the MOD button
  10. # I wait for (\d+) ms
  11. # I wait for (\d+) s
  12. # Then / And
  13. # the MAIN display should display the text '(.*)'
  14. # the WHITE display should display the number (\d+)
  15. # the BLACK display should display the number (\d+)
  16. # a BEEP should be made
  17. # NO BEEP should be made
  18. Feature: Chess clock
  19.  
  20. # settings test
  21.  
  22. Scenario: Pressing white and black button
  23. Given a fresh chess clock
  24. When I press the WHITE button
  25. And I press the BLACK button
  26. Then NO BEEP should be made
  27. And the MAIN display should display the text 'Ready to play'
  28.  
  29. Scenario: Settings test with only mod button
  30. Given a fresh chess clock
  31. When I press the MOD button
  32. Then a BEEP should be made
  33. And the MAIN display should display the text 'White begins'
  34. When I press the MOD button
  35. Then a BEEP should be made
  36. And the MAIN display should display the text 'White initial time'
  37. When I press the MOD button
  38. Then a BEEP should be made
  39. And the MAIN display should display the text 'Black initial time'
  40. When I press the MOD button
  41. Then a BEEP should be made
  42. And the MAIN display should display the text 'White increment time'
  43. When I press the MOD button
  44. Then a BEEP should be made
  45. And the MAIN display should display the text 'Black increment time'
  46. When I press the MOD button
  47. Then a BEEP should be made
  48. And the MAIN display should display the text 'Ready to play'
  49.  
  50. Scenario: White begins test
  51. Given a fresh chess clock
  52. When I press the MOD button
  53. Then a BEEP should be made
  54. And the MAIN display should display the text 'White begins'
  55. When I press the WHITE button
  56. Then the MAIN display should display the text 'White begins'
  57. And NO BEEP should be made
  58. When I press the BLACK button
  59. Then the MAIN display should display the text 'Black begins'
  60. And NO BEEP should be made
  61. When I press the START button
  62. Then the MAIN display should display the text 'White begins'
  63. And NO BEEP should be made
  64.  
  65. Scenario: White initial time test
  66. Given a fresh chess clock
  67. When I press the MOD button
  68. And I press the MOD button
  69. Then a BEEP should be made
  70. And the MAIN display should display the text 'White initial time'
  71. And the WHITE display should display the number 150
  72. When I press the WHITE button
  73. Then the WHITE display should display the number 155
  74. And NO BEEP should be made
  75. When I press the BLACK button
  76. Then the WHITE display should display the number 150
  77. And NO BEEP should be made
  78. When I press the WHITE button
  79. And I press the WHITE button
  80. And I press the WHITE button
  81. And I press the WHITE button
  82. And I press the WHITE button
  83. And I press the WHITE button
  84. Then the WHITE display should display the number 180
  85. And NO BEEP should be made
  86. When I press the WHITE button
  87. Then the WHITE display should display the number 180
  88. And NO BEEP should be made
  89. When I press the BLACK button
  90. And I press the BLACK button
  91. And I press the BLACK button
  92. And I press the BLACK button
  93. And I press the BLACK button
  94. And I press the BLACK button
  95. And I press the BLACK button
  96. And I press the BLACK button
  97. And I press the BLACK button
  98. And I press the BLACK button
  99. And I press the BLACK button
  100. And I press the BLACK button
  101. And I press the BLACK button
  102. And I press the BLACK button
  103. And I press the BLACK button
  104. And I press the BLACK button
  105. And I press the BLACK button
  106. And I press the BLACK button
  107. And I press the BLACK button
  108. And I press the BLACK button
  109. And I press the BLACK button
  110. And I press the BLACK button
  111. And I press the BLACK button
  112. And I press the BLACK button
  113. Then the WHITE display should display the number 60
  114. And NO BEEP should be made
  115. When I press the BLACK button
  116. Then the WHITE display should display the number 60
  117. And NO BEEP should be made
  118. When I press the START button
  119. Then the WHITE display should display the number 150
  120. And NO BEEP should be made
  121.  
  122. Scenario: Black initial time test
  123. Given a fresh chess clock
  124. When I press the MOD button
  125. And I press the MOD button
  126. And I press the MOD button
  127. Then a BEEP should be made
  128. And the MAIN display should display the text 'Black initial time'
  129. And the BLACK display should display the number 150
  130. When I press the WHITE button
  131. Then the BLACK display should display the number 155
  132. And NO BEEP should be made
  133. When I press the BLACK button
  134. Then the BLACK display should display the number 150
  135. And NO BEEP should be made
  136. When I press the WHITE button
  137. And I press the WHITE button
  138. And I press the WHITE button
  139. And I press the WHITE button
  140. And I press the WHITE button
  141. And I press the WHITE button
  142. Then the BLACK display should display the number 180
  143. And NO BEEP should be made
  144. When I press the WHITE button
  145. Then the BLACK display should display the number 180
  146. And NO BEEP should be made
  147. When I press the BLACK button
  148. And I press the BLACK button
  149. And I press the BLACK button
  150. And I press the BLACK button
  151. And I press the BLACK button
  152. And I press the BLACK button
  153. And I press the BLACK button
  154. And I press the BLACK button
  155. And I press the BLACK button
  156. And I press the BLACK button
  157. And I press the BLACK button
  158. And I press the BLACK button
  159. And I press the BLACK button
  160. And I press the BLACK button
  161. And I press the BLACK button
  162. And I press the BLACK button
  163. And I press the BLACK button
  164. And I press the BLACK button
  165. And I press the BLACK button
  166. And I press the BLACK button
  167. And I press the BLACK button
  168. And I press the BLACK button
  169. And I press the BLACK button
  170. And I press the BLACK button
  171. Then the BLACK display should display the number 60
  172. And NO BEEP should be made
  173. When I press the BLACK button
  174. Then the BLACK display should display the number 60
  175. And NO BEEP should be made
  176. When I press the START button
  177. Then the BLACK display should display the number 150
  178. And NO BEEP should be made
  179.  
  180. Scenario: White increment time test
  181. Given a fresh chess clock
  182. When I press the MOD button
  183. And I press the MOD button
  184. And I press the MOD button
  185. And I press the MOD button
  186. Then a BEEP should be made
  187. And the MAIN display should display the text 'White increment time'
  188. And the WHITE display should display the number 0
  189. When I press the WHITE button
  190. Then the WHITE display should display the number 5
  191. And NO BEEP should be made
  192. When I press the BLACK button
  193. Then the WHITE display should display the number 0
  194. And NO BEEP should be made
  195. When I press the BLACK button
  196. Then the WHITE display should display the number 0
  197. And NO BEEP should be made
  198. When I press the WHITE button
  199. And I press the WHITE button
  200. And I press the WHITE button
  201. And I press the WHITE button
  202. And I press the WHITE button
  203. And I press the WHITE button
  204. And I press the WHITE button
  205. And I press the WHITE button
  206. And I press the WHITE button
  207. And I press the WHITE button
  208. And I press the WHITE button
  209. And I press the WHITE button
  210. And I press the WHITE button
  211. And I press the WHITE button
  212. And I press the WHITE button
  213. And I press the WHITE button
  214. And I press the WHITE button
  215. And I press the WHITE button
  216. And I press the WHITE button
  217. And I press the WHITE button
  218. And I press the WHITE button
  219. And I press the WHITE button
  220. And I press the WHITE button
  221. And I press the WHITE button
  222. Then the WHITE display should display the number 120
  223. And NO BEEP should be made
  224. When I press the WHITE button
  225. Then the WHITE display should display the number 120
  226. And NO BEEP should be made
  227. When I press the START button
  228. Then the WHITE display should display the number 0
  229. And NO BEEP should be made
  230.  
  231.  
  232. Scenario: Black increment time test
  233. Given a fresh chess clock
  234. When I press the MOD button
  235. And I press the MOD button
  236. And I press the MOD button
  237. And I press the MOD button
  238. And I press the MOD button
  239. Then a BEEP should be made
  240. And the MAIN display should display the text 'Black increment time'
  241. And the BLACK display should display the number 0
  242. When I press the WHITE button
  243. Then the BLACK display should display the number 5
  244. And NO BEEP should be made
  245. When I press the BLACK button
  246. Then the BLACK display should display the number 0
  247. And NO BEEP should be made
  248. When I press the BLACK button
  249. Then the BLACK display should display the number 0
  250. And NO BEEP should be made
  251. When I press the WHITE button
  252. And I press the WHITE button
  253. And I press the WHITE button
  254. And I press the WHITE button
  255. And I press the WHITE button
  256. And I press the WHITE button
  257. And I press the WHITE button
  258. And I press the WHITE button
  259. And I press the WHITE button
  260. And I press the WHITE button
  261. And I press the WHITE button
  262. And I press the WHITE button
  263. And I press the WHITE button
  264. And I press the WHITE button
  265. And I press the WHITE button
  266. And I press the WHITE button
  267. And I press the WHITE button
  268. And I press the WHITE button
  269. And I press the WHITE button
  270. And I press the WHITE button
  271. And I press the WHITE button
  272. And I press the WHITE button
  273. And I press the WHITE button
  274. And I press the WHITE button
  275. Then the BLACK display should display the number 120
  276. And NO BEEP should be made
  277. When I press the WHITE button
  278. Then the BLACK display should display the number 120
  279. And NO BEEP should be made
  280. When I press the START button
  281. Then the BLACK display should display the number 0
  282. And NO BEEP should be made
  283.  
  284.  
  285. Scenario: Game test with whitefirst and white flag fallen and white beeps
  286. Given a fresh chess clock
  287. When I press the START button
  288. Then NO BEEP should be made
  289. And the BLACK display should display the number 150
  290. And the WHITE display should display the number 150
  291. And the MAIN display should display the text 'White moves'
  292. When I wait for 144 s
  293. Then NO BEEP should be made
  294. And the BLACK display should display the number 150
  295. And the WHITE display should display the number 6
  296. When I wait for 1 s
  297. Then a BEEP should be made
  298. And the WHITE display should display the number 5
  299. When I wait for 1 s
  300. Then a BEEP should be made
  301. And the WHITE display should display the number 4
  302. When I wait for 1 s
  303. Then a BEEP should be made
  304. And the WHITE display should display the number 3
  305. When I wait for 1 s
  306. Then a BEEP should be made
  307. And the WHITE display should display the number 2
  308. When I wait for 1 s
  309. Then a BEEP should be made
  310. And the WHITE display should display the number 1
  311. When I wait for 1 s
  312. Then a BEEP should be made
  313. And the BLACK display should display the number 150
  314. And the WHITE display should display the number 0
  315. And the MAIN display should display the text 'White flag fallen'
  316. When I press the START button
  317. Then the MAIN display should display the text 'Ready to play'
  318. And NO BEEP should be made
  319.  
  320. Scenario: Game test with blackfirst and black flag fallen and black beeps
  321. Given a fresh chess clock
  322. When I press the MOD button
  323. And I press the BLACK button
  324. And I press the MOD button
  325. And I press the MOD button
  326. And I press the MOD button
  327. And I press the MOD button
  328. And I press the MOD button
  329. When I press the START button
  330. Then NO BEEP should be made
  331. And the BLACK display should display the number 150
  332. And the WHITE display should display the number 150
  333. And the MAIN display should display the text 'Black moves'
  334. When I wait for 144 s
  335. Then NO BEEP should be made
  336. And the WHITE display should display the number 150
  337. And the BLACK display should display the number 6
  338. When I wait for 500 ms
  339. Then NO BEEP should be made
  340. And the BLACK display should display the number 6
  341. When I wait for 500 ms
  342. Then a BEEP should be made
  343. And the BLACK display should display the number 5
  344. When I wait for 1 s
  345. Then a BEEP should be made
  346. And the BLACK display should display the number 4
  347. When I wait for 1 s
  348. Then a BEEP should be made
  349. And the BLACK display should display the number 3
  350. When I wait for 1 s
  351. Then a BEEP should be made
  352. And the BLACK display should display the number 2
  353. When I wait for 1 s
  354. Then a BEEP should be made
  355. And the BLACK display should display the number 1
  356. When I wait for 1 s
  357. Then a BEEP should be made
  358. And the WHITE display should display the number 150
  359. And the BLACK display should display the number 0
  360. And the MAIN display should display the text 'Black flag fallen'
  361. When I press the START button
  362. Then the MAIN display should display the text 'Ready to play'
  363. And NO BEEP should be made
  364.  
  365. Scenario: Game test with pressing white and black button to max the time by increment time then rage quit
  366. Given a fresh chess clock
  367. When I press the MOD button
  368. And I press the MOD button
  369. And I press the MOD button
  370. And I press the MOD button
  371. And I press the WHITE button
  372. And I press the WHITE button
  373. And I press the WHITE button
  374. And I press the WHITE button
  375. And I press the WHITE button
  376. And I press the WHITE button
  377. And I press the WHITE button
  378. And I press the WHITE button
  379. And I press the WHITE button
  380. And I press the WHITE button
  381. And I press the WHITE button
  382. And I press the WHITE button
  383. And I press the WHITE button
  384. And I press the WHITE button
  385. And I press the WHITE button
  386. And I press the WHITE button
  387. And I press the WHITE button
  388. And I press the WHITE button
  389. And I press the WHITE button
  390. And I press the WHITE button
  391. Then the MAIN display should display the text 'White increment time'
  392. And the WHITE display should display the number 100
  393. When I press the MOD button
  394. And I press the WHITE button
  395. And I press the WHITE button
  396. And I press the WHITE button
  397. And I press the WHITE button
  398. And I press the WHITE button
  399. And I press the WHITE button
  400. And I press the WHITE button
  401. And I press the WHITE button
  402. And I press the WHITE button
  403. And I press the WHITE button
  404. And I press the WHITE button
  405. And I press the WHITE button
  406. And I press the WHITE button
  407. And I press the WHITE button
  408. And I press the WHITE button
  409. And I press the WHITE button
  410. And I press the WHITE button
  411. And I press the WHITE button
  412. And I press the WHITE button
  413. And I press the WHITE button
  414. Then the MAIN display should display the text 'Black increment time'
  415. And the BLACK display should display the number 100
  416. When I press the MOD button
  417. And I press the START button
  418. Then the MAIN display should display the text 'White moves'
  419. And the WHITE display should display the number 150
  420. And the BLACK display should display the number 150
  421. When I wait for 1 s
  422. Then NO BEEP should be made
  423. And the WHITE display should display the number 149
  424. When I press the WHITE button
  425. Then a BEEP should be made
  426. And the WHITE display should display the number 249
  427. And the BLACK display should display the number 150
  428. When I wait for 1 s
  429. Then NO BEEP should be made
  430. And the BLACK display should display the number 149
  431. When I press the BLACK button
  432. Then a BEEP should be made
  433. And the WHITE display should display the number 249
  434. And the BLACK display should display the number 249
  435. When I press the WHITE button
  436. Then a BEEP should be made
  437. And the WHITE display should display the number 349
  438. And the BLACK display should display the number 249
  439. When I press the BLACK button
  440. Then a BEEP should be made
  441. And the WHITE display should display the number 349
  442. And the BLACK display should display the number 349
  443. When I press the WHITE button
  444. Then a BEEP should be made
  445. And the WHITE display should display the number 449
  446. And the BLACK display should display the number 349
  447. When I press the BLACK button
  448. Then a BEEP should be made
  449. And the WHITE display should display the number 449
  450. And the BLACK display should display the number 449
  451. When I press the WHITE button
  452. And I press the BLACK button
  453. And I press the WHITE button
  454. And I press the BLACK button
  455. And I press the WHITE button
  456. And I press the BLACK button
  457. And I press the WHITE button
  458. And I press the BLACK button
  459. And I press the WHITE button
  460. And I press the BLACK button
  461. And I press the WHITE button
  462. And I press the BLACK button
  463. And I press the WHITE button
  464. And I press the BLACK button
  465. Then a BEEP should be made
  466. And the WHITE display should display the number 1149
  467. And the BLACK display should display the number 1149
  468. When I press the WHITE button
  469. Then a BEEP should be made
  470. And the WHITE display should display the number 1200
  471. And the BLACK display should display the number 1149
  472. When I press the BLACK button
  473. Then a BEEP should be made
  474. And the WHITE display should display the number 1200
  475. And the BLACK display should display the number 1200
  476. When I press the START button
  477. Then NO BEEP should be made
  478. And the MAIN display should display the text 'Ready to play'
  479.  
  480. Scenario: exit from the game from each state
  481. Given a fresh chess clock
  482. When I press the START button
  483. Then the MAIN display should display the text 'White moves'
  484. When I press the WHITE button
  485. Then the MAIN display should display the text 'Black moves'
  486. When I press the START button
  487. Then the MAIN display should display the text 'Ready to play'
  488. And NO BEEP should be made
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement