Graphene 2.0.0.Alpha2 Released

Since we wrote this post we didn't laze around. Check our latest announcement.

The Arquillian team is proud to announce the 2.0.0.Alpha2 release of the Graphene component!

Graphene 2 is building on top of the Selenium WebDriver API and provide extensions for writing reusable, robust and AJAX-enabled tests with improved readability.

Graphene 2 uses the ideas from Graphene 1 (based on Selenium 1 API) and applies it to the world of Selenium WebDriver.

You can read more about the difference between Graphene 1 and Graphene 2 in the Reference Documentation

Features

Page Abstractions

Page abstractions allow you to abstract page functionality using the well-known Selenium design pattern Page Objects. In Graphene you can inject page objects directly into the test case using the @Page annotation.

But we take the Page Objects pattern one step further with the concept of Page Fragments . Page Fragments are reusable parts within a page encapsulated into an object similar to Page Objects. A good example of Page Fragments are JavaScript widgets or forms.

The concept of Page Fragments comes from an idea that those components share a same underlying DOM structure, the only difference between all occurences of a component is a location in a DOM tree where a component is rendered – this is denoted by the @Root annotation. You can define this root location for each concrete occurence using a @FindBy(locator) annotation.

Fluent-API for Waiting Conditions

Graphene provides a set of widely used conditions to avoid writing them repeatedly.

Request Guards

Request guards block the Selenium test execution until a network communication caused by a given action ends. Guards support blocking on HTTP and XHR (AJAX) but can also be used to verify that no such requests were done.

Under the Hood

There are some low level features exposed as API that are used by Graphene internally. While not used regularly within a normal test, can be handy to write more robust tests:

JavaScript Interface

This allows you to write a Java interface which automatically translates Java API invocations to JavaScript calls:

@JavaScript
public interface Document {
    String getTitle();
}
Page Extensions

Page Extensions allow you to inject arbitrary JavaScript code in the page under the test. The javascript code might help you to test complex situations as well as bring completely new features for improving testing. Graphene internally uses Page Extensions for Request Guards.

Graphene Context

Graphene allows you to obtain current thread-local context of a browser session and inject it exactly where you need. No more need for driver reference propagation.

Documentation

Last but definitely not the least addition is the great documentation for all of the features above including answers for general questions like how Selenium 1, Graphene 1, Selenium WebDriver and Graphene 2 relates to each other, what’s the relation between Graphene’s, Drone and Arquillian.

Getting Started

It’s the same as with any other Arquillian extension: open the IDE, setup the Maven dependency and you are ready to start testing!

What’s next?

In the upcoming releases, we would like to focus on more new features as well as migrate some features from Graphene 1 to Graphene 2:

  • Forge plugin for quick start
  • command interceptors
  • parallel browser session control
  • jQuery/Sizzle locators
  • AJAX/HTTP Communication Halter
  • page abstraction improvements
  • closer integration with the Arquillian event system
  • helpers for writing browser specific code

Call to Action

Let us know what you think and help us shape Graphene to be what you want it to be.

What is Arquillian?

Arquillian is open source software that empowers you to test JVM-based applications more effectively. Created to defend the software galaxy from bugs, Arquillian brings your test to the runtime so you can focus on testing your application's behavior rather than managing the runtime. Using Arquillian, you can develop a comprehensive suite of tests from the convenience of your IDE and run them in any IDE, build tool or continuous integration environment.

Release details

Component Graphene
Version 2.0.0.Alpha2 view tag
Release date 2012-09-12
Released by Lukas Fryc
Compiled against

Published artifacts org.jboss.arquillian.graphene

  • org.jboss.arquillian.graphene » graphene-parent pom
  • org.jboss.arquillian.graphene » graphene-selenium-parent pom
  • org.jboss.arquillian.graphene » graphene-selenium-api jar javadoc pom
  • org.jboss.arquillian.graphene » graphene-selenium-impl jar javadoc pom
  • org.jboss.arquillian.graphene » graphene-selenium-drone jar javadoc pom
  • org.jboss.arquillian.graphene » graphene-selenium pom
  • org.jboss.arquillian.graphene » graphene-webdriver-parent pom
  • org.jboss.arquillian.graphene » graphene-webdriver-impl jar javadoc pom
  • org.jboss.arquillian.graphene » graphene-webdriver-drone jar javadoc pom
  • org.jboss.arquillian.graphene » graphene-webdriver pom
  • org.jboss.arquillian.graphene » graphene-webdriver-spi jar javadoc pom
  • org.jboss.arquillian.graphene » arquillian-graphene pom
  • org.jboss.arquillian.graphene » graphene-component-api jar javadoc pom

