Cucumber Features

Expand All

Collapse All

# language: en

Feature: Kata tournament round ranking

As a Tournament executor
I want to have the points given for a kata summed up for every performance
In order to do a ranking

features/KataRound.feature:8

Scenario Outline: Calculate the score for a kata. The maximum and minimum scores awarded are deleted. The three remaining scores are added together to calculate the score.

  1. Given a participant has performed a kata
    tournament_steps.cpp:139
  2. When a referee gives score <score 1>
    tournament_steps.cpp:300
  3. And a referee gives score <score 2>
    tournament_steps.cpp:300
  4. And a referee gives score <score 3>
    tournament_steps.cpp:300
  5. And a referee gives score <score 4>
    tournament_steps.cpp:300
  6. And a referee gives score <score 5>
    tournament_steps.cpp:300
  7. Then the sum of points given should be <sum>
    tournament_steps.cpp:406
  8. And the maximum score canceled should be <maximum>
    tournament_steps.cpp:426
  9. And the minimum score canceled should be <minimum>
    tournament_steps.cpp:416

Examples

score 1
score 2
score 3
score 4
score 5
sum
maximum
minimum
5.8
5.6
5.6
5.7
5.5
16.9
5.8
5.5
5.9
5.9
5.9
5.9
5.5
17.7
5.9
5.5
5.9
5.9
5.9
5.9
5.9
17.7
5.9
5.9
5.3
5.3
5.4
5.3
5.3
15.9
5.4
5.3
5.0
5.1
5.0
5.0
5.1
15.1
5.1
5.0
features/KataRound.feature:31

Scenario: Calculate the rank per round. If scores are equal the larger canceled mimimum score is first taken into account, and if they are the same the larger canceled maximum score is taken into account.

  1. Given the following participants have performed a kata:
    tournament_steps.cpp:145
    start No
    name
    surname
    date of birth
    dojo
    belt
    score 1
    score 2
    score 3
    score 4
    score 5
    0
    Lee
    Brian
    1975-05-24
    Iron Dragon
    1 Kyu
    5.0
    5.2
    5.3
    5.2
    5.2
    1
    Oyama
    Mas
    1923-07-27
    Honbu
    10 Dan
    5.8
    5.8
    5.7
    5.7
    5.5
    2
    Arneil
    Steve
    1934-08-29
    London
    9 Dan
    5.9
    5.7
    5.7
    5.8
    5.5
    3
    Jet
    Jimi
    1960-01-20
    Mushin
    2 Kyu
    5.0
    5.2
    5.2
    5.2
    5.2
    4
    Norris
    John
    1970-05-14
    Chun Kuk Do
    1 Dan
    5.2
    5.2
    5.4
    5.2
    5.2
    5
    Norris
    Chuck
    1940-03-10
    Chun Kuk Do
    6 Dan
    5.6
    5.6
    5.6
    5.6
    5.6
  2. When the ranks for a round are caclulated
    tournament_steps.cpp:325
  3. Then the ranked list should be the following:
    tournament_steps.cpp:436
    start No
    rank
    name
    surname
    date of birth
    dojo
    belt
    sum
    maximum
    minimum
    2
    1
    Arneil
    Steve
    1934-08-29
    London
    9 Dan
    17.2
    5.9
    5.5
    1
    2
    Oyama
    Mas
    1923-07-27
    Honbu
    10 Dan
    17.2
    5.8
    5.5
    5
    3
    Norris
    Chuck
    1940-03-10
    Chun Kuk Do
    6 Dan
    16.8
    5.6
    5.6
    4
    4
    Norris
    John
    1970-05-14
    Chun Kuk Do
    1 Dan
    15.6
    5.4
    5.2
    0
    5
    Lee
    Brian
    1975-05-24
    Iron Dragon
    1 Kyu
    15.6
    5.3
    5.0
    3
    6
    Jet
    Jimi
    1960-01-20
    Mushin
    2 Kyu
    15.6
    5.2
    5.0
features/KataRound.feature:53

