grails-cucumber
grails-cucumber copied to clipboard
Will be supported Grails 3.x?
I'm just wondering if this plugin support Grails 3? I must say that I'm pretty interested in this feature.
Hi, I fear that there will be no grails 3 version of the plugin. I tried but didn't really find a way to update it :(
There is a cucumber plugin for gradle. I am not sure how well it plays with grails 3 though.
It is still on my todo list to check if the grails-cucumber examples will run with the gradle plugin.
Did you tried this https://grails.github.io/grails-doc/3.0.x/guide/upgrading.html#upgradingPlugins ?
Nope, didn't exist when I tried. But I fear it is a it bit more complicated because the plugin does integrate into the grails 2 test infrastructure and that has changed with grails 3.
I can't exactly remember the details why I stopped. :( I guess I will take another look to get a final answer if it can be updated for grails 3 or if the gradle plugin is all we need.
+1
Looking at it.
Very cool would be to run cucumber features at any test level. That is
- at unit test level. Why run grails if all the feature needs is a few classes?
- at the integration test level. Why start the ui if it is just some service we need?
- at the functional level. Running grails with full ui. What we have now.
Quick findings:
- Obviously the cucumber gradle plugin will not help out of the box because it can't know how to setup the proper grails environment.
- Tricky: with grails 3 all test magic (setup of the enviroment, runing grails etc.) is based on annotating the test classes. With cucumber we don't have test classes we can annotate. Maybe it is possible to magically create a wrapper test/test suite or testrunner around the features and attach the annotations. Not sure how it would know which annotations are needed. This probably needs some hints from the feature-file. No idea if this will work at all. ;-)
Question: which testing "style" do you use with grails 2?
- like
books_remote
example? - like
books_geb
example? - like
books
example?
Hi, just wanted to give an update on Grails 3 support.
I spent some more time on this one and it looks like I have found a way to add cucumber support.
It is heavily experimental code at the moment. Here are a few things that seem to work using super simple examples:
- use cucumber at the unit test level
- use
@TestFor(Controller)
to get the automaticcontroller
member and call it - use
@Mock([Domain])
to save/query a domain object - create/use Spock Stubs
- create/use Spock Mocks and verify their interactions
- run the example scenarios (the .feature file) directly from the ide (intellij)
- use
Not sure yet how reliable it will be (especially the Spock stuff) because it uses internal/private stuff at a few places. :)
Ok. Thanks
Has any additional progress been made on the grails 3.x integration? Additionally, Is there a branch that contains this code so we can contribute if we have time?
Hi,
unfortunately I have not made much progress. I have a some basic code that works and allows the stuff mentioned above. Not tooooo nice at a few places. No grails or gradle integration so far.
What stalled me is reporting. To make the grails test stuff available I create a 'dummy' test around each scenario but that "messes" up the reporting.
There is no branch. I could create a new repo (a grails 3 version would be a completely different project) with my experimental project if you are interested. Would probably have to clean it up a bit first :-)
Hi,
Can you please make the repo available or your source code available so we can progress this further for grails 3?
Thanks in Advance, David
Hi David,
sure. I will create a repo with the experimental stuff I have. Probably on the next Weekend.
Hi,
I have uploaded my experimental code to https://github.com/hauner/grails3-cucumber
I have added some info to the README, explaining what I tried to do. I plan to do a bit more cleanup to the code. There is a lot of duplication that may make it hard to see what is interesting.
If you have any questions, I will try to answer them. Would be nice to hear if you have any ideas what to do with this code :-)
Hi, have you made any significant progress on this ? Our team is quite interested.
I fear not. I am not actively working on it.