From 8780c7c6ab69a31e9f1af81cf017f1ee2de69e8c Mon Sep 17 00:00:00 2001 From: customcommander Date: Sat, 19 Oct 2024 08:38:09 +0100 Subject: [PATCH] add test for resources check for task 101 --- test/acceptance/101.feature | 7 +++++++ test/acceptance/steps.js | 19 ++++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 test/acceptance/101.feature diff --git a/test/acceptance/101.feature b/test/acceptance/101.feature new file mode 100644 index 0000000..a86caff --- /dev/null +++ b/test/acceptance/101.feature @@ -0,0 +1,7 @@ +Feature: Build Rooms and/or Build Stables + +Scenario: Abort task if player does not have enough resources + Given I start playing + When I select "Build Rooms and/or Build Stables" + Then the game tells me I do not have enough resources + diff --git a/test/acceptance/steps.js b/test/acceptance/steps.js index 5919fc3..029d83d 100644 --- a/test/acceptance/steps.js +++ b/test/acceptance/steps.js @@ -5,13 +5,14 @@ import { } from '@cucumber/cucumber'; const task_map = { - 'Day Laborer' : 106, - 'Plow 1 Field' : 104, - 'Sow and/or Bake bread': 113, - 'Take 1 Grain' : 103, - 'Take x Clay' : 108, - 'Take x Reed' : 109, - 'Take x Wood' : 107, + 'Build Rooms and/or Build Stables': 101, + 'Day Laborer' : 106, + 'Plow 1 Field' : 104, + 'Sow and/or Bake bread' : 113, + 'Take 1 Grain' : 103, + 'Take x Clay' : 108, + 'Take x Reed' : 109, + 'Take x Wood' : 107, }; const stock_map = { @@ -65,3 +66,7 @@ When('I feed my family', async function () { await this.send({type: 'task.completed', task_id: '002'}); }); +Then('the game tells me I do not have enough resources', async function () { + await this.assert(game => game.error === 'NOT_ENOUGH_RESOURCES'); +}); +