Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Sample Test Definition Template
- # Possible steps:
- # Given
- # a fresh chess clock
- # When / And
- # I press the WHITE button
- # I press the BLACK button
- # I press the START button
- # I press the MOD button
- # I wait for (\d+) ms
- # I wait for (\d+) s
- # Then / And
- # the MAIN display should display the text '(.*)'
- # the WHITE display should display the number (\d+)
- # the BLACK display should display the number (\d+)
- # a BEEP should be made
- # NO BEEP should be made
- Feature: Chess clock
- # settings test
- Scenario: Pressing white and black button
- Given a fresh chess clock
- When I press the WHITE button
- And I press the BLACK button
- Then NO BEEP should be made
- And the MAIN display should display the text 'Ready to play'
- Scenario: Settings test with only mod button
- Given a fresh chess clock
- When I press the MOD button
- Then a BEEP should be made
- And the MAIN display should display the text 'White begins'
- When I press the MOD button
- Then a BEEP should be made
- And the MAIN display should display the text 'White initial time'
- When I press the MOD button
- Then a BEEP should be made
- And the MAIN display should display the text 'Black initial time'
- When I press the MOD button
- Then a BEEP should be made
- And the MAIN display should display the text 'White increment time'
- When I press the MOD button
- Then a BEEP should be made
- And the MAIN display should display the text 'Black increment time'
- When I press the MOD button
- Then a BEEP should be made
- And the MAIN display should display the text 'Ready to play'
- Scenario: White begins test
- Given a fresh chess clock
- When I press the MOD button
- Then a BEEP should be made
- And the MAIN display should display the text 'White begins'
- When I press the WHITE button
- Then the MAIN display should display the text 'White begins'
- And NO BEEP should be made
- When I press the BLACK button
- Then the MAIN display should display the text 'Black begins'
- And NO BEEP should be made
- When I press the START button
- Then the MAIN display should display the text 'White begins'
- And NO BEEP should be made
- Scenario: White initial time test
- Given a fresh chess clock
- When I press the MOD button
- And I press the MOD button
- Then a BEEP should be made
- And the MAIN display should display the text 'White initial time'
- And the WHITE display should display the number 150
- When I press the WHITE button
- Then the WHITE display should display the number 155
- And NO BEEP should be made
- When I press the BLACK button
- Then the WHITE display should display the number 150
- And NO BEEP should be made
- When I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- Then the WHITE display should display the number 180
- And NO BEEP should be made
- When I press the WHITE button
- Then the WHITE display should display the number 180
- And NO BEEP should be made
- When I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- Then the WHITE display should display the number 60
- And NO BEEP should be made
- When I press the BLACK button
- Then the WHITE display should display the number 60
- And NO BEEP should be made
- When I press the START button
- Then the WHITE display should display the number 150
- And NO BEEP should be made
- Scenario: Black initial time test
- Given a fresh chess clock
- When I press the MOD button
- And I press the MOD button
- And I press the MOD button
- Then a BEEP should be made
- And the MAIN display should display the text 'Black initial time'
- And the BLACK display should display the number 150
- When I press the WHITE button
- Then the BLACK display should display the number 155
- And NO BEEP should be made
- When I press the BLACK button
- Then the BLACK display should display the number 150
- And NO BEEP should be made
- When I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- Then the BLACK display should display the number 180
- And NO BEEP should be made
- When I press the WHITE button
- Then the BLACK display should display the number 180
- And NO BEEP should be made
- When I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- And I press the BLACK button
- Then the BLACK display should display the number 60
- And NO BEEP should be made
- When I press the BLACK button
- Then the BLACK display should display the number 60
- And NO BEEP should be made
- When I press the START button
- Then the BLACK display should display the number 150
- And NO BEEP should be made
- Scenario: White increment time test
- Given a fresh chess clock
- When I press the MOD button
- And I press the MOD button
- And I press the MOD button
- And I press the MOD button
- Then a BEEP should be made
- And the MAIN display should display the text 'White increment time'
- And the WHITE display should display the number 0
- When I press the WHITE button
- Then the WHITE display should display the number 5
- And NO BEEP should be made
- When I press the BLACK button
- Then the WHITE display should display the number 0
- And NO BEEP should be made
- When I press the BLACK button
- Then the WHITE display should display the number 0
- And NO BEEP should be made
- When I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- Then the WHITE display should display the number 120
- And NO BEEP should be made
- When I press the WHITE button
- Then the WHITE display should display the number 120
- And NO BEEP should be made
- When I press the START button
- Then the WHITE display should display the number 0
- And NO BEEP should be made
- Scenario: Black increment time test
- Given a fresh chess clock
- When I press the MOD button
- And I press the MOD button
- And I press the MOD button
- And I press the MOD button
- And I press the MOD button
- Then a BEEP should be made
- And the MAIN display should display the text 'Black increment time'
- And the BLACK display should display the number 0
- When I press the WHITE button
- Then the BLACK display should display the number 5
- And NO BEEP should be made
- When I press the BLACK button
- Then the BLACK display should display the number 0
- And NO BEEP should be made
- When I press the BLACK button
- Then the BLACK display should display the number 0
- And NO BEEP should be made
- When I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- Then the BLACK display should display the number 120
- And NO BEEP should be made
- When I press the WHITE button
- Then the BLACK display should display the number 120
- And NO BEEP should be made
- When I press the START button
- Then the BLACK display should display the number 0
- And NO BEEP should be made
- Scenario: Game test with whitefirst and white flag fallen and white beeps
- Given a fresh chess clock
- When I press the START button
- Then NO BEEP should be made
- And the BLACK display should display the number 150
- And the WHITE display should display the number 150
- And the MAIN display should display the text 'White moves'
- When I wait for 144 s
- Then NO BEEP should be made
- And the BLACK display should display the number 150
- And the WHITE display should display the number 6
- When I wait for 1 s
- Then a BEEP should be made
- And the WHITE display should display the number 5
- When I wait for 1 s
- Then a BEEP should be made
- And the WHITE display should display the number 4
- When I wait for 1 s
- Then a BEEP should be made
- And the WHITE display should display the number 3
- When I wait for 1 s
- Then a BEEP should be made
- And the WHITE display should display the number 2
- When I wait for 1 s
- Then a BEEP should be made
- And the WHITE display should display the number 1
- When I wait for 1 s
- Then a BEEP should be made
- And the BLACK display should display the number 150
- And the WHITE display should display the number 0
- And the MAIN display should display the text 'White flag fallen'
- When I press the START button
- Then the MAIN display should display the text 'Ready to play'
- And NO BEEP should be made
- Scenario: Game test with blackfirst and black flag fallen and black beeps
- Given a fresh chess clock
- When I press the MOD button
- And I press the BLACK button
- And I press the MOD button
- And I press the MOD button
- And I press the MOD button
- And I press the MOD button
- And I press the MOD button
- When I press the START button
- Then NO BEEP should be made
- And the BLACK display should display the number 150
- And the WHITE display should display the number 150
- And the MAIN display should display the text 'Black moves'
- When I wait for 144 s
- Then NO BEEP should be made
- And the WHITE display should display the number 150
- And the BLACK display should display the number 6
- When I wait for 500 ms
- Then NO BEEP should be made
- And the BLACK display should display the number 6
- When I wait for 500 ms
- Then a BEEP should be made
- And the BLACK display should display the number 5
- When I wait for 1 s
- Then a BEEP should be made
- And the BLACK display should display the number 4
- When I wait for 1 s
- Then a BEEP should be made
- And the BLACK display should display the number 3
- When I wait for 1 s
- Then a BEEP should be made
- And the BLACK display should display the number 2
- When I wait for 1 s
- Then a BEEP should be made
- And the BLACK display should display the number 1
- When I wait for 1 s
- Then a BEEP should be made
- And the WHITE display should display the number 150
- And the BLACK display should display the number 0
- And the MAIN display should display the text 'Black flag fallen'
- When I press the START button
- Then the MAIN display should display the text 'Ready to play'
- And NO BEEP should be made
- Scenario: Game test with pressing white and black button to max the time by increment time then rage quit
- Given a fresh chess clock
- When I press the MOD button
- And I press the MOD button
- And I press the MOD button
- And I press the MOD button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- Then the MAIN display should display the text 'White increment time'
- And the WHITE display should display the number 100
- When I press the MOD button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- And I press the WHITE button
- Then the MAIN display should display the text 'Black increment time'
- And the BLACK display should display the number 100
- When I press the MOD button
- And I press the START button
- Then the MAIN display should display the text 'White moves'
- And the WHITE display should display the number 150
- And the BLACK display should display the number 150
- When I wait for 1 s
- Then NO BEEP should be made
- And the WHITE display should display the number 149
- When I press the WHITE button
- Then a BEEP should be made
- And the WHITE display should display the number 249
- And the BLACK display should display the number 150
- When I wait for 1 s
- Then NO BEEP should be made
- And the BLACK display should display the number 149
- When I press the BLACK button
- Then a BEEP should be made
- And the WHITE display should display the number 249
- And the BLACK display should display the number 249
- When I press the WHITE button
- Then a BEEP should be made
- And the WHITE display should display the number 349
- And the BLACK display should display the number 249
- When I press the BLACK button
- Then a BEEP should be made
- And the WHITE display should display the number 349
- And the BLACK display should display the number 349
- When I press the WHITE button
- Then a BEEP should be made
- And the WHITE display should display the number 449
- And the BLACK display should display the number 349
- When I press the BLACK button
- Then a BEEP should be made
- And the WHITE display should display the number 449
- And the BLACK display should display the number 449
- When I press the WHITE button
- And I press the BLACK button
- And I press the WHITE button
- And I press the BLACK button
- And I press the WHITE button
- And I press the BLACK button
- And I press the WHITE button
- And I press the BLACK button
- And I press the WHITE button
- And I press the BLACK button
- And I press the WHITE button
- And I press the BLACK button
- And I press the WHITE button
- And I press the BLACK button
- Then a BEEP should be made
- And the WHITE display should display the number 1149
- And the BLACK display should display the number 1149
- When I press the WHITE button
- Then a BEEP should be made
- And the WHITE display should display the number 1200
- And the BLACK display should display the number 1149
- When I press the BLACK button
- Then a BEEP should be made
- And the WHITE display should display the number 1200
- And the BLACK display should display the number 1200
- When I press the START button
- Then NO BEEP should be made
- And the MAIN display should display the text 'Ready to play'
- Scenario: exit from the game from each state
- Given a fresh chess clock
- When I press the START button
- Then the MAIN display should display the text 'White moves'
- When I press the WHITE button
- Then the MAIN display should display the text 'Black moves'
- When I press the START button
- Then the MAIN display should display the text 'Ready to play'
- And NO BEEP should be made
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement