113 lines
4.4 KiB
Gherkin
113 lines
4.4 KiB
Gherkin
@bargaining-market
|
|
Feature: Bargaining Market
|
|
|
|
Background:
|
|
Given the Fellowship SUT is running
|
|
And I am logged in as "frodo_baggins"
|
|
And I start with 500 gold
|
|
And I navigate to a seller on the map
|
|
|
|
Scenario: Bargaining opens with catalog as first message
|
|
When the bargaining chat initializes with a seller
|
|
Then the first message should display the seller's wares catalog
|
|
And there should be no generic NPC opener prepended
|
|
And no automatic user "shop" echo should appear
|
|
|
|
Scenario: User can select wares by name
|
|
Given the seller has displayed their wares catalog
|
|
When I say "I want the Mithril Shield"
|
|
Then the seller should initiate bargaining for the Mithril Shield
|
|
And the asking price should be displayed
|
|
|
|
Scenario: User can select wares by ID
|
|
Given the seller has displayed their wares catalog with item IDs
|
|
When I say "I want #42"
|
|
Then the seller should initiate bargaining for item #42
|
|
And the asking price should be displayed
|
|
|
|
Scenario: Fuzzy matching handles partial names
|
|
Given the seller has "Mithril Shield" in their catalog
|
|
When I say "I want the Mithril"
|
|
Then the seller should enable bargaining for Mithril Shield
|
|
And the seller should ask for clarification
|
|
|
|
Scenario: Fuzzy matching handles spelling mistakes
|
|
Given the seller has "Elven Rope" in their catalog
|
|
When I say "I want the Elven Rope" (misspelled as "Elven Roop")
|
|
Then the seller should still recognize the item
|
|
And bargaining should proceed
|
|
|
|
Scenario: Ambiguous item selection triggers clarification
|
|
Given the seller has "Sword of Elendil" and "Sword of Narsil" in their catalog
|
|
When I say "I want the Sword"
|
|
Then the seller should ask for clarification
|
|
And the seller should list the available options
|
|
|
|
Scenario: User can ask about a ware's lore
|
|
Given the seller has named a ware "Lembas Bread"
|
|
When I say "What is this?" or "Why does this matter in Middle-earth?"
|
|
Then the seller should provide a lore-aware explanation
|
|
And the current asking price should be restated
|
|
|
|
Scenario: Seller provides counter-offers in negotiation rounds
|
|
Given we are bargaining for an item with asking price 400 gold
|
|
When I offer 300 gold
|
|
Then the seller should provide a counter-offer
|
|
And the counter should be higher than my last offer
|
|
|
|
Scenario: Seller does not counter below user's last offer
|
|
Given we are bargaining for an item
|
|
When I offer 350 gold
|
|
And the seller counters at 375 gold
|
|
And I offer 360 gold
|
|
Then the seller's next counter should not go below 360 gold
|
|
|
|
Scenario: User can accept a deal
|
|
Given we are bargaining for an item with current ask of 380 gold
|
|
When I say "deal"
|
|
Then the purchase should complete
|
|
And my gold balance should decrease by 380
|
|
And the item should be added to my inventory
|
|
|
|
Scenario: Insufficient gold prevents purchase
|
|
Given I have only 200 gold
|
|
And a seller is asking 400 gold for an item
|
|
When I say "deal"
|
|
Then the purchase should fail
|
|
And I should see a message about insufficient gold
|
|
|
|
Scenario: Seller may get bored and stop selling
|
|
Given we are bargaining for an item
|
|
When we go through many counter-offer rounds
|
|
Then the seller may eventually say they're bored
|
|
And the bargaining should end
|
|
|
|
Scenario: Successful sale displays remaining wares
|
|
Given I successfully purchase an item for 300 gold
|
|
When the sale completes
|
|
Then the seller should immediately display their remaining wares
|
|
And I should be able to choose whether to continue shopping
|
|
|
|
Scenario: Failed bargain excludes ware from follow-up
|
|
Given we are bargaining for an item
|
|
When we fail to reach a deal and the negotiation ends
|
|
Then the seller should display their remaining wares
|
|
And the failed ware should not be in the follow-up list
|
|
And the flow should remain user-driven
|
|
|
|
Scenario: User can view personal bargaining stats
|
|
Given I have completed several purchases
|
|
When I view my bargaining stats
|
|
Then I should see my gold balance
|
|
And I should see total items purchased
|
|
And I should see my best bargain percentage
|
|
And I should see my average savings percentage
|
|
|
|
Scenario: Inventory reveals deal metrics
|
|
Given I have purchased an item
|
|
When I view my inventory
|
|
Then I should see the item name and seller
|
|
And I should see the price I paid
|
|
And I should see the revealed base price
|
|
And I should see my savings or overpay percentage
|