Potential Issues
The first time I worked on test automation was around 2006, and when I started seeing people using Cucumber I didn't get it. I always thought there were a lot of problems with thinking that a human-readable English DSL (domain-specific language) was going to solve your problems. The most immediate one was that English doesn't compile. Enter Step Definitions, which take a lot of time to write, translating the English to the method calls in your code. In addition, having everyone agree on the exact syntax of the Gherkin seemed like a huge challenge. For the simplest case of being logged in, is it "Given I am logged in" or "Given I'm already logged in" or "Given I have logged in?" All of this just to have tests written in English... no way.Flows
I have been using Flows in addition to or instead of Page Objects in my frameworks for years, and I wanted to show someone a side-by-side comparison of my Flow methods calls vs Gherkin. Here's the example from a test a few companies ago. This (flow code) is actual code from the test.
The beauty of having this flow class is that with a decent IDE, you type "flow." and you'll be given a list of all the methods in the class, which is easier than remembering the exact Gherkin phrase.
I had been having these thoughts for a while. I have never seen people using Cucumber but always wanted to. Some people I know and respect say it's useful or that they've seen it done. Then I saw this post* by Aslak Hellesøy, the author of Cucumber, and was so happy to have my beliefs confirmed. It's a quick read, but basically he says if you're just using Cucumber for automated testing, you're missing the point.
Cucumber is a BDD tool, and the automated tests are a byproduct of the process. If the testing team is the ones "doing Cucumber" you likely need to reevaluate your situation. Using Cucumber correctly involves buy-in from product and development as well as QA.
Cucumber is a BDD tool, and the automated tests are a byproduct of the process. If the testing team is the ones "doing Cucumber" you likely need to reevaluate your situation. Using Cucumber correctly involves buy-in from product and development as well as QA.
No comments:
Post a Comment