Release notes and resolved issues 30

Adopting critical functionality from Graphene 1; Page Fragments

Component Upgrade
  • ARQGRA-150 - Upgrade to Arquillian Core 1.0.2.Final
Feature Request
  • ARQGRA-40 - Support for Component Objects pattern for Selenium 2
  • ARQGRA-41 - Support for Java-to-JavaScript calling interfaces
  • ARQGRA-62 - Umbrella: Adopt Graphene for usage of WebDriver/Selenium 2 API
  • ARQGRA-67 - Migrate request guards to Selenium 2
  • ARQGRA-71 - Adopt JavaScript injection (Page Extensions) for Selenium 2
  • ARQGRA-74 - Support Graphene utility in original scope with Selenium 2
  • ARQGRA-156 - Introduce Opera and RemoteWebDriver factory wrappers
  • ARQGRA-157 - Support XHR interception
  • ARQGRA-160 - Create a configurator for Graphene 2 using arquillian.xml
  • ARQGRA-161 - Introduce profile to enable execution from several browsers
  • ARQGRA-179 - Document difference between Graphene 1 and Graphene 2 (Selenium 1 and WebDriver)
  • ARQGRA-180 - Document Graphene - Getting Started
  • ARQGRA-181 - Document Using WebDriver
  • ARQGRA-182 - Document Using Drone
  • ARQGRA-183 - Document Testing AJAX
Bug
  • ARQGRA-6 - Using of JQuery 1.5 causes that JQuery selectors are not escaped properly
  • ARQGRA-151 - Graphene.getProxyForInterfaces returns wrong proxy
  • ARQGRA-159 - Use Drone depchain in Graphene depchain
Task
  • ARQGRA-132 - Add BOM usage into documentation
  • ARQGRA-158 - Check and complete all documentation for all features in Alpha2
  • ARQGRA-163 - Refactor Graphene Webdriver SPI module
  • ARQGRA-171 - Refactor Component Objects - mainly make Component Obejcts as POJO
  • ARQGRA-172 - Documentation for Page Extensions
  • ARQGRA-173 - Documentation for Page Fragments
  • ARQGRA-175 - Documentation for JavaScript interfaces
  • ARQGRA-176 - Documentation for GrapheneContext and proxies
  • ARQGRA-177 - Documentation for Request Guards
  • ARQGRA-178 - Documentation for Graphene utility class
  • ARQGRA-186 - Rename Component Objects dependencies to Page Fragments

Thanks to the following list of contributors: Jan Papoušek, Lukas Fryc, Juraj Huska, Brian Leathem

ShrinkWrap Resolver 2.0.0-alpha-2 Released

Since we wrote this post we didn't laze around. Check our latest announcement.

The Arquillian team is proud to announce the 2.0.0-alpha-2 release of the ShrinkWrap Resolver component!

What is ShrinkWrap Resolver?

The ShrinkWrap Resolvers project provides a Java API to obtain artifacts from a repository system. This is handy to include third party libraries available in any Maven repository in your test archive. ShrinkWrap Resolvers additionally allow you to reuse all the configuration you've already specified in the Maven build file, making packaging of an application archive much easier job.

Release details

Component ShrinkWrap Resolver
Version 2.0.0-alpha-2 view tag
Release date 2012-09-13
Released by Andrew Lee Rubinger
Compiled against
  • JUnit – 4.8.2

Published artifacts org.jboss.shrinkwrap.resolver

  • org.jboss.shrinkwrap.resolver » shrinkwrap-resolver-bom pom
  • org.jboss.shrinkwrap.resolver » shrinkwrap-resolver-api jar javadoc pom
  • org.jboss.shrinkwrap.resolver » shrinkwrap-resolver-api-maven jar javadoc pom
  • org.jboss.shrinkwrap.resolver » shrinkwrap-resolver-api-maven-archive jar javadoc pom
  • org.jboss.shrinkwrap.resolver » shrinkwrap-resolver-depchain pom
  • org.jboss.shrinkwrap.resolver » shrinkwrap-resolver-maven-plugin-tests jar javadoc pom
  • org.jboss.shrinkwrap.resolver » shrinkwrap-resolver-impl-maven jar javadoc pom
  • org.jboss.shrinkwrap.resolver » shrinkwrap-resolver-impl-maven-archive jar javadoc pom

Release notes and resolved issues 18

Premiere of new API

