-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(guard): acceptance tests for guard (#506)
- Loading branch information
1 parent
06c6505
commit 7121e90
Showing
8 changed files
with
150 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="Defender 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 @defender-role" /> | ||
<option name="workingDirectory" value="$PROJECT_DIR$" /> | ||
<envs> | ||
<env name="NODE_OPTIONS" value="--import tsx/esm" /> | ||
</envs> | ||
<method v="2" /> | ||
</configuration> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
112 changes: 112 additions & 0 deletions
112
tests/acceptance/features/game/features/role/defender.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
@defender-role | ||
|
||
Feature: 🛡️ Defender Role | ||
|
||
Scenario: 🛡️ Defender protects from werewolf attack but can't choose twice in a row the same player | ||
|
||
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 | Defender | | ||
| Bob | Werewolf | | ||
| Charlie | Idiot | | ||
| David | Villager | | ||
When the user closes the toast | ||
And the user skips the game event | ||
And the user skips the game event | ||
Then the game's event should display the text "The Defender wakes up and will protect anyone from the Werewolves." | ||
And the game's event player card should have the name "Antoine" | ||
|
||
When the user skips the game event | ||
Then the game's current play title should be "Defender protects" | ||
And the game's current play question should be "Which player does the Defender want to protect ?" | ||
And the game's phase name should be "Night 1" | ||
And the game's current play should have the following targets | ||
| name | | ||
| Antoine | | ||
| Bob | | ||
| Charlie | | ||
| David | | ||
And the page should match or creates the missing snapshot with name "Defender protects Playground" | ||
|
||
When the defender protects the player with name "Antoine" | ||
Then the player with name "Antoine" should have the attribute protected by defender in the game | ||
|
||
When 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" | ||
And the user skips all game events | ||
Then the player with name "Antoine" should be alive in the game | ||
And the game's current play title should be "Survivors vote" | ||
|
||
When the player or group skips his turn | ||
And the user skips the game event | ||
Then the game's event should display the text "The Defender wakes up and will protect anyone from the Werewolves except the last protected player." | ||
And the game's event player card should have the name "Antoine" | ||
|
||
When the user skips the game event | ||
Then the game's current play title should be "Defender protects" | ||
And the game's current play should have the following targets | ||
| name | | ||
| Bob | | ||
| Charlie | | ||
| David | | ||
|
||
Scenario: 🛡️ Defender protects from werewolf attack and can choose anyone at any moment if the game master allows it | ||
|
||
Given the user disables the sheriff in game options | ||
And the user allows the defender to protect twice in a row in game options | ||
And the user creates a game with the players with name and role | ||
| name | role | | ||
| Antoine | Defender | | ||
| Bob | Werewolf | | ||
| Charlie | Idiot | | ||
| David | Villager | | ||
When the user closes the toast | ||
|
||
And the user skips the game event | ||
And the user skips the game event | ||
Then the game's event should display the text "The Defender wakes up and will protect anyone from the Werewolves." | ||
And the game's event player card should have the name "Antoine" | ||
|
||
When the user skips the game event | ||
Then the game's current play title should be "Defender protects" | ||
And the game's current play question should be "Which player does the Defender want to protect ?" | ||
And the game's phase name should be "Night 1" | ||
And the game's current play should have the following targets | ||
| name | | ||
| Antoine | | ||
| Bob | | ||
| Charlie | | ||
| David | | ||
|
||
When the defender protects the player with name "Antoine" | ||
Then the player with name "Antoine" should have the attribute protected by defender in the game | ||
|
||
When 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" | ||
And the user skips all game events | ||
Then the player with name "Antoine" should be alive in the game | ||
And the game's current play title should be "Survivors vote" | ||
|
||
When the player or group skips his turn | ||
And the user skips the game event | ||
Then the game's event should display the text "The Defender wakes up and will protect anyone from the Werewolves." | ||
And the game's event player card should have the name "Antoine" | ||
|
||
When the user skips the game event | ||
Then the game's current play title should be "Defender protects" | ||
And the game's current play question should be "Which player does the Defender want to protect ?" | ||
And the game's phase name should be "Night 2" | ||
And the game's current play should have the following targets | ||
| name | | ||
| Antoine | | ||
| Bob | | ||
| Charlie | | ||
| David | | ||
|
||
When the defender protects the player with name "Antoine" | ||
Then the player with name "Antoine" should have the attribute protected by defender in the game |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.