qa/arquillian-qunit — pull request #1 by tolis-e (2013-03-18 09:29:41+00:00)
Title: Changes to test a Web Application

Changes:

- An Archive which contains both the test cases and the application's content (if any exists) is created and deployed.
- The phantom-js-driver has been removed.
- The Arquillian-Warp extension has been removed.
- The dependencies versions have been updated to the latest ones.
- The template of a QUnit test case has been changed as following.
* The Arquillian `@Deployment` annotation is used when the deployment of an application is required. This annotation provides consistency between the test cases which use the Arquillian controller and the test cases which use the QunitRunner controller.
* The Archive (WAR / EAR both are handled) which is created as a result of the deployment method is merged with the test cases and the final archive is deployed. In the cases where the deployment of an application is not required and the `@Deployment` annotation does not exist inside the test case, then a WAR file named test.war is created and deployed.
* The `@QunitTest` annotation is defined as method annotation instead of type. The reason is that the user may want to execute more than one Qunit Tests on the same test case.
* The Arquillian Junit `@InSequence` annotation is used to handle the execution order of the Qunit Tests.

Below is a sample Test case:

@RunWith(QUnitRunner.class)
@WebRoot("src/main/webapp")
@RunAsClient
public class DemoTest {

private static final String DEPLOYMENT = "../../../demo/target/demo-app.war";

@Deployment()
public static WebArchive createDeployment() {
return ShrinkWrap.createFromZipFile(WebArchive.class, new File(DEPLOYMENT));
}

@QUnitTest("qunit-tests-dom.html")
@QUnitTestSequence(1)
public void qunitDomTest() {
// empty body - only the annotations are used
}

@QUnitTest("qunit-tests-ajax.html")
@QUnitTestSequence(2)
public void qunitAjaxTest() {
// empty body - only the annotations are used
}
}