Arquillian Extension QUnit

Driving QUnit tests with Selenium/Drone

License

License

Categories

Categories

JBoss Container Application Servers Arquillian Application Testing & Monitoring
GroupId

GroupId

org.jboss.arquillian.extension
ArtifactId

ArtifactId

arquillian-qunit
Last Version

Last Version

1.0.0.Alpha4
Release Date

Release Date

Type

Type

jar
Description

Description

Arquillian Extension QUnit
Driving QUnit tests with Selenium/Drone
Project URL

Project URL

https://github.com/arquillian/arquillian-extension-qunit
Project Organization

Project Organization

JBoss by Red Hat

Download arquillian-qunit

How to add to project

<!-- https://jarcasting.com/artifacts/org.jboss.arquillian.extension/arquillian-qunit/ -->
<dependency>
    <groupId>org.jboss.arquillian.extension</groupId>
    <artifactId>arquillian-qunit</artifactId>
    <version>1.0.0.Alpha4</version>
</dependency>
// https://jarcasting.com/artifacts/org.jboss.arquillian.extension/arquillian-qunit/
implementation 'org.jboss.arquillian.extension:arquillian-qunit:1.0.0.Alpha4'
// https://jarcasting.com/artifacts/org.jboss.arquillian.extension/arquillian-qunit/
implementation ("org.jboss.arquillian.extension:arquillian-qunit:1.0.0.Alpha4")
'org.jboss.arquillian.extension:arquillian-qunit:jar:1.0.0.Alpha4'
<dependency org="org.jboss.arquillian.extension" name="arquillian-qunit" rev="1.0.0.Alpha4">
  <artifact name="arquillian-qunit" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.jboss.arquillian.extension', module='arquillian-qunit', version='1.0.0.Alpha4')
)
libraryDependencies += "org.jboss.arquillian.extension" % "arquillian-qunit" % "1.0.0.Alpha4"
[org.jboss.arquillian.extension/arquillian-qunit "1.0.0.Alpha4"]

Dependencies

compile (5)

Group / Artifact Type Version
org.jboss.arquillian.extension : arquillian-qunit-api jar 1.0.0.Alpha4
org.jboss.shrinkwrap : shrinkwrap-api jar
org.jboss.arquillian.container : arquillian-container-test-api jar
org.jboss.arquillian.junit : arquillian-junit-core jar
org.jboss.arquillian.graphene : graphene-webdriver pom 2.1.0.Alpha1

provided (1)

Group / Artifact Type Version
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

Obsolete

We don't maintain this code base anymore. If you are interested in picking it up from where we left please reach out to us through Arquillian forum.

Arquillian QUnit

Arquillian QUnit is an Arquillian extension which automates QUnit JavaScript unit testing. It integrates transparently with the JUnit testing framework and can be easily used in continuous integration environments.

Arquillian-Qunit identifies the number of QUnit tests that have to be executed before the actual QUnit tests execution. In the case of a stuck QUnit Test Suite, the stuck tests are marked as errored.

For instance, when executing these QUnit tests, the QUnit Test Suite gets stuck as shown in the below image. Arquillian-QUnit marks the stuck tests as errored.

Stuck QUnit Test Suite

In order to verify this kind of QUnit Test Suite validation, uncomment the corresponding showcase test and execute the functional test.

The execution results will be:

Results

Execute QUnit tests through an IDE

You can execute the QUnitRunnerTestCase through your favorite IDE.

The results for the showcase example will be:

Results

Arquillian QUnit Functional Test / Showcase

This project contains the functional test / showcase for the Arquillian-QUnit project. Navigate to the arquillian-qunit-ftest project and execute:

mvn test -P arq-jbossas-managed

The Arquillian QUnit Functional Test defines the three core aspects needed for the execution of an Arquillian test case:

  • container — the runtime environment
  • deployment — the process of dispatching an artifact to a container
  • archive — a packaged assembly of code, configuration and resources

The container's configuration resides in the Arquillian XML configuration file while the deployment and the archive are defined inside the QUnitRunnerTestCase file.

The test case is dispatched to the container's environment through coordination with ShrinkWrap, which is used to declaratively define a custom Java EE archive that encapsulates the test class and its dependent resources. Arquillian packages the ShrinkWrap defined archive at runtime and deploys it to the target container. It then negotiates the execution of the test methods and captures the test results using remote communication with the server. Finally, Arquillian undeploys the test archive.

The POM configuration file contains two profiles:

  • arq-jboss-managed — managed container
  • arq-jboss-remote — remote container

An Arquillian managed container is a remote container whose lifecycle is managed by Arquillian. The specific profile is also configured to download and unpack the JBoss Application Server 7.1.1.Final distribution zip from the Maven Central repository.

Instructions to setup a new test class

  • Add the Arquillian-QUnit dependency to the POM file:

      <dependency>
          <groupId>org.jboss.arquillian.extension</groupId>
          <artifactId>arquillian-qunit</artifactId>
          <version>${project.version}</version>
      </dependency>
    
  • Add the arquillian-junit-container (whole lifecycle of the container and deployment will be managed by Arquillian) or arquillian-junit-standalone dependency.

      <dependency>
          <groupId>org.jboss.arquillian.junit</groupId>
          <artifactId>arquillian-junit-container</artifactId>
      </dependency>
    
      <dependency>
          <groupId>org.jboss.arquillian.junit</groupId>
          <artifactId>arquillian-junit-standalone</artifactId>
      </dependency>
    
  • To create an Arquillian QUnit test class, annotate the test class with the @RunWith(QUnitRunner.class) and @QUnitResources annotations. The @QUnitResources annotation’s value should be the path of the folder which contains all the QUnit resources and dependencies which are required for your QUnit tests execution. For each QUnit Test Suite that you would like to execute, create a method and annotate it with the @QUnitTest annotation. The annotation’s value should be the QUnit Test Suite path, relative to the @QUnitResources path.

  • Note that each QUnit Test Suite should be completed in a time period of 2 minutes.

Known Limitations

  • The run/execution time printed in the report is not accurate.
  • Multiple deployments are not supported.

Documentation

Releasing new version

Run following commands:

mvn clean release:prepare release:perform

Make sure that you push the tag, close all issues with given version in JIRA and mark version as released.

org.jboss.arquillian.extension

An Innovative Testing Platform for the JVM

Versions

Version
1.0.0.Alpha4
1.0.0.Alpha3
1.0.0.Alpha2
1.0.0.Alpha1