Arquillian Droidium 1.0.0.Alpha3 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.Alpha3 release of the Arquillian Droidium component!

While this release is available, it has some serious problems for Windows users. A new release should be available soon.

Known issues

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 Droidium
Version 1.0.0.Alpha3 view tag
Release date 2013-12-03
Released by Karel Piwko
Compiled against

Published artifacts org.arquillian.container

  • org.arquillian.container » arquillian-droidium-container-api jar javadoc pom
  • org.arquillian.container » arquillian-droidium-container-spi jar javadoc pom
  • org.arquillian.container » arquillian-droidium-container jar javadoc pom
  • org.arquillian.extension » arquillian-droidium-multiple-containers jar javadoc pom
  • org.arquillian.protocol » arquillian-protocol-android jar javadoc pom
  • org.arquillian.extension » arquillian-droidium-native-api jar javadoc pom
  • org.arquillian.extension » arquillian-droidium-native-spi jar javadoc pom
  • org.arquillian.extension » arquillian-droidium-native jar javadoc pom
  • org.arquillian.extension » arquillian-droidium-web-spi jar javadoc pom
  • org.arquillian.extension » arquillian-droidium-web jar javadoc pom
  • org.arquillian.droidium.archetype » arquillian-droidium-archetype-native-test jar javadoc pom
  • org.arquillian.droidium.archetype » arquillian-droidium-archetype-web-test jar javadoc pom

Release notes and resolved issues 16

Better integration with Android SDK

Component Upgrade
  • ARQ-1590 - Update JBoss parent to the latest one
Enhancement
  • ARQ-1567 - Explain validation errors in more depth
  • ARQ-1568 - Droidium fails if emulator is about to start and there is not API level 10 and apiLevel is not in config
  • ARQ-1570 - Provide better parsing of ABI in connection with API level for Droidium
  • ARQ-1577 - Do not start Android container when there is not android browser in webdriver extension specified
Feature Request
  • ARQ-1533 - Uninstall packages from device before test when they are already installed
  • ARQ-1547 - Improve the parsing of activities from AndroidManifest.xml of AUT
  • ARQ-1571 - Remove API 10 from default platform
  • ARQ-1580 - Provide better AVD logging information
  • ARQ-1582 - Honor ANDROID_SDK_HOME, deprecate generatedAvdPath
  • ARQ-1584 - Remove duplication from Droidium modules
  • ARQ-1587 - Droidium has to fail when there is already started emulator on the same ports
Bug
  • ARQ-1509 - Arquillian Droidium Multiple Container does not work correctly when used standalone
  • ARQ-1583 - Emulator does not figure out process had died
  • ARQ-1585 - Droidium does not figure out AVD is broken

Thanks to the following list of contributors: Stefan Miklosovic, Karel Piwko

Arquillian Droidium 1.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 1.0.0.Alpha2 release of the Arquillian Droidium component!

There are several important fixes in this release for those testing Android native and web applications in connection with Arquillian Drone and Graphene.

This release is packed with bugfixes and features which make the testing experience much smoother. The Arquillian Droidium container can from now on be used as a standalone container which does not depend on any plugin, native nor web. Even with no plugins on class path, you can still deploy APKs to Android device and you can fully interact with your device and automate it as you wish. Skys the limit…

Arquillian Droidium uses the Arquillian Drone and Graphene extensions heavily. Did you known that you can use Page fragments from Graphene on your native Android activities? That’s right, there is almost no difference between functional web and Android native application testing.

@RunWith(Arquillian.class)
@RunAsClient
public class AeroGearTestCase {

    @Drone
    @Browser
    WebDriver browser;

    @Drone
    @Mobile
    WebDriver mobile;

    ...

    @Browser
    @FindBy(id = "task-container")
    private TaskWebFragment taskFragment;

    @Mobile
    @FindBy(id = "todo")
    private TaskMobileFragment taskMobileFragment;

    ...

    @Test
    @InSequence(3)
    @OperateOnDeployment("todo-ear-app")
    public void addTask() {

        taskFragment.addTask("groceries", "buy some milk", "2020", "10", "20", "buy some fresh milk around the corner");

        Assert.assertEquals(taskFragment.getAddedTask().getTitle(), "buy some milk");
        Assert.assertEquals(taskFragment.getAddedTask().getDescription(), "buy some fresh milk around the corner");
    }

    @Test
    @InSequence(5)
    @OperateOnDeployment("todo-mobile-app")
    public void addMobileTask() {
        taskMobileFragment.addTask("mobile task", "2014-10-20", "task from mobile phone!");
    }

}

To see a full example of the Aerogear TODO demo app tested using Arquillian Droidium check out this repository.

Don’t know what Page Fragments are? You might want to read this blog post: Introducing Arquillian Graphene Page Fragments

Since you use can use the ordinary application container and Droidium container together in one test run, you can now test complex scenarios which require interaction between web application and Android application.

@Test
@InSequence(5)
@OperateOnDeployment("todo-mobile-app")
public void addMobileTask() {
    taskMobileFragment.addTask("mobile task", "2014-10-20", "task from mobile phone!");
}

@Test
@InSequence(6)
@OperateOnDeployment("todo-ear-app")
public void seeMobileTaskInWebClient() {
    browser.navigate().refresh();
}

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 Droidium
Version 1.0.0.Alpha2 view tag
Release date 2013-10-09
Released by Karel Piwko
Compiled against

Published artifacts org.arquillian.container

  • org.arquillian.container » arquillian-droidium-container-api jar javadoc pom
  • org.arquillian.container » arquillian-droidium-container-spi jar javadoc pom
  • org.arquillian.container » arquillian-droidium-container jar javadoc pom
  • org.arquillian.extension » arquillian-droidium-multiple-containers jar javadoc pom
  • org.arquillian.protocol » arquillian-protocol-android jar javadoc pom
  • org.arquillian.extension » arquillian-droidium-native-api jar javadoc pom
  • org.arquillian.extension » arquillian-droidium-native-spi jar javadoc pom
  • org.arquillian.extension » arquillian-droidium-native-impl jar javadoc pom
  • org.arquillian.extension » arquillian-droidium-native-depchain jar javadoc pom
  • org.arquillian.extension » arquillian-droidium-web-spi jar javadoc pom
  • org.arquillian.extension » arquillian-droidium-web-impl jar javadoc pom
  • org.arquillian.extension » arquillian-droidium-web-depchain jar javadoc pom
  • org.arquillian.droidium.archetype » arquillian-droidium-archetype-native-test jar javadoc pom
  • org.arquillian.droidium.archetype » arquillian-droidium-archetype-web-test jar javadoc pom

Release notes and resolved issues 14

Enhancement
  • ARQ-1506 - Rename Droidium Container artifactId
  • ARQ-1507 - Make usage of Arquillian Droidium stack easier
  • ARQ-1515 - Allow debugging mode for Selenium APK
  • ARQ-1524 - Implement deployment logic when native plugin is not on class path
  • ARQ-1526 - Provide screenshot api for Droidium container
Feature Request
  • ARQ-1495 - Support both serialId and avdName in arquillian.xml
  • ARQ-1521 - Implement default activity manager when native plugin is not on the class path
  • ARQ-1522 - Should be able to start activity without FQDN format
  • ARQ-1525 - Be able to deploy APKs when doing web testing with web plugin
Bug
  • ARQ-1505 - Wrong handling of Android Debug Bridge initialization
  • ARQ-1511 - Wrong Android container identification in logs
  • ARQ-1512 - Droidum does not handle disconnect of a physical device correctly
  • ARQ-1513 - Multicontainer extension should not log warnings about its property

Thanks to the following list of contributors: Stefan Miklosovic, Karel Piwko

Arquillian Droidium 1.0.0.Alpha1 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.Alpha1 release of the Arquillian Droidium component!

This is the very first release of ongoing effort from the Arquillian community to bring Arquillian goodies even to your mobile environment! Arquillian Droidium container adapter and supplement plugins for it are enabling you to execute functional tests with Arquillian Graphene and Arquillian Drone in the Arquillian way on your Android devices – emulators and physical devices as well.

Arquillian Droidium bits

Droidium consists of three components:

Arquillian container adapter for Android devices

When you think about it, an Android device is in principle some kind of a container where you install your APKs (depoyments) to and uninstalling them from afterwards once your tests are done. The Arquillian container adapter takes care of the device management, meaning starting and stopping your emulator or connecting to it if it is already started (following the remote and managed container abstraction). It even dynamically creates your AVD according to your preferences and deletes it once the tests are done. Android container adapter does not test on its own. The actual testing is delegated to other plugins.

Droidium native plugin

Droidium native plugin enables you to test your native APK applications by using the WebDriver API. The APK you want to test is deployed to the Android emulator, you start your activities from within your test method and from there you are good to go with your WebDriver tests! But wait a minute, we did not stopped there. You can deploy multiple APKs to your emulator prior to test execution and functionally test them all in one go. Is there some APK you do not want to test but it is required as a dependency? No problem at all, just add them to your deployment methods.

Lets see how you can do native testing:

@RunWith(Arquillian.class)
@RunAsClient
public class MyMobileAppTestCase {

    // injection for switching between activities and
    // interacting with Android device on lowlevel
    @ArquillianResource
    AndroidDevice android;

    // you have the possibility to take screenshots as you are 
    // doing tests, they are stored in target, lot of options behind this
    @ArquillianResource
    Screenshooter screenshooter;

    // class scoped Drone, it will be available to use during whole test execution
    @Drone @MyApp WebDriver test_app;

    // Deployments you want to test by WebDriver has to be annotated 
    // with @Instrumentable annotation. Port forwarding from Android device to 
    // localhost is done and WebDriver instance is listening to it. Port on 
    // localhost side is taken from extension configuration in arquillian.xml

    // Every deployment you want to test has to have its own WebDriver

    @Deployment(name = "my-app")
    @Instrumentable(viaPort = 8081)
    public static Archive<?> myAppDeployment() {
        return ShrinkWrap.createFromZipFile(JavaArchive.class, new File("my-app.apk"));
    }

    @Deployment(name = "my-another-app")
    @Instrumentable(viaPort = 8082) // another app so another port, you have second WebDriver
    public static Archive<?> myAnotherAppDeployment() {
        return ShrinkWrap.createFromZipFile(JavaArchive.class, new File("my-another-app.apk"));
    }

    // This APK will not be instrumented. You just need to put it to Android device 
    // e.g. to safisfy APKs dependencies
    @Deployment(name = "resource-apk")
    public static Archive<?> myResourceDeployment() {
        return ShrinkWrap.createFromZipFile(JavaArchive.class, new File("resources.apk"));
    }

    @Test
    @InSequence(1)
    @OperateOnDeployment("my-app")
    public void test01() {
        // activities in APKs are automatically scanned upon deployment installation and Android
        // activity manager knows on which WebDriver instance it should start that activity up
        android.getActivityManagerProvider()
            .getActivityManager()
            .startActivity("my.testapp.HomeScreenActivity");

        // ... tests with test_app Drone
    }

    @Test
    @InSequence(2)
    @OperateOnDeployment("my-another-app")
    public void test02(@Drone @MyTestApp WebDriver myTestApp) {
        android.getActivityManagerProvider()
            .getActivityManager()
            .startActivity("my.another.testapp.MainActivity");

        // ... tests

        // you can do something like this after you want to switch to another activity
        // android.getActivityManagerProvider()
        //      .getActivityManager().startActivity("another.activity")

        // since you have both Drones available here (class scoped and method scoped as well)
        // you can choose whatever activity from both deployments you want. After this method
        // ends, you can start activities only from the "my-app" deployment since the second
        // WebDriver is destroyed
    }
}

Droidium web plugin

The web plugin for the Droidium container enables you to test your web applications that are deployed on an application servers like JBoss AS/Wildfly from your mobile phone. Once you’ve coded your web application, you construct the @Deployment. Droidium will then starts the application container and the Android emulator(or device) automatically for you. The web app is deployed to JBoss AS/Wildfly, the Android server from the Selenium project is installed to the Android device and you are automagically ready to fully use Graphene to test the web application from your mobile phone’s web browser. Sweet?

See it in action

There is lot of example projects which tests various scenarios that deals with Android testing. They can be foundin the project repository in the tests directory

Next release is comming soon

Do not hesitate to drop a message to us on our IRC channel regarding the Droidium extension. We’ll try to release next version fairly soon and we’ll do our best to bring you betas as soon as possible. We look forward to your feedback on this release in our community forums or the #arquillian channel on FreeNode!

Google Summer of Code 2013 project

This project was sponsored by the Google Summer of Code 2013 program where Stefan Miklosovic had a chance to participate. The Arquillian project is very open to new developers willing to help and we are always excited to hear from them. You are welcome to take part as well.

Acknowledgements

I, Stefan Miklosovic, author of these extensions, would like to thank Aslak Knutsen, Karel Piwko, Dan Allen and Tadeas Kriz for their advise, insights and encouragements during the coding period. I would like to thank Dominik Dary from Selendroid project as well on which Droidium native plugin is heavily based.

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 Droidium
Version 1.0.0.Alpha1 view tag
Release date 2013-09-18
Released by Karel Piwko
Compiled against

Published artifacts org.arquillian.container

  • org.arquillian.container » arquillian-droidium-container-api jar javadoc pom
  • org.arquillian.container » arquillian-droidium-container-spi jar javadoc pom
  • org.arquillian.container » arquillian-droidium-container-depchain pom
  • org.arquillian.container » arquillian-droidium-container-impl jar javadoc pom
  • org.arquillian.extension » arquillian-droidium-multiple-containers jar javadoc pom
  • org.arquillian.extension » arquillian-droidium-native-api jar javadoc pom
  • org.arquillian.extension » arquillian-droidium-native-spi jar javadoc pom
  • org.arquillian.extension » arquillian-droidium-native-impl jar javadoc pom
  • org.arquillian.extension » arquillian-droidium-native-depchain jar javadoc pom
  • org.arquillian.extension » arquillian-droidium-web-spi jar javadoc pom
  • org.arquillian.extension » arquillian-droidium-web-impl jar javadoc pom
  • org.arquillian.extension » arquillian-droidium-web-depchain jar javadoc pom
  • org.arquillian.droidium.archetypes » arquillian-droidium-archetype-native-test jar javadoc pom
  • org.arquillian.droidium.archetypes » arquillian-droidium-archetype-web-test jar javadoc pom

Release notes and resolved issues 0

Containers an support for native testing of Android in Arquillian

Thanks to the following list of contributors: Stefan Miklosovic, Karel Piwko, Tadeas Kriz, Aslak Knutsen