Skip to content

Commit

Permalink
test(acceptance): acceptance tests for current game play source playe…
Browse files Browse the repository at this point in the history
…rs (#548)
  • Loading branch information
antoinezanardi authored Oct 8, 2023
1 parent a95dd12 commit 286d4f8
Show file tree
Hide file tree
Showing 25 changed files with 292 additions and 29 deletions.
29 changes: 29 additions & 0 deletions tests/acceptance/features/game/features/game-play/vote.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Feature: 🗳️ Vote Game Play

Scenario: 🗳 Majority of votes against a player kills him

Given a created game with options described in files no-sheriff-option.json and with the following players
| name | role |
| Antoine | werewolf |
Expand All @@ -14,6 +15,11 @@ Feature: 🗳️ Vote Game Play
When the werewolves eat the player named Olivia
Then the player named Olivia should be murdered by werewolves from eaten
And the game's current play should be survivors to vote
And the game's current play should be played by the following players
| name |
| Antoine |
| JB |
| Thomas |

When the survivors vote with the following votes
| voter | target |
Expand All @@ -23,6 +29,7 @@ Feature: 🗳️ Vote Game Play
Then the player named JB should be murdered by survivors from vote

Scenario: 🗳 Tie in votes are dealt with another vote when there is no sheriff in town

Given a created game with options described in files no-sheriff-option.json and with the following players
| name | role |
| Antoine | werewolf |
Expand All @@ -34,12 +41,22 @@ Feature: 🗳️ Vote Game Play
When the werewolves eat the player named Olivia
Then the player named Olivia should be murdered by werewolves from eaten
And the game's current play should be survivors to vote
And the game's current play should be played by the following players
| name |
| Antoine |
| JB |
| Thomas |

When the survivors vote with the following votes
| voter | target |
| JB | Thomas |
| Thomas | JB |
Then the game's current play should be survivors to vote because previous-votes-were-in-ties
And the game's current play should be played by the following players
| name |
| Antoine |
| JB |
| Thomas |

When the survivors vote with the following votes
| voter | target |
Expand All @@ -48,6 +65,7 @@ Feature: 🗳️ Vote Game Play
And the player named JB should be alive

Scenario: 🗳 None of the players are murdered when there is a tie in votes but survivors can't decide who to kill without sheriff

Given a created game with options described in files no-sheriff-option.json and with the following players
| name | role |
| Antoine | werewolf |
Expand Down Expand Up @@ -75,6 +93,7 @@ Feature: 🗳️ Vote Game Play
And the game's current play should be werewolves to eat

Scenario: 🗳 Sheriff has a doubled vote

Given a created game with the following players
| name | role |
| Antoine | werewolf |
Expand Down Expand Up @@ -103,6 +122,7 @@ Feature: 🗳️ Vote Game Play
Then the player named JB should be murdered by survivors from vote

Scenario: 🗳 Sheriff disparition in game brings back the classic tie in votes system

Given a created game with the following players
| name | role |
| Antoine | idiot |
Expand Down Expand Up @@ -140,6 +160,7 @@ Feature: 🗳️ Vote Game Play
Then the player named Thomas should be murdered by survivors from vote

Scenario: 🗳 Raven mark adds two votes to the player who has it

Given a created game with options described in files no-sheriff-option.json and with the following players
| name | role |
| Antoine | werewolf |
Expand Down Expand Up @@ -192,6 +213,9 @@ Feature: 🗳️ Vote Game Play
| Juju | Doudou |
Then the player named JB should be murdered by survivors from vote-scapegoated
And the game's current play should be scapegoat to ban-voting
And the game's current play should be played by the following players
| name |
| JB |

When the scapegoat bans from vote the following players
| name |
Expand All @@ -209,13 +233,17 @@ Feature: 🗳️ Vote Game Play
And the game's phase should be night

Scenario: 🗳 Stuttering Judge asks for another vote after another vote

Given a created game with options described in files no-sheriff-option.json and with the following players
| name | role |
| Antoine | werewolf |
| Olivia | villager |
| JB | stuttering-judge |
| Thomas | villager |
And the game's current play should be stuttering-judge to choose-sign
And the game's current play should be played by the following players
| name |
| JB |

When the stuttering judge chooses his sign
Then the game's current play should be werewolves to eat
Expand Down Expand Up @@ -247,6 +275,7 @@ Feature: 🗳️ Vote Game Play
And the game's current play should be werewolves to eat

Scenario: 🗳 Multiple votes can happen during the day with stuttering judge requests and ties

Given a created game with options described in files no-sheriff-option.json, stuttering-judge-two-vote-requests-option.json and with the following players
| name | role |
| Antoine | werewolf |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Feature: 🎖️ Sheriff player attribute

Scenario: 🎖️ Sheriff must break ties between votes

Given a created game with the following players
| name | role |
| Antoine | villager |
Expand All @@ -11,6 +12,13 @@ Feature: 🎖️ Sheriff player attribute
| JB | villager |
| Babou | villager |
Then the game's current play should be survivors to elect-sheriff
And the game's current play should be played by the following players
| name |
| Antoine |
| Olivia |
| Thomas |
| JB |
| Babou |

When the survivors elect sheriff with the following votes
| voter | target |
Expand All @@ -31,12 +39,16 @@ Feature: 🎖️ Sheriff player attribute
Then the player named JB should be alive
And the player named Thomas should be alive
And the game's current play should be sheriff to settle-votes
And the game's current play should be played by the following players
| name |
| Olivia |

When the sheriff breaks the tie in votes by choosing the player named Thomas
Then the player named JB should be alive
And the player named Thomas should be murdered by sheriff from vote

Scenario: 🎖️ Sheriff has doubled vote

Given a created game with the following players
| name | role |
| Antoine | villager |
Expand Down Expand Up @@ -65,6 +77,7 @@ Feature: 🎖️ Sheriff player attribute
Then the player named JB should be murdered by survivors from vote

Scenario: 🎖️ Sheriff has normal vote with the right option

Given a created game with options described in file sheriff-has-normal-vote-option.json and with the following players
| name | role |
| Antoine | villager |
Expand Down Expand Up @@ -93,7 +106,8 @@ Feature: 🎖️ Sheriff player attribute
Then the player named JB should be alive
And the game's current play should be sheriff to settle-votes

Scenario: 🎖️ Sheriff must be elected on the first tick of the game
Scenario: 🎖️ Sheriff is elected on the first tick of the game

Given a created game with the following players
| name | role |
| Antoine | villager |
Expand All @@ -103,7 +117,8 @@ Feature: 🎖️ Sheriff player attribute
| Babou | villager |
Then the game's current play should be survivors to elect-sheriff

Scenario: 🎖️ Sheriff can't be deactivated with the right option
Scenario: 🎖️ Sheriff can be deactivated with the right option

Given a created game with options described in file no-sheriff-option.json and with the following players
| name | role |
| Antoine | villager |
Expand All @@ -113,7 +128,8 @@ Feature: 🎖️ Sheriff player attribute
| Babou | villager |
Then the game's current play should be werewolves to eat

Scenario: 🎖️ Sheriff can be elected on first day with right option
Scenario: 🎖️ Sheriff can be elected on first day instead of first night with right option

Given a created game with options described in file sheriff-election-on-first-day-option.json and with the following players
| name | role |
| Antoine | villager |
Expand All @@ -127,7 +143,8 @@ Feature: 🎖️ Sheriff player attribute
Then the player named Babou should be murdered by werewolves from eaten
And the game's current play should be survivors to elect-sheriff

Scenario: 🎖️ Sheriff can be elected on second night with right option
Scenario: 🎖️ Sheriff can be elected on second night instead of first night with right option

Given a created game with options described in file sheriff-election-on-second-night-option.json and with the following players
| name | role |
| Antoine | villager |
Expand All @@ -145,6 +162,7 @@ Feature: 🎖️ Sheriff player attribute
Then the game's current play should be survivors to elect-sheriff

Scenario: 🎖️ Sheriff delegates if he is not the idiot

Given a created game with the following players
| name | role |
| Antoine | villager |
Expand All @@ -165,11 +183,15 @@ Feature: 🎖️ Sheriff player attribute
When the werewolves eat the player named Thomas
Then the player named Thomas should be murdered by werewolves from eaten
And the game's current play should be sheriff to delegate
And the game's current play should be played by the following players
| name |
| Thomas |

When the sheriff delegates his role to the player named Olivia
Then the player named Olivia should have the active sheriff from sheriff attribute

Scenario: 🎖️ Sheriff doesn't delegate if he is the idiot

Given a created game with the following players
| name | role |
| Antoine | villager |
Expand All @@ -193,6 +215,7 @@ Feature: 🎖️ Sheriff player attribute
And the player named Thomas should have the active sheriff from survivors attribute

Scenario: 🎖️ Sheriff election is randomized when there is a tie

Given a created game with the following players
| name | role |
| Antoine | witch |
Expand Down
6 changes: 6 additions & 0 deletions tests/acceptance/features/game/features/role/ancient.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
@ancient-role

Feature: 👴🏻 Ancient role

Scenario: 👴🏻 Ancient makes all villagers loose powers if he dies from votes

Given a created game with additional cards described in file full-werewolves-additional-cards-for-thief.json and with options described in file no-sheriff-option.json and with the following players
| name | role |
| Antoine | ancient |
Expand Down Expand Up @@ -79,6 +81,7 @@ Feature: 👴🏻 Ancient role
And nobody should have the active contaminated from rusty-sword-night attribute

Scenario: 👴🏻 Ancient makes all villagers loose powers if he dies from the witch

Given a created game with options described in file no-sheriff-option.json and with the following players
| name | role |
| Antoine | ancient |
Expand Down Expand Up @@ -108,6 +111,7 @@ Feature: 👴🏻 Ancient role
Then the game's current play should be werewolves to eat

Scenario: 👴🏻 Ancient makes all villagers loose powers if he dies from the hunter

Given a created game with options described in file no-sheriff-option.json and with the following players
| name | role |
| Antoine | ancient |
Expand Down Expand Up @@ -137,6 +141,7 @@ Feature: 👴🏻 Ancient role


Scenario: 👴🏻 Ancient doesn't makes all villagers loose powers if he dies from villagers with the right option

Given a created game with options described in file no-sheriff-option.json, ancient-doesnt-take-revenge-option.json and with the following players
| name | role |
| Antoine | ancient |
Expand All @@ -153,6 +158,7 @@ Feature: 👴🏻 Ancient role
And the game's current play should be guard to protect

Scenario: 👴🏻 Ancient has two lives against werewolves

Given a created game with options described in file no-sheriff-option.json and with the following players
| name | role |
| Antoine | ancient |
Expand Down
24 changes: 22 additions & 2 deletions tests/acceptance/features/game/features/role/angel.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@angel-role

Feature: 👼 Angel role

Scenario: 👼 Angel doesn't win because he is powerless
Expand All @@ -10,6 +11,12 @@ Feature: 👼 Angel role
| JB | villager |
| Thomas | werewolf |
Then the game's current play should be survivors to vote because angel-presence
And the game's current play should be played by the following players
| name |
| Antoine |
| Olivia |
| JB |
| Thomas |

When the survivors vote with the following votes
| source | vote |
Expand All @@ -35,6 +42,12 @@ Feature: 👼 Angel role
| JB | villager |
| Thomas | werewolf |
Then the game's current play should be survivors to vote because angel-presence
And the game's current play should be played by the following players
| name |
| Antoine |
| Olivia |
| JB |
| Thomas |

When the survivors vote with the following votes
| source | vote |
Expand Down Expand Up @@ -66,6 +79,13 @@ Feature: 👼 Angel role
| Thomas | werewolf |
| Max | stuttering-judge |
Then the game's current play should be survivors to vote because angel-presence
And the game's current play should be played by the following players
| name |
| Antoine |
| Olivia |
| JB |
| Thomas |
| Max |

When the survivors vote with the following votes
| source | vote |
Expand All @@ -81,8 +101,8 @@ Feature: 👼 Angel role
And the game's current play should be survivors to vote

When the survivors vote with the following votes and the stuttering judge does his sign
| source | vote |
| Thomas | Max |
| source | vote |
| Thomas | Max |
Then the player named Max should be murdered by survivors from vote
And the game's current play should be survivors to vote because stuttering-judge-request

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Feature: 🐺👹 Big Bad Wolf role

Scenario: 🐺👹Big Bad Wolf eats every night but powerless if one werewolf dies

Given a created game with options described in file no-sheriff-option.json and with the following players
| name | role |
| Antoine | witch |
Expand Down Expand Up @@ -56,6 +57,7 @@ Feature: 🐺👹 Big Bad Wolf role
| Olivia |

Scenario: 🐺👹Big Bad Wolf eats every night and not powerless if one werewolf dies

Given a created game with options described in file no-sheriff-option.json, big-bad-wolf-not-powerless-if-werewolf-dies-option.json and with the following players
| name | role |
| Antoine | witch |
Expand Down Expand Up @@ -114,6 +116,7 @@ Feature: 🐺👹 Big Bad Wolf role
| Olivia |

Scenario: 🐺👹Big Bad Wolf eats every night but his role is skipped if no targets

Given a created game with options described in file no-sheriff-option.json, skip-roles-call-if-no-target-option.json and with the following players
| name | role |
| Antoine | witch |
Expand Down
5 changes: 5 additions & 0 deletions tests/acceptance/features/game/features/role/cupid.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@cupid-role

Feature: 💘 Cupid role

Scenario: 💘 Cupid makes two people fall in love and they die if one of them dies
Expand All @@ -9,6 +10,10 @@ Feature: 💘 Cupid role
| Olivia | werewolf |
| JB | villager |
| Thomas | idiot |
And the game's current play should be cupid to charm
And the game's current play should be played by the following players
| name |
| Antoine |

When the cupid shoots an arrow at the player named JB and the player named Thomas
Then 2 of the following players should have the active in-love from cupid attribute
Expand Down
Loading

0 comments on commit 286d4f8

Please sign in to comment.