Boil when the power is cheap › Ask for a cheap boil, lose the provider, get the boil not run
As a tea drinker, I want the kettle to boil when electricity is cheap, so that my morning cup costs less without me watching the price.
The test behind the tutorial Boil when the power is cheap: every step it takes, what it checks and what it saw.
Start
From the setup of Smart kettle.
Everything it starts with
Given the price feed is live And the cheap boil is off
- the price feed is live · arranged
- the cheap boil is off · arranged
1 When the user asks for a cheap boil
When the user asks for a cheap boil Then the cheap boil is waiting
Expected behaviour: Asking for a cheap boil makes the kettle wait.
- the cheap boil is waiting · Asking for a cheap boil makes the kettle wait
2 When the feed stops answering
When the feed stops answering Then the price feed is unavailable And the cheap boil is waiting
Expected behaviour: A silent provider means no price.
- the price feed is unavailable · A silent provider means no price
- the cheap boil is waiting · Without a price the kettle keeps waiting
3 When the feed answers again
When the feed answers again Then the price feed is live
Expected behaviour: Retry brings the price back when the provider is back.
- the price feed is live · Retry brings the price back when the provider is back
4 When the price drops to the cheap rate
When the price drops to the cheap rate Then the cheap boil is boiling
Expected behaviour: A cheap price starts the boil.
- the cheap boil is boiling · A cheap price starts the boil