Scenario Outline: Calculate the score for a kata with an overall deduction. The maximum and minimum scores awarded are deleted. The three remaining scores are added together and the deductions substracted to calculate the score.

  1. Given a participant has performed a kata
    tournament_steps.cpp:139
  2. When a referee gives score <score 1>
    tournament_steps.cpp:300
  3. And a referee gives score <score 2>
    tournament_steps.cpp:300
  4. And a referee gives score <score 3>
    tournament_steps.cpp:300
  5. And a referee gives score <score 4>
    tournament_steps.cpp:300
  6. And a referee gives score <score 5>
    tournament_steps.cpp:300
  7. And the overall deduction is <deduction>
    tournament_steps.cpp:309
  8. Then the sum of points given should be <sum>
    tournament_steps.cpp:406
  9. And the maximum score canceled should be <maximum>
    tournament_steps.cpp:426
  10. And the minimum score canceled should be <minimum>
    tournament_steps.cpp:416

Examples

score 1
score 2
score 3
score 4
score 5
deduction
sum
maximum
minimum
5.8
5.6
5.6
5.7
5.5
1.0
15.9
5.8
5.5
5.9
5.9
5.9
5.9
5.5
0.5
17.2
5.9
5.5
5.9
5.9
5.9
5.9
5.9
1.5
16.2
5.9
5.9
5.3
5.3
5.4
5.3
5.3
1.0
14.9
5.4
5.3
5.0
5.1
5.0
5.0
5.1
0.0
15.1
5.1
5.0
# language: en

Feature: Kata tournament round startlist

As a Tournament executor
I want to have a startlist for the next round based on the scores of the previous round and the number of participant nominated for the next round
In order to execute a kata tournament according to the rules

features/KataRoundStartlist.feature:8

Scenario: Create the startlist for the next round. The startlist is ordered with the highest ranked performer starting last.

  1. Given the following participants have performed a kata:
    tournament_steps.cpp:145
    start No
    name
    surname
    date of birth
    dojo
    belt
    score 1
    score 2
    score 3
    score 4
    score 5
    0
    Lee
    Brian
    1975-05-24
    Iron Dragon
    1 Kyu
    5.0
    5.2
    5.3
    5.2
    5.2
    1
    Oyama
    Mas
    1923-07-27
    Honbu
    10 Dan
    5.8
    5.8
    5.7
    5.7
    5.5
    2
    Arneil
    Steve
    1934-08-29
    London
    9 Dan
    5.9
    5.7
    5.7
    5.8
    5.5
    3
    Jet
    Jimi
    1960-01-20
    Mushin
    2 Kyu
    5.0
    5.2
    5.2
    5.2
    5.2
    4
    Norris
    John
    1970-05-14
    Chun Kuk Do
    1 Dan
    5.2
    5.2
    5.4
    5.2
    5.2
    5
    Norris
    Chuck
    1940-03-10
    Chun Kuk Do
    6 Dan
    5.6
    5.6
    5.6
    5.6
    5.6
  2. And the best 4 participants are nominated for the next round
    tournament_steps.cpp:246
  3. When the next round starts
    tournament_steps.cpp:318
  4. Then the list contains 4 participants
    tournament_steps.cpp:485
  5. And the list of participants for the round is the following:
    tournament_steps.cpp:459
    start position
    rank
    start No
    name
    surname
    1
    4
    4
    Norris
    John
    2
    3
    5
    Norris
    Chuck
    3
    2
    1
    Oyama
    Mas
    4
    1
    2
    Arneil
    Steve
features/KataRoundStartlist.feature:29

Scenario: Create the startlist for the next round with the fourth and fifth having the same scores.

  1. Given the following participants have performed a kata:
    tournament_steps.cpp:145
    start No
    name
    surname
    date of birth
    dojo
    belt
    score 1
    score 2
    score 3
    score 4
    score 5
    0
    Lee
    Brian
    1975-05-24
    Iron Dragon
    1 Kyu
    5.2
    5.4
    5.2
    5.2
    5.2
    1
    Oyama
    Mas
    1923-07-27
    Honbu
    10 Dan
    5.8
    5.8
    5.7
    5.7
    5.5
    2
    Arneil
    Steve
    1934-08-29
    London
    9 Dan
    5.9
    5.7
    5.7
    5.8
    5.5
    3
    Jet
    Jimi
    1960-01-20
    Mushin
    2 Kyu
    5.0
    5.2
    5.2
    5.2
    5.2
    4
    Norris
    John
    1970-05-14
    Chun Kuk Do
    1 Dan
    5.2
    5.2
    5.4
    5.2
    5.2
    5
    Norris
    Chuck
    1940-03-10
    Chun Kuk Do
    6 Dan
    5.6
    5.6
    5.6
    5.6
    5.6
  2. And the best 4 participants are nominated for the next round
    tournament_steps.cpp:246
  3. When the next round starts
    tournament_steps.cpp:318
  4. Then the list contains 5 participants
    tournament_steps.cpp:485
  5. And the list of participants for the round is the following:
    tournament_steps.cpp:459
    start position
    rank
    start No
    name
    surname
    1
    4
    0
    Lee
    Brian
    2
    4
    4
    Norris
    John
    3
    3
    5
    Norris
    Chuck
    4
    2
    1
    Oyama
    Mas
    5
    1
    2
    Arneil
    Steve
features/KataRoundStartlist.feature:50

Scenario: Create the startlist for the next round with the fourth, fifth and sixth having the same scores.

  1. Given the following participants have performed a kata:
    tournament_steps.cpp:145
    start No
    name
    surname
    date of birth
    dojo
    belt
    score 1
    score 2
    score 3
    score 4
    score 5
    0
    Lee
    Brian
    1975-05-24
    Iron Dragon
    1 Kyu
    5.2
    5.4
    5.2
    5.2
    5.2
    1
    Oyama
    Mas
    1923-07-27
    Honbu
    10 Dan
    5.8
    5.8
    5.7
    5.7
    5.5
    2
    Arneil
    Steve
    1934-08-29
    London
    9 Dan
    5.9
    5.7
    5.7
    5.8
    5.5
    3
    Jet
    Jimi
    1960-01-20
    Mushin
    2 Kyu
    5.4
    5.2
    5.2
    5.2
    5.2
    4
    Norris
    John
    1970-05-14
    Chun Kuk Do
    1 Dan
    5.2
    5.2
    5.4
    5.2
    5.2
    5
    Norris
    Chuck
    1940-03-10
    Chun Kuk Do
    6 Dan
    5.6
    5.6
    5.6
    5.6
    5.6
  2. And the best 4 participants are nominated for the next round
    tournament_steps.cpp:246
  3. When the next round starts
    tournament_steps.cpp:318
  4. Then the list contains 6 participants
    tournament_steps.cpp:485
  5. And the list of participants for the round is the following:
    tournament_steps.cpp:459
    start position
    rank
    start No
    name
    surname
    1
    4
    0
    Lee
    Brian
    2
    4
    3
    Jet
    Jimi
    3
    4
    4
    Norris
    John
    4
    3
    5
    Norris
    Chuck
    5
    2
    1
    Oyama
    Mas
    6
    1
    2
    Arneil
    Steve
features/KataRoundStartlist.feature:72

Scenario: Create the startlist for the third round. The startlist for the third round is based on the scores of the second round only.

  1. Given the following participants performed a kata in the 1st round:
    features/step_definitions/forwarding_steps.rb:1
    start No
    name
    surname
    date of birth
    dojo
    belt
    score 1
    score 2
    score 3
    score 4
    score 5
    0
    Lee
    Brian
    1975-05-24
    Iron Dragon
    1 Kyu
    5.0
    5.1
    5.3
    5.2
    5.2
    1
    Oyama
    Mas
    1923-07-27
    Honbu
    10 Dan
    5.8
    5.8
    5.7
    5.7
    5.5
    2
    Arneil
    Steve
    1934-08-29
    London
    9 Dan
    5.9
    5.7
    5.7
    5.8
    5.5
    3
    Jet
    Jimi
    1960-01-20
    Mushin
    2 Kyu
    5.0
    5.2
    5.2
    5.2
    5.2
    4
    Norris
    John
    1970-05-14
    Chun Kuk Do
    1 Dan
    5.2
    5.2
    5.4
    5.2
    5.2
    5
    Norris
    Chuck
    1940-03-10
    Chun Kuk Do
    6 Dan
    5.6
    5.6
    5.6
    5.6
    5.6
    6
    Lundgren
    Dolph
    1957-11-03
    Stockholm
    3 Dan
    5.0
    5.0
    5.0
    5.0
    5.0
    7
    Van Damme
    Jean-Claude
    1960-10-18
    CNDK
    1 Dan
    4.8
    4.9
    5.0
    5.0
    5.1
  2. And the following participants performed a kata in the 2nd round:
    tournament_steps.cpp:214
    start No
    name
    surname
    date of birth
    dojo
    belt
    score 1
    score 2
    score 3
    score 4
    score 5
    0
    Lee
    Brian
    1975-05-24
    Iron Dragon
    1 Kyu
    5.5
    5.4
    5.5
    5.4
    5.3
    3
    Jet
    Jimi
    1960-01-20
    Mushin
    2 Kyu
    5.0
    5.2
    5.2
    5.2
    5.2
    4
    Norris
    John
    1970-05-14
    Chun Kuk Do
    1 Dan
    5.2
    5.2
    5.4
    5.4
    5.1
    5
    Norris
    Chuck
    1940-03-10
    Chun Kuk Do
    6 Dan
    5.9
    5.9
    5.9
    5.9
    5.9
    1
    Oyama
    Mas
    1923-07-27
    Honbu
    10 Dan
    5.7
    5.7
    5.7
    5.7
    5.7
    2
    Arneil
    Steve
    1934-08-29
    London
    9 Dan
    5.7
    5.8
    5.8
    5.8
    5.9
  3. And the best 4 participants are nominated for the next round
    tournament_steps.cpp:246
  4. When the next round starts
    tournament_steps.cpp:318
  5. Then the list contains 4 participants
    tournament_steps.cpp:485
  6. And the list of participants for the round is the following:
    tournament_steps.cpp:459
    start position
    rank
    start No
    name
    surname
    1
    4
    0
    Lee
    Brian
    2
    3
    1
    Oyama
    Mas
    3
    2
    2
    Arneil
    Steve
    4
    1
    5
    Norris
    Chuck
# language: en

Feature: Persistence data

As a Tournament organizer
I want to safe my tournament data persistence
In order to continue with an earlier state

features/Persistency.feature:7

Scenario: Persistent tournament data

  1. Given the following Tournament is open:
    tournament_steps.cpp:54
    name
    date
    location
    SM
    2013-06-20
    Wohlen
  2. When I save the profile to "temp/default.ktm"
    persistency_steps.cpp:33
  3. And I restart the application
    persistency_steps.cpp:27
  4. And I open the profile "temp/default.ktm"
    persistency_steps.cpp:47
  5. Then the following tournament is opened:
    tournament_steps.cpp:492
    name
    date
    location
    SM
    2013-06-20
    Wohlen
features/Persistency.feature:21

Scenario: Persistent tournament participants

  1. Given the following Tournament is open:
    tournament_steps.cpp:54
    name
    date
    location
    SM
    2013-06-20
    Wohlen
  2. And the Tournament has the following participants:
    tournament_steps.cpp:80
    name
    surname
    date of birth
    dojo
    belt
    Oyama
    Mas
    1923-07-27
    Honbu
    10 Dan
    Arneil
    Steve
    1934-08-29
    London
    9 Dan
    Norris
    Chuck
    1940-03-10
    Chun Kuk Do
    6 Dan
  3. When I save the profile to "temp/default.ktm"
    persistency_steps.cpp:33
  4. And I restart the application
    persistency_steps.cpp:27
  5. And I open the profile "temp/default.ktm"
    persistency_steps.cpp:47
  6. Then the Tournament should have the following participants:
    tournament_steps.cpp:331
    name
    surname
    date of birth
    dojo
    belt
    Oyama
    Mas
    1923-07-27
    Honbu
    10 Dan
    Arneil
    Steve
    1934-08-29
    London
    9 Dan
    Norris
    Chuck
    1940-03-10
    Chun Kuk Do
    6 Dan
