Blockumber is an open source project that allows you to create cucumber scenarios not with text editor, but with blockly - hence the name, Blockly + Cucumber = Blockumber.
Most of developers, when they are first introduced to behavior-driven development are told that it's a gorgeous tool for bridging business requirements and automated tests - developers provide a set of step definitions (or glue) and business can create their own scenarios with provided glue.
Then most developers after few months or years of practice with BDD will tell you that it in most cases won't work like that.
In 90% of situations reason is that business is either not elastic enough to understand the principles behind step definitions or is annoyed by the limitations of those definitions that are often hidden under provided scenario editor (though I had the pleasure of working with Product Owner who lied in the sweet spot between - but that might be due to the fact of her IT education).
I'll give you an example.
Product owner provides you with a scenario that he wants to test:
given a basket with 10 cucumbers
when I take 4 cucumbers
then I have 6 cucumbers left in the basket
The you develop your stepdefs accordingly:
Given(~'a basket with (\\d+) cucumbers') { ... }
When(~'I take (\\d+) cucumbers') { ... }
Then(~'I have (\\d+) cucumbers left in the basket') { ... }
All is peachy, devs are happy because they automated verification for the oh-so-important cucumber/basket logic, PO's happy because he can now in his editor create scenarios that will run automatically.
But then PO starts to think about other scenarios:
given a basket with 10 cucumbers
when I take 10 cucumbers
then I have an empty basket
given a basket with 10 cucumbers and a tomato
when I take 4 cucumbers
then I have veggie salad left in the basket
Now two things can happen:
- either product owner notices that tests are red because he is not hitting exact step expressions and he gets angry at limitations of the tools provided
- or product owner notices that tests are red and he gets angry because oh-so-important functionality doesn't work as it should
Either way, this usually means that devs have more work with greening up the pipelines - debugging, coding additional stepdefs, etc., and (hopefully) at some point business notices that this work setup where they write scenarios is not cost effective and they give up.
But this course of action is the result of simple fact - business can do in the text editor much more than the stepdefs allow.
That's basically the reason behind this little project - to provide the editor that allows no more and no less than stepdefs allow (and also bright colors of blockly blocks should draw in the simple business minds).
The repo is divided into three modules
- librarian - an example spring-boot application that will be tested
- librarian-at - separate module containing cucumber scenarios (Why? Because in my experience in big projects' ATs like to migrate to separate module and be run against living application)
- blockumber-main - the meat behind it all
Basically, at startup, Blockumber uses Cucumber to load up stepdefs from provided glue path and uses them to create custom Blockly blocks.
So far Blockumber assumes that cucumber tests can be run without robust external configuration, simply with providing glue location or additional external properties.
To set up, you need follow the librarian-at example.
- Configure your build script to download proper dependency from jCenter:
repositories {
jcenter()
}
dependencies {
compile 'pl.rembol.blockumber:blockumber-main:0.0.3'
}
- Create a bootRun main class in your project (or configure existing one):
@EnableBlockumber
@SpringBootApplication
public class Application extends SpringBootServletInitializer {
public static void main(String[] args) throws Exception {
SpringApplication.run(Application.class, args);
}
}
- Configure path to glue in your application properties:
blockumber.glue=src/test/groovy
- run spring-boot
- navigate browser to "localhost:{server.port}/blockumber"
- be amazed
move controllers and stuff to blockumber-main and configure it using spring-boot annotationsfigure out why it stops after finishing cucumberdisplay reportfigure out how to determine step defs on runtimeconvert stepdefs into blocksrun scenario created from blocksdisplay report nicelyexpand test scenarioswrite a proper readmesaving scenariosloading scenarios- make it more configuratble
- group stepdefs by source
- more patterns:
- (?:takes|is able to take)
- (months?|days?|hours?|minutes?)
- (.+)
- (\d+.?\d*)
- (not)?
- (\d+(?:.\d{1,2})?)
- days?
- scenario outlines
release it