Skip to content

Commit

Permalink
test(hunter): e2e tests for hunter role (#456)
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinezanardi committed Jun 3, 2024
1 parent a9753a6 commit 4b7c065
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .run/Hunter Role.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Hunter Role" type="cucumber.js" factoryName="Cucumber.js" folderName="Tags">
<option name="myFilePath" value="$PROJECT_DIR$/tests/acceptance" />
<option name="myNameFilter" value="" />
<option name="cucumberJsArguments" value="--config config/cucumber/cucumber.json --parallel 1 --tags @hunter-role" />
<option name="workingDirectory" value="$PROJECT_DIR$" />
<envs>
<env name="NODE_OPTIONS" value="--import tsx/esm" />
</envs>
<method v="2" />
</configuration>
</component>
38 changes: 38 additions & 0 deletions tests/acceptance/features/game/features/role/hunter.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
@hunter-role

Feature: 🔫 Hunter role

Scenario: 🔫 Hunter shoots and kill someone when he dies

Given the user disables the sheriff in game options
And the user creates a game with the players with name and role
| name | role |
| Antoine | Hunter |
| Bob | Werewolf |
| Charlie | Idiot |
| David | Villager |
When the user closes the toast
And the user skips all game events
Then the game's current play title should be "Werewolves eat"

When the werewolves eat the player with name "Antoine"
Then the game's event should display the text "The day rises in the village of the Millers Hollow !"

When the user skips the game event
Then the game's event should display the text "Antoine is dead ! What a tragedy…"

When the user skips the game event
Then the game's event should display the text "In his last breath, the Hunter will shoot at a player and kill him right away."

When the user skips the game event
Then the game's current play title should be "Hunter shoots"
And the game's current play question should be "Which player does the Hunter want to shoot ?"
And the game's current play should have the following targets
| name |
| Bob |
| Charlie |
| David |
And the page should match the snapshot with name "Hunter shoots Playground"

When the hunter shoots the player with name "David"
Then the game's event should display the text "David is dead ! What a tragedy…"
2 changes: 1 addition & 1 deletion tests/acceptance/features/game/features/role/seer.feature
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Feature: ✨Seer role
Then the game's event should display the text "The Seer wakes up and will look at a player's role."

When the user skips the game event
And the game's current play title should be "Seer looks"
Then the game's current play title should be "Seer looks"
And the game's current play question should be "Which player does the Seer want to look at ?"
And the game's current play should have the following targets
| name |
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4b7c065

Please sign in to comment.