How to create functional test directory in grails - grails

I am trying to create functional tests in grails. I have integration and unit tests. But i am unable to create functional tests directory. I am using grails 2.4.5 version

Grails 2 does not ship with functional testing capabilities. Noted in the documentation here. Using a plugin for functional testing is the recommended practice.
Grails does not ship with any support for writing functional tests
directly, but there are several plugins available for this.
Canoo Webtest - http://grails.org/plugin/webtest
G-Func - http://grails.org/plugin/functional-test
Geb - http://grails.org/plugin/geb
Selenium-RC - http://grails.org/plugin/selenium-rc
WebDriver -http://grails.org/plugin/webdriver
Consult the documentation for each plugin for its capabilities.
Grails 3 does ship with the ability to create functional testing using the Geb framework as documented here:
Grails by default ships with support for writing functional tests
using the Geb framework. To create a functional test you can use the
create-functional-test command which will create a new functional
test

Related

Do we need more of an automation analyst's time in BDD than we would need in a non-BDD project?

I am new to BDD and willing to follow BDD methodology for my test Automation projects. Do we need more of an automation analyst's time in BDD than we would need in a non-BDD project?
The term BDD means behaviour driven development. It means development (not testing) derives from behaviour and that behaviour would be the acceptance criteria.
You can use the same scripts (Gherkin syntax ) for test automation but you need other tools as well (like selenium, WebUI etc.) to do actual test automation (For developer automation they can use the same business logic they have written to invoke from BDD scripts). So if an automation tester uses BDD then only thing they can do there is to create automation test scripts (in Gherkin syntax) and generate skeleton of the behaviour then to integrate with automation test frameworks. BDD is not the replacement of testing frameworks like selenium, QTP etc. Effort wise there will not be much difference (If you know test automation already) if you use BDD (Gherkin syntax) for your automation. One or the other place you have to write test scripts. If it is BDD then that will be Gherkin syntax in a file.

How to order NUnitLite tests (for integration testing)?

We are trying to port integration tests that are using NUnit to NUnitLite provided with Xamarin. Some of the tests should run in a particular order. However it looks like there no OrderAttribute or any dependency attribute present in NUnitLite.
Are there any approach for running tests in an order on iOS and Android?
NUnit 2.6.4 and 3.0 runs tests in alphabetical order. Since the Xamarin NUnitLite code is a fork, it may behave the same.
Another option is to use NUnit 3's Xamarin runner. NUnit 3.2 added an Order attribute and I will be updating the Xamarin runner to use 3.2 shortly. For more information on using the Xamarin runner and NUnit, see Testing Xamarin Projects using NUnit 3

Using grails-mail-plugin outside Grails app

Is it possible to use a grails plugin outside a grails application?
I would like to use the functionality of grails-mail-plugin in a simple groovy/gradle app.
I found some information about binary plugins but I'm not sure how to define the dependency to an official grails plugin.
Thanks!
I don't think you could use any Grails plugin itself outside the Grails environment, usually there is a ton of Grails-specific assumptions built into the plugins' code.
If your Groovy application uses Spring, you could migrate the most important functionality out of it.
For this, you will have to get into the innards of the source code of the plugin (e.g. how it uses the Spring Mail package for example) which not may be very quick or easy work.
If your requirements are simple, you may be better of with building a standalone solution, possibly, directly on top of JavaMail.
If you already have a heterogeneous architecture, you may build a separate Grails application/module which only does mailing functionality (possibly through the Async Mail plugins database tables) in integration with the module you build in pure Groovy.

How to do ASP.NET MVC Integration testing using selenium

I need to know is it possible to perform integration testing using selenium for ASP.NET MVC applications. If yes then What are the requirements and how to do it. Will it be an external application to test from UI or should I be using views. Really confused. Please guide
If you are planning to write the Selenium tests using C#, which I'd recommend over using any kind of test recorder, then this will be a separate project.
You will run this and it will test a deployed version of your application, ideally in a dedicated test environment. There is extensive documentation available.
Personally I and others prefer WatiN for testing web applications using C# written tests.
Selenium can be used for testing any web applications include ASP.NET MVC. In general, you add test project to solution and write tests in it. Selenium open browser and execute commands that is described in your test. You can write test in c# or can use recorder and save record as c# test.

Grails good BDD framework

Is there RSpec analogue for Groovy/Grails?
I found a few blog posts mentioning GSpec but there is not much out there.
Is built-in Grails testing framework as good as it gets in Grails?
Grails offers various other testing frameworks through the use of plugins. For instance the Spock plugin simplifies testing using a very expressive natural language. You can find more information on Spock here as well.
Another popular testing framework for Grails is EasyB. It also has a plugin.
I would recommend you look at the various testing frameworks available, then see how they are supported by Grails.

Resources