From the book I have learned, most Cucumber testing are start from outside to inside (top-down approach). It starts from UI (Web or Desktop app).
My team is web service team, and we have separate team working on UI layer, which is out of our control. My question is, what is the boundary of our Cucumber test? Does it start from Web Service Layer?
One of the benefit of doing top-down approach is that, it allow the methods to be pulled (methods are created out of the need of calling object) instead of being pushed (methods are created by guessing how the calling object will use it).
However, if we are using cucumber test on the Web Service Layer by itself (without the calling object, UI layer), it seems like we are not doing top-down approach (by pulling the methods).
Please advice how to run cucumber test on Web Service Layer.
You can still write Cucumber tests by taking the esoteric user perspective of the presentation layer calling the service layer.
For example your business analysts have given you the common requirement (I've purposely kept this example simple!):
As a user
I want to log-on
So that I can access a particular service
The acceptance criteria will be that a user will provide valid credentials (i.e. valid username and password).
Hence with this story in place the presentation layer team will be able to implement this story using a Cucumber test to drive the development, where they will mock the calls to your service layer.
Your service layer team can also proceed to write in parallel a test covering their concerns e.g.
Given the authentication service knows about the user "jdoe"
When the client requests to authenticate "jdoe" with the password "contrived"
Then the response is grant user access
A great article covering service-level cucumber testing in greater detail can be found here.