Component Upgrade
Feature Request
  • SHRINKRES-9 - MavenDependencyResolver configureFrom should allow specifying properties for profile activation
  • SHRINKRES-32 - Enable dependency resolver to be cached for time-sensitive environments
  • SHRINKRES-45 - Allow for "offline" settings in new API
  • SHRINKRES-46 - Cache configurations for N resolution calls
  • SHRINKRES-60 - Modify API such that configuration of settings must happen before config from POM
Bug
  • SHRINKRES-34 - Scoped artifacts in ShrinkWrap Resolver BOM
Task

Thanks to the following list of contributors: Andrew Lee Rubinger, Karel Piwko, Carlo De Wolf, Samuel Santos, Tair Sabirgaliev, Sachin Patil, Aslak Knutsen

Arquillian Drone Extension 1.1.0.CR3 Released

Since we wrote this post we didn't laze around. Check our latest announcement.

The Arquillian team is proud to announce the 1.1.0.CR3 release of the Arquillian Drone Extension component!

After some thought we realized that the current options for configuration (and implementation for that matter) were too complicated. While browserCapabilities allowed you to ignore the implementing class of WebDriver, you were still required to remember how to set up various capabilities.

We dropped the capability configuration support as you know it from CR1 and CR2 and replaced it with something much easier to use. You can now set up the capabilities directly as they come from WebDriver.

Some of the highlights in this release

Direct capability mapping. Think of any WebDriver capability, such as opera.no_restart or acceptSSLCerts, you can now specify them directly in arquillian.xml:

arquillian.xml
<extension qualifier="webdriver">
    <property name="browserCapabilities">firefox</property>
    <property name="opera.no_restart">true</property>
    <property name="acceptSSLCerts">false</property>
</extension>

Deprecated Arquillian Drone system properties configuration in favor of the system properties configuration provided by Arquillian Core. The old style of system properties still work, but using them will produce warnings in the log and will be removed completely in a later version.

In the previous arquilian.xml snippet, browserCapabilities would map to arquillian.webdriver.browser.capabilities. The correct way to override this property is now arq.extension.webdriver.browserCapabilities. With the new properties handling you can also provide the properties in a file by spcifying the file name in the arquillian.properties system property.

The same apply to the qualifiers support. Given the following arquillian.xml snippet you would now use arq.extension.webdriver-myqualifier.browserCapabilities instead of the legacy arquillian.webdriver.myqualifier.browser.capabilities:

arquillian.xml
<extension qualifier="webdriver-myqualifier">
    <property name="browserCapabilities">chrome</property>
</extension>

We hope that this will make Arquillian Drone easier to use, especially for people who have already tried to use browserCapabilities.

We look forward to hearing your feedback about this release in the community forums!

What is Arquillian?

Arquillian is open source software that empowers you to test JVM-based applications more effectively. Created to defend the software galaxy from bugs, Arquillian brings your test to the runtime so you can focus on testing your application's behavior rather than managing the runtime. Using Arquillian, you can develop a comprehensive suite of tests from the convenience of your IDE and run them in any IDE, build tool or continuous integration environment.

Release details

Component Arquillian Drone Extension
Version 1.1.0.CR3 view tag
Release date 2012-09-10
Released by Aslak Knutsen
Compiled against

Published artifacts org.jboss.arquillian.extension

  • org.jboss.arquillian.extension » arquillian-drone-bom pom
  • org.jboss.arquillian.extension » arquillian-drone-selenium-depchain pom
  • org.jboss.arquillian.extension » arquillian-drone-webdriver-depchain pom
  • org.jboss.arquillian.extension » arquillian-drone-api jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-drone-spi jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-drone-configuration jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-drone-impl jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-drone-selenium-server jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-drone-selenium jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-drone-webdriver jar javadoc pom

Release notes and resolved issues 7

Component Upgrade
  • ARQ-1088 - Upgrade and align AS7 versions in Drone tests
Bug
  • ARQ-1047 - RemoteAddress nor Remote property does not trigger remote webdriver
  • ARQ-1064 - Can't set WebDriver capability with name containing '_'
  • ARQ-1075 - Problem with Drone when configuring WebDriver via Capabilities interface
  • ARQ-1090 - Remove chromeSwitches from tests
  • ARQ-1091 - Make capability setting in Drone easier

Thanks to the following list of contributors: Karel Piwko, Lukas Fryc, Jan Papoušek, Aslak Knutsen

Arquillian Persistence Extension 1.0.0.Alpha5 Released

Since we wrote this post we didn't laze around. Check our latest announcement.

The Arquillian team is proud to announce the 1.0.0.Alpha5 release of the Arquillian Persistence Extension component!