features/Persistency.feature:42

Scenario: Persistent tournament participants scores

  1. Given the following Tournament is open:
    tournament_steps.cpp:54
    name
    date
    location
    WM
    2013-06-20
    Wohlen
  2. And the Tournament has the following participants:
    tournament_steps.cpp:80
    name
    surname
    score 1-1
    score 1-2
    score 1-3
    score 1-4
    score 1-5
    score 2-1
    score 2-2
    score 2-3
    score 2-4
    score 2-5
    Lee
    Brian
    5.0
    5.2
    5.3
    5.2
    5.2
    5.8
    5.8
    5.7
    5.7
    5.5
    Oyama
    Mas
    5.8
    5.8
    5.7
    5.7
    5.5
    5.9
    5.7
    5.7
    5.8
    5.5
    Arneil
    Steve
    5.9
    5.7
    5.7
    5.8
    5.5
    5.0
    5.2
    5.2
    5.2
    5.2
    Jet
    Jimi
    5.0
    5.2
    5.2
    5.2
    5.2
    5.2
    5.2
    5.4
    5.2
    5.2
    Norris
    John
    5.2
    5.2
    5.4
    5.2
    5.2
    5.6
    5.6
    5.6
    5.6
    5.6
    Norris
    Chuck
    5.6
    5.6
    5.6
    5.6
    5.6
    5.0
    5.2
    5.3
    5.2
    5.2
  3. When I save the profile to "temp/default.ktm"
    persistency_steps.cpp:33
  4. And I restart the application
    persistency_steps.cpp:27
  5. And I open the profile "temp/default.ktm"
    persistency_steps.cpp:47
  6. Then the Tournament should have the following participants:
    tournament_steps.cpp:331
    name
    surname
    score 1-1
    score 1-2
    score 1-3
    score 1-4
    score 1-5
    score 2-1
    score 2-2
    score 2-3
    score 2-4
    score 2-5
    Lee
    Brian
    5.0
    5.2
    5.3
    5.2
    5.2
    5.8
    5.8
    5.7
    5.7
    5.5
    Oyama
    Mas
    5.8
    5.8
    5.7
    5.7
    5.5
    5.9
    5.7
    5.7
    5.8
    5.5
    Arneil
    Steve
    5.9
    5.7
    5.7
    5.8
    5.5
    5.0
    5.2
    5.2
    5.2
    5.2
    Jet
    Jimi
    5.0
    5.2
    5.2
    5.2
    5.2
    5.2
    5.2
    5.4
    5.2
    5.2
    Norris
    John
    5.2
    5.2
    5.4
    5.2
    5.2
    5.6
    5.6
    5.6
    5.6
    5.6
    Norris
    Chuck
    5.6
    5.6
    5.6
    5.6
    5.6
    5.0
    5.2
    5.3
    5.2
    5.2
# language: en

Feature: Kata tournament rankedlist

As a Tournament executor
I want to have a rankedlist of the participants after the final round
In order to determine the winner of the tournament

features/Rankedlist.feature:8

