How to do testing with lift applications? - testing

How to do testing and is there something similar like Rack::Test with ruby frameworks?

You can use Specs, ScalaTest and JUnit (and any other java test framework), theres some examples on the new wiki.
Read this!

I don't know much about ruby, so maybe don't get your point. But what about Jitr?
Jitr (pronounced "jitter") is a JUnit
Integration Test Runner.
It allows your web application
integration tests to easily run
against a lightweight web container in
the same JVM as your tests.
You can use it with JUnit 4's #RunWith annotation. In Scala: #RunWith(classOf[Jitr]).

This may be of help, it's on Lifts wiki pages. There are examples using Junit, Scalatest and and Specs.
How To: Unit test lift snippets with a logged in user

Related

How to test JUnit Jupiter (JUnit 5) Extensions

Is there a way to integration test my JUnit Jupiter extension? Of course I can test a good cases of extension usage, but I would like to test things like:
Does it fail tests as expected?
Are the correct reports written on test end?
Is there some built in support for this?
There is no explicit Jupiter extension testing framework -- but with version 1.4 there'll be the Platform Test Kit that you may use to execute the Jupiter engine and your extension in one-go and assert the outcome of a test run.
For details see: https://junit.org/junit5/docs/snapshot/user-guide/#testkit and in addition to that documentation, find usages of the Platform Test Kit within the "platform-tests" project of JUnit 5. For example at: https://github.com/junit-team/junit5/blob/master/platform-tests/src/test/java/org/junit/platform/testkit/engine/ExecutionsIntegrationTests.java
You should not perform integration testing for your own extension of Junit. The Junit 5 API is very, very stable and I bet that your extension will work the same for the entire life of Junit 5. Integration testing is useful in a constantly evolving environment, but Junit only ever adds features and never changes them (unless there is a bug).
If you perform integration testing for your own Junit extension, it's like you're testing Junit itself. Why would you test Junit instead of your extension? Let Junit be tested by Junit developers, unless you think you found a bug. But testing Junit for the sake of testing Junit is a waste of your own time, even if unconsciously you think you're only testing your own extension.
So that kind of tests should be done on the long term by getting your users to report issues to you: "Hey, AwesomeExtension works with Junit 5.A.B but not with 5.X.Y", then find out why they say that and if the issue is not with your extension, then report with Junit.
However, make sure that you get your extension... unit-tested.

How do I setup Cucumber with Grails 3.2.4 for Testing with Grails?

I've been trying to do BDD testing with Grails 3.2.4 and I've had difficulty integrating Cucumber(https://cucumber.io/) with Grails 3.2. If it can be done then how do I setup cucumber for testing?
I've tried setting up with gradle cucumber but it doesn't seem to be working properly and there isn't much of a guide to getting it setup. See https://github.com/samueltbrown/gradle-cucumber-plugin for gradle cucumber and https://github.com/hauner/grails-cucumber for Grails cucumber which is not compatible with Grails 3.2.
As far as I can understand you are able to use Java libraries. Looking in the docs tells me that it is possible to use JUnit for unit testing.
This leads me to think that you should be able to use the Java Skeleton provided by the Cucumber team.
My approach would be to clone it and get it to run. It should run out of the box. Then include it in your test suite for your project.
I've got cucumber to work with just a dummy test class (not a Grails domain class), but when I try to test a real domain class to make sure the attribute constraints are adhered to, it doesn't work. The class is not seen as a domain class and I'm told GORM has not been initialized. I'll be one step closer to getting Cucumber to work with Grails 3 once I find out how to initialize GORM in the Cucumber step defintions.

Is there any framework which supports Behaviour driven approch (bdd) for selenium-webdriver with driver managment?

I want to start my automation project from scratch, as per requirements I have to use Behavior Driven Approach for testcase authoring and selenium for Automation. please suggest best suited framework.
You can check open source QMetry Automation Framework for web (selenium-webdriver) and mobile (appium) automation. It has all the features driver management, parallel execution, run configuration you want and many more like data-driven testing, data-bean, locator repository, integration with third party tools (CI, Test Management tools etc).
It support BDD, keyword-driven and coded (TestNG test) approach for authoring test cases. So you can opt bdd for test authoring.
You also will find inbuilt bdd steps ready to use for selenium webdriver and rest-webservices with the framework.
You can start by downloading blank project from git which uses ANT and IVY. If you want to use maven you can download qaf-blank-project-maven.
For getting started follow step-by-step-tutorial

Is TestNG enough as a web test framework?

I just moved into web testing using Selenium and have been learning Selenium WebDriver + Java.
My question is, why do I need to build a test framework when TestNG is there?
What is there that TestNG cannot do as a framework?
Nothing :-)
More seriously, TestNG is very popular with Selenium users for a variety of reasons, among which support for:
Dependencies (very convenient to test pages that follow each other).
Parameterization with #DataProvider (useful to test various combinations of browsers and user agents).
Parallel tests (lets you test on multiple browsers simultaneously).
Check out the Selenium forums for more information and feel free to email the testng-users list if you have questions.
Yes, I think TestNG is enough as a web test framework. If you are familiar of using JUnit, It is easier to switch into TestNG
Building a custom framework may be necessary at times.
And you can use TestNG for that. :)

How to present a Selenium test written in spec or PHPUnit on Hudson

I am setting up Selenium tests on Hudson and looking for an easy way to present nice results such as Project summary and build summary on Hudson.
Currently I have written Selenium test cases in Rspec and PHPUnit's extension for Selenium (I prefer working on Rspec over PHP).
What is the best way to present detailed report for Selenium tests on Hudson CI Server?
I prefer to use Rspec over PHPUnit. It would be very nice if I can use rspec and still integrate well with Hudson CI Server.
I would very much appreciate for detailed comments.
thank you so much for your help
Best regards
If you have the results as HTML files, you can use the HTML Publisher plugin.
Have a look at a similar question https://serverfault.com/questions/184805/how-to-view-test-results-in-hudson/185027#185027 This guy seams to have integrated the selenium tests into junit and therefore the results can be published using the xunit tests.
There are two selenium plugins, one should work for you.
This I have no idea what rspec is I entered rspec and Hudson into google. The second link was this one http://reprocessed.org/blog/easy_rails_ci_with_hudson It should contain everything you need.