We are back with a bunch of handy new additions and some bug fixes, so keep on reading..

Big kudos goes to Tomas Hradec for his great contribution on the “JPA Cache Eviction” support. You can now control your second level cache directly from the Arquillian tests. I would also like to thank Adrian Gonzalez, Alex Holmansky, Anton Shaykin and Christoph Rohr for their feedback which led us to fix some minor annoyances and shortcomings of APE. We are proud of the vibrant and active community around Arquillian!

Some of the highlights in this release

Instead of relying on the JPA provider you can now use your custom scripts to create the schema and populate data for each test. The only thing you have to do is decorate your test class with the following annotation:

@CreateSchema({"create-schema.sql", "populate-data.sql"})

Thanks to Tomas Hradec we have taken control over the Second Level JPA cache eviction. This initial implementation gives you a possibility to evict the cache before or after your test. Just specify which persistence unit(s) should be used by APE:

@JpaCacheEviction(entityManager = { "java:comp/env/MyPersistenceUnit" })

One of the shortcomings of the previous versions was the fact that you were always forced to provide the data source name explicitly. Either through arquillian.xml or by using the @DataSource annotation. With Alpha 5 you won’t have to. If you only use one data source in the test case, it will be inferred automatically from the persistence.xml used by your test.

You can also tell DBUnit which schema needs to be used for seeding the database. Just add the schema property to your arquillian.xml configuration as illustrated in the snippet below:

arquillian.xml
<extension qualifier="persistence-dbunit">
    <property name="schema">ape</property>
</extension>

We’ve also extended our test suite by adding the following databases to our continuous integration pipeline

  • MySQL 5.5.24
  • PostgreSQL 9.1.4

Important change: We renamed two properties used in arquillian.xml giving them more appropriate names:
initStatement became scriptsToExecuteBeforeTest
cleanupStatement became scriptsToExecuteAfterTest
Moreover you can now specify list of scripts (or files) seperated by comma.

We look forward to hearing your feedback about this release in the community forums!

What is Arquillian?

Arquillian is open source software that empowers you to test JVM-based applications more effectively. Created to defend the software galaxy from bugs, Arquillian brings your test to the runtime so you can focus on testing your application's behavior rather than managing the runtime. Using Arquillian, you can develop a comprehensive suite of tests from the convenience of your IDE and run them in any IDE, build tool or continuous integration environment.

Release details

Component Arquillian Persistence Extension
Version 1.0.0.Alpha5 view tag
Release date 2012-08-31
Released by Aslak Knutsen
Compiled against

Published artifacts org.jboss.arquillian.extension

  • org.jboss.arquillian.extension » arquillian-persistence-api jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-persistence-impl jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-persistence-integration-tests jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-persistence-integration-tests-testng jar javadoc pom

Release notes and resolved issues 23

Enhancement
  • ARQ-763 - Introduce TestNG tests
  • ARQ-873 - Provide flexible maven configuration for handling combination of different containers and databases
  • ARQ-877 - Improve DBUnit cleanup handling
  • ARQ-882 - Should be possible to specify data insert strategy per @Test
  • ARQ-885 - Improve init/cleanupStatement handling
  • ARQ-1017 - Update APE to Core 1.0.1.Final
  • ARQ-1084 - Fix failing tests in JDK7
Feature Request
  • ARQ-884 - Should be possible to globally define columns to be excluded when comparing data sets.
  • ARQ-899 - Should be able to read data source name from persistence.xml attached to test archive
  • ARQ-900 - Should be able to prepare database using custom scripts
  • ARQ-1029 - Arquillian Persistence Extension: Use specific Schema
  • ARQ-1058 - Implement JPA Cache eviction control
  • ARQ-1065 - Improve SQL script handling
Bug
  • ARQ-872 - Integration tests are failing with Glassfish 3.1.2 embedded
  • ARQ-901 - NPE when using @Cleanup(strategy=CleanupStrategy.USED_ROWS_ONLY)
  • ARQ-1083 - Closing connection might cause memory leak
  • ARQ-1294 - Caught exception in beforeCompletion()
Sub-task
  • ARQ-878 - Make default cleanup phase globally configurable
  • ARQ-879 - Change default cleanup strategy back to AFTER test execution
  • ARQ-881 - Should be possible to exclude arbitrary tables from cleanup procedure
  • ARQ-886 - Rename properties to more meaningful ones
  • ARQ-887 - Allow to use to more than one SQL script file

Thanks to the following list of contributors: Bartosz Majsak, Aslak Knutsen, Tomas Hradec

Arquillian Spring Framework Extension 1.0.0.Beta1 Released

