grails-cucumber icon indicating copy to clipboard operation
grails-cucumber copied to clipboard

Will be supported Grails 3.x?

Open magx2 opened this issue 9 years ago • 14 comments

I'm just wondering if this plugin support Grails 3? I must say that I'm pretty interested in this feature.

magx2 avatar Nov 03 '15 11:11 magx2

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.

hauner avatar Nov 04 '15 19:11 hauner

Did you tried this https://grails.github.io/grails-doc/3.0.x/guide/upgrading.html#upgradingPlugins ?

magx2 avatar Nov 05 '15 22:11 magx2

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.

hauner avatar Nov 22 '15 14:11 hauner

+1

Luxor avatar Dec 08 '15 16:12 Luxor

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?

hauner avatar Dec 19 '15 15:12 hauner

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 automatic controller 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)

Not sure yet how reliable it will be (especially the Spock stuff) because it uses internal/private stuff at a few places. :)

hauner avatar Jan 10 '16 10:01 hauner

Ok. Thanks

Luxor avatar Jan 10 '16 16:01 Luxor

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?

chadws avatar Sep 02 '16 12:09 chadws

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 :-)

hauner avatar Sep 04 '16 17:09 hauner

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

dap10 avatar Feb 20 '17 00:02 dap10

Hi David,

sure. I will create a repo with the experimental stuff I have. Probably on the next Weekend.

hauner avatar Feb 27 '17 21:02 hauner

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 :-)

hauner avatar Mar 05 '17 18:03 hauner

Hi, have you made any significant progress on this ? Our team is quite interested.

pol-uguen-cbp avatar Jun 01 '18 13:06 pol-uguen-cbp

I fear not. I am not actively working on it.

hauner avatar Jun 10 '18 15:06 hauner