Example of the grails cucumber plugin? - grails

I want to start using cucumber with my grails project, and this plugin seems like it's still healthily vibrant:
http://grails.org/plugin/cucumber
However, I am completely lost as to how to start. Are there any tutorials or example grails (2.0 would be awesome) projects which use this cucumber plugin?

Here is a great tutorial by the author:
https://github.com/hauner/grails-cucumber/wiki/Testing-Grails-with-Cucumber-and-Geb

Related

Grails 3.1.0.M2 Database Reverse Engineering

Need of help.
I am new to Grails,
My question is How to do db-reverse-engineer.?
I did it in Grails 2.5.1 but I am struggling with Grails 3.1.0.M2 version.
Thanks in advance.
There's no plugin for Grails 3. I started to convert the older one but it's more work than I was expecting because it has to work with Hibernate 4, and the old plugin only works with Hibernate 3.
But the generated files wouldn't be any different in Grails 3 than in Grails 2 since GORM has stayed rather consistent. Since the plugin is only used at build time, and often only once or at most a few times, I recommend that you configure a Grails 2 app with the same database config settings and using the plugin there, then moving the generated files to your Grails 3 app.

Grails 3 and Spring Security Plugin

I've just recently started working with Grails, and I'd like to test out the Spring Security Plugin. I'm using Grails v3.0.0RC2, and I'm finding it difficult to come across accurate documentation for it with a lot of things.
I'm looking at the Grails page for the Spring Security Plugin, located at http://grails.org/plugin/spring-security-core, and it tells me to add the following to grails-app/conf/BuildConfig
plugins {
…
compile ':spring-security-core:2.0-RC4'
…
}
Now, Grails 3 has done away with the BuildConfig, and moved over to using Gradle. So I figured I could just that compile line to my "dependencies" section in build.gradle and it would work, like so:
dependencies{
...
compile:":spring-security-core:2.0-RC4"
}
However, that did not work. I get the error "Could not find :spring-security-core:2.0-RC4...".
Then I figured, 'Hey, it's a plugin, let me try prefacing it with "org.grails.plugins" like I see elsewhere in the build.gradle file:
dependencies{
...
compile:"org.grails.plugins:spring-security-core:2.0-RC4"
}
And still no go.
I have gotten it to compile by adding the dependency found on search.maven.org, like so:
dependencies{
...
compile 'org.springframework.security:spring-security-core:4.0.0.RELEASE'
}
But I don't think thats the proper way to do, because Grails documentation says I should have access to the command
grails s2-quickstart
once the plugin is installed, which I do not when I do it using the Maven repo.
I'm sure there's a simple configuration error I'm making, as I'm very new to both Grails, Spring, and Gradle, so I appreciate any help that can be provided.
The Spring Secuirty core plugin for Grails is not Grails 3 compatible. However, since Grails 3 is based on Spring Boot you can use the Spring Security Starter for Spring Boot instead.
This has been discussed on the Grails developers mailing list and going forward many Grails plugins will not be moved to Grails 3 and instead will be replaced by pure Spring solutions.
Update
Since this question was originally asked there has been a Spring Security plugin created for Grails 3.x. It can be found here: https://bintray.com/grails/plugins/spring-security-core/view
The "Spring Security Starter for Spring Boot" is a good starting point, but if you want to save yourself some time trying to figure out how to get it to work with Grails, check out this helpful blog post.
I wrote the blog post #Jamie referenced in his answer and I added a new blog post describing how to use the Gorm domain classes from Spring-Security-Core plugin from Grails 2.
dependencies {
...
compile 'org.grails.plugins:spring-security-core:3.0.4'
...
}
This is what I used and it worked for me

Grails 3 does not have wrapper?

Does Grails 3.0.x no longer have the ability to create wrappers anymore?
The documentation doesn't seem to have the Grails wrapper section anymore.
Is there an alternative way which we can use the gradle wrapper to execute grails commands such as create-controller?
Does Grails 3.0.x no longer have the ability to create wrappers
anymore?
No.
Is there an alternative way which we can use the gradle wrapper to
execute grails commands such as create-controller?
Not for commands like create-controller, no.
We may re-introduce grailsw. File a feature request at https://github.com/grails/grails-core/issues if you would like to track that.
The Grails wrapper is back as of Grails 3.2.3:
http://docs.grails.org/3.2.x/guide/introduction.html#whatsNewGrailsWrapper
I have an app created with Grails 3.1.x, then upgraded to Grails 3.2.6, but the files such as 'grailsw' did not appear in my project root, and I'm not sure how to get them added via some command in the project.
When I create a new app using Grails 3.2.6, the new files are in the project root (grailsw, grailsw.bat, grails-wrapper.jar). I assume they can be copied over to an app like mine: a quick test of this worked for me.

Should I use Cucumber for an AngularJS single page application?

I'm fairly new to both Cucumber and Angular. I have a rails application that is a single page application. Should I bother with Cucumber or should I just use AngularJS's e2e testing?
Any insight, comparison and past experience is appreciated!
We use a combination of Cucumber and Jasmine for our Angular application.
Months ago when I initially tried to get Angular's e2e testing framework running , the documentation was pretty limited so we opted for Cucumber - Selenium for the UI tests.
I believe with Angular's e2e framework you can mock calls to backend but if you want to do actual integration testing using Cucumber + Selenium is a decent option.
You should check out Cucumber.js.
If you're looking for a more comprehensive example using Protractor checkout this angular-cucumber-example.

Integrate test process with Rspec and Cucumber in a plugin using Desert

I'm developing some rails plugins with desert, and I would like to use tests with RSpec and Cucumber in the development. RSpec is integrated by default in Desert plugins, but it gives me some bugs.
Finally I have created a minimal application which use my plugin, and I try to test it like a normal application without plugin. But I dislike that solution, the plugin lost its modularity, and RSpec still returns me some bugs (he can't find the models/views/controllers located in the plugin...).
So am I the only one who try to test a Desert plugin (or even in a classic plugin) ? May anyone know those matters and get a solution ?
I was working with 'Desert' plug-ins in a legacy Rails 2.2.2 app and the following helped me http://pivotallabs.com/users/joe/blog/articles/985-testing-desert-plugins-in-isolation
You should not use desert plugin, it's an 'old thing'.

Resources