Scenario: Create the final ranked list.

  1. Given the following participants have performed katas:
    tournament_steps.cpp:174
    name
    surname
    1-1
    1-2
    1-3
    1-4
    1-5
    2-1
    2-2
    2-3
    2-4
    2-5
    3-1
    3-2
    3-3
    3-4
    3-5
    Müller
    Roland
    7.7
    7.5
    7.5
    7.7
    7.5
    7.6
    7.7
    7.6
    7.8
    7.8
    7.7
    7.6
    7.7
    7.6
    7.8
    Paradiso
    Alessandro
    7.4
    7.0
    7.3
    7.2
    7.1
    7.2
    7.3
    7.2
    7.2
    7.3
    7.1
    7.1
    7.1
    7.0
    7.3
    Birrer
    Simon
    7.5
    7.6
    7.6
    7.5
    7.6
    7.7
    7.8
    7.7
    7.7
    7.6
    7.9
    7.8
    7.8
    7.9
    7.9
    Cehajic
    Edi
    7.5
    7.4
    7.5
    7.4
    7.4
    7.4
    7.5
    7.4
    7.6
    7.4
    7.4
    7.3
    7.4
    7.5
    7.4
    Felder
    Luca
    7.2
    6.9
    7.0
    7.1
    7.1
    7.3
    7.4
    7.2
    7.2
    7.1
    Klein
    Lorenz
    7.3
    7.0
    7.2
    7.2
    7.0
    7.4
    7.2
    7.3
    7.3
    7.2
    7.2
    7.1
    7.2
    7.3
    7.2
    Graziano
    Markus
    7.3
    7.4
    7.2
    7.4
    7.4
    7.3
    7.3
    7.4
    7.3
    7.4
    7.4
    7.4
    7.3
    7.3
    7.4
    Emmenegger
    André
    7.8
    7.8
    7.7
    7.8
    7.6
    7.6
    7.8
    7.8
    7.9
    7.8
    7.8
    8.0
    7.8
    7.8
    7.8
    Pfändler
    Ramon
    7.3
    7.3
    7.3
    7.4
    7.3
    7.5
    7.5
    7.5
    7.4
    7.5
    7.6
    7.4
    7.6
    7.5
    7.6
    Grande
    Davide
    7.3
    7.0
    7.1
    7.2
    7.2
    7.1
    7.3
    7.1
    7.4
    7.3
    Frey
    Dominique
    7.1
    7.0
    6.9
    7.0
    7.2
    7.0
    7.1
    7.0
    7.3
    6.9
  2. Then the rankedlist is the following:
    tournament_steps.cpp:528
    rank
    name
    surname
    1
    Birrer
    Simon
    2
    Emmenegger
    André
    3
    Müller
    Roland
    4
    Pfändler
    Ramon
    5
    Cehajic
    Edi
    6
    Graziano
    Markus
    7
    Klein
    Lorenz
    8
    Paradiso
    Alessandro
    9
    Grande
    Davide
    9
    Felder
    Luca
    11
    Frey
    Dominique
# language: en

Feature: Setup Tournament

As a Tournament organizer
I want to setup a Tournament
In order to get started

features/SetupTournament.feature:7

Scenario: Create a new Tournament with a name and date provided only

  1. Given no tournament is open
    tournament_steps.cpp:38
  2. When I create the following Tournament:
    tournament_steps.cpp:253
    name
    date
    SM
    2013-06-20
  3. Then the following tournament is opened:
    tournament_steps.cpp:492
    name
    date
    SM
    2013-06-20
features/SetupTournament.feature:18

Scenario: Create a new Tournament with location specified

  1. Given no tournament is open
    tournament_steps.cpp:38
  2. When I create the following Tournament:
    tournament_steps.cpp:253
    name
    date
    location
    SM
    2013-06-20
    Wohlen
  3. Then the following tournament is opened:
    tournament_steps.cpp:492
    name
    date
    location
    SM
    2013-06-20
    Wohlen
features/SetupTournament.feature:28

Scenario: Register an attendee to the tournament

  1. Given a Tournament is open
    tournament_steps.cpp:44
  2. When I add the following participants to the tournament:
    tournament_steps.cpp:280
    name
    surname
    date of birth
    dojo
    belt
    Oyama
    Mas
    1923-07-27
    Honbu
    10 Dan
    Arneil
    Steve
    1934-08-29
    London
    9 Dan
    Norris
    Chuck
    1940-03-10
    Chun Kuk Do
    6 Dan
  3. Then the number of participants for the tournament should be 3
    tournament_steps.cpp:520