Since we wrote this post we didn't laze around. Check our latest announcement.

The Arquillian team is proud to announce the 1.0.0.Beta1 release of the Arquillian Spring Framework Extension component!

The first Beta release of the Arquillian Spring extension is here.

Some of the highlights in this release

Client side application context registration
Spring transaction support

Client side tests with Spring

So far the Spring extension has only allowed application context creation and bean injection to occure when the tests were deployed in a container. We wanted to bring the same functionality to the client side. With the two new annotations @SpringClientConfiguration and @SpringClientAnnotationConfiguration it is now possible to set up the application context and inject beans into Arquillian tests that are running on the client.

An example of use would be to test a deployed REST service using the Spring RestTemplate configured in the client context.

@RunWith(Arquillian.class)
@SpringClientConfiguration("applicationContext-rest.xml")
public class ClientRestServiceTestCase {

    @Deployment(testable = false)
    @OverProtocol("Servlet 3.0")
    public static Archive createTestArchive() {
        return Deployments.createWebApplication()
                .addAsWebInfResource("mvc/web.xml", "web.xml")
                .addAsWebInfResource("service-servlet.xml");
    }

    @ArquillianResource
    private URL contextPath;

    @Autowired
    private RestTemplate restTemplate;

    @Test
    public void testGetEmployees() {

        Employee result = restTemplate.getForObject(contextPath + "/Employees/1", Employee.class);

        assertEquals("The returned employee has invalid name.", "John Smith", result.getName());
    }
}

Spring transaction support

The recent release of the Arquillian Transaction Extension allow us to control the transactional behavior of our test methods. With the help of the Spring Extension you can now control your Spring configured transaction manager using the same API. The set up is done in the normal Spring way by defining a transaction manager in the application context.

applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:context="http://www.springframework.org/schema/context"
      xmlns:tx="http://www.springframework.org/schema/tx"
      xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">

   <!-- Creates local entity manager factory -->
   <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
       <property name="persistenceUnitName" value="ArquillianTestUnit"/>
   </bean>

   <!-- Enables the declarative transaction support -->
   <tx:annotation-driven transaction-manager="txManager"/>

   <!-- Creates transaction manager -->
   <bean id="txManager" class="org.springframework.orm.jpa.JpaTransactionManager">
       <property name="entityManagerFactory" ref="entityManagerFactory"/>
   </bean>

</beans>

You define which transaction manager to use in your test class via the manager attribute on the @Transactional annotation.

@RunWith(Arquillian.class)
@Transactional(manager = "txManager")
@SpringConfiguration("applicationContext.xml")
public class JpaEmployeeRepositoryTestCase {

    @Autowired
    private EmployeeRepository employeeRepository;

    @PersistenceContext
    private EntityManager entityManager;

    @Test
    public void testSave() {

        Employee employee = new Employee();
        employee.setName("Test employee");

        employeeRepository.save(employee);

        List<Employee> result = entityManager.createQuery("from Employee").getResultList();

        assertEquals("Two employees were expected.", 1, result.size());
    }
}

Migrating from 1.0.0.Alpha2

  • Artifact arquillian-container-spring has been renamed to arquillian-service-container-spring

We look forward to your feedback on this new release on the community forums!

What is Arquillian?

Arquillian is open source software that empowers you to test JVM-based applications more effectively. Created to defend the software galaxy from bugs, Arquillian brings your test to the runtime so you can focus on testing your application's behavior rather than managing the runtime. Using Arquillian, you can develop a comprehensive suite of tests from the convenience of your IDE and run them in any IDE, build tool or continuous integration environment.

Release details

Component Arquillian Spring Framework Extension
Version 1.0.0.Beta1 view tag
Release date 2012-08-17
Released by Aslak Knutsen
Compiled against

Published artifacts org.jboss.arquillian.extension

  • org.jboss.arquillian.extension » arquillian-service-deployer-spring-common jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-service-deployer-spring-2.5 jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-service-deployer-spring-3 jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-service-integration-spring jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-service-container-spring jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-service-integration-spring-inject jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-service-integration-spring-javaconfig jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-transaction-spring jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-service-integration-spring-2.5-int-tests jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-service-integration-spring-3-int-tests jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-warp-spring jar javadoc pom

Release notes and resolved issues 3

Arquillian Transaction Extension support and Client side ApplicationContext creation

Feature Request
  • ARQ-958 - Provide support for Spring transactions
  • ARQ-985 - Register the Spring Extension on client side.

Thanks to the following list of contributors: Jakub Narloch, Aslak Knutsen