Commit da18f192 authored by Joe Libipl's avatar Joe Libipl
Browse files

Empty the players' hands after some tests.

parent 65cc0687
......@@ -264,9 +264,10 @@ Scenario: ClearStores False, RestockStores False causes stores to neither be cle
# TODO - empty hands between tests, use database as-is
## RequireMakeRecallReagent
# TODO - empty hands between tests, use database as-is
@clear_player_hands
Scenario: RequireMakeRecallReagent False, thief can make recall ring from nothing
Given I use the "minimal" database
Given I use the "minimal" database as-is
And I set "RequireMakeRecallReagent" in the config file to "False"
And I add player and character "TestThief01"
And I make the character a thief
......@@ -280,8 +281,9 @@ Scenario: RequireMakeRecallReagent False, thief can make recall ring from nothin
And I cast the warmed spell
Then I have a recall ring in my left hand
@clear_player_hands
Scenario: RequireMakeRecallReagent True, thief cannot make recall ring from nothing
Given I use the "minimal" database
Given I use the "minimal" database as-is
And I set "RequireMakeRecallReagent" in the config file to "True"
And I add player and character "TestThief01"
And I make the character a thief
......@@ -297,8 +299,9 @@ Scenario: RequireMakeRecallReagent True, thief cannot make recall ring from noth
And I do not have a recall ring in my "left" hand
And I do not have a recall ring in my "right" hand
@clear_player_hands
Scenario: RequireMakeRecallReagent False, thief can make recall ring from gold ring
Given I use the "minimal" database
Given I use the "minimal" database as-is
And I set "RequireMakeRecallReagent" in the config file to "False"
And I add player and character "TestThief01"
And I make the character a thief
......@@ -313,8 +316,9 @@ Scenario: RequireMakeRecallReagent False, thief can make recall ring from gold r
And I cast the warmed spell
Then I have a recall ring in my left hand
@clear_player_hands
Scenario: RequireMakeRecallReagent True, thief can make recall ring from gold ring
Given I use the "minimal" database
Given I use the "minimal" database as-is
And I set "RequireMakeRecallReagent" in the config file to "True"
And I add player and character "TestThief01"
And I make the character a thief
......
......@@ -163,6 +163,16 @@ def add_hand_slots_for_player(player_id)
end
end
def clear_player_hands
client = connect_to_db(@server_database)
query = "UPDATE [dbo].[PlayerHeld] SET \
itemID = 0, attunedID = 0, special = ''"
debug_msg query
result = client.execute(query)
affected_rows = result.do
debug_msg "Cleared #{affected_rows} player hands"
end
def put_in_player_hand(player_id, item_id, which_hand = :right)
client = connect_to_db(@server_database)
special = lookup_item_special( { itemID: item_id } )
......
......@@ -37,6 +37,10 @@ After('@clear_player_effects') do
clear_player_effects
end
After('@clear_player_hands') do
clear_player_hands
end
After('@kill_server_after') do
# Kill the server
result = %x(taskkill /F /T /IM DragSpinExp.exe)
......
......@@ -745,7 +745,6 @@ Scenario: Multiple bless potions have desired effect (i.e. they don't stack)
# Requires a caster, not just a target
## Wizard_Eye
@WIP
Scenario: Wizard Eye potion results in OOBE
Given I use the "minimal" database as-is
And I add player and character "TestHS01"
......@@ -758,7 +757,6 @@ Scenario: Wizard Eye potion results in OOBE
And I rest
And I did not see myself
@WIP
Scenario: Wizard Eye potion effect visible by others
Given I use the "minimal" database as-is
And I add player and character "TestHS01"
......
......@@ -393,10 +393,12 @@ Then(/^I have a "([^"]*)" protection of "([^"]*)"$/) do |type, desired_value|
end
Then(/^I saw myself$/) do
# TODO: make sure this is an actual character, not part of some other text.
expect(@last_resp).to match(/\b#{@user[:char_name]}\b/)
end
Then(/^I did not see myself$/) do
# TODO: make sure this is an actual character, not part of some other text.
expect(@last_resp).to_not match(/\b#{@user[:char_name]}\b/)
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment