cucumberpython-behave

Chaining async tests in Cucumber


I'd like to write a series of Cucumber tests to verify connecting and provisioning a BLE device. Each step is inherently asynchronous (discovery, connection, verification of characteristics, etc), and each depends successful completion of the previous step.

What's the right Cucumber pattern for this kind of thing?

I could write one big scenario (with then / and / and / and) that does it all in one go, but in case of a failure, it doesn't provide details on which step failed.

On the other hand, I could write a series of progressive scenarios (1: verify discovery, 2: verify discovery and connection, 3: verify discovery, connection and characteristics, 4: etc), but I worry that the tests might take a long time to complete.

Is there a "best of both worlds" pattern?


Solution

  • After digging around, I see this question was already nicely answered in: How Do I Write Cucumber Tests That Build On Previous Features (TL;DR: you can't really...)