In this article, Yina Mou explains how Jenkins CI can be used to automate build, deploy and test Convertigo projects.



 

The Jenkins CI plugin

Jenkins CI is used for Building/testing software projects continuously. In a nutshell, Jenkins provides an easy-to-use so-called continuous integration system, making it easier for developers to integrate changes to the project, and making it easier for users to obtain a fresh build. The automated, continuous build increases the productivity. Jenkins uses plugins to extend functionalities, so we developed a new Jenkins Plugin to integrate Convertigo with Jenkins. Get more information on wiki.jenkins-ci.org.

Installing the Plugin

step(1)

    • 1) Upload the Plugin to jenkins. Choose the .HPI file you downloaded.
 

step(2)

  • 3) Select the ConvertigoPluginArtifact.hpi
 

step(3)

  • 4) Click the Upload button
 

step(4)

    • 5) Seet that the plugin is installed
 

step(5)

Using the Plugin

      • Configure SCM

First you will have to pull out from SCM the Convertigo Projects you want to build and test. To to this Configure in the SCM section the right SCM provider (SVN , GIT etc ..) and the correct repository URL. The url must point to a Valid Convertigo Project directory containing the <project-name>.xml file. You can also point to a directory containing several valid Convertigo projects. In this case all these projects will be build and deployed to the Convertigo Server.

Configure SCM

      • Link to Convertigo Q&A Server

Then when you add a build step, you will find the Convertigo Plugin in the step list. Select it and configure the step.

Link to Convertigo Q&A Server

      The first part is to link the Plugin to a Convertigo Q&A server. This can be any Convertigo Standard Edition Server, installed and up and running. Give in this section the server’s URL and admin console credentials. (Usually admin/admin).

Link to Convertigo Q&A Server

      • Configure Build options

You can check the Build and Deploy option to have the Plugin to build the .CAR files and to have deployed automatically on the target Convertigo Server.  
      • Using Test Cases

Once the .CARs are built and deployed on the server, you can now enable tests by checking the check box.
      When the “Enable test” option is checked you will have the opportunity to select the project you want to test in the drop down list (Warning, this box can take some time to fillup…)

Configure Build options

When you select a project, the second drop down will list all the Convertigo Test Cases in this form :
      (S)project.sequences.testcase for sequence testcases or
      (T)project.connector.transaction.testcase for transactions

Configure Build options

Select the test case you want and then click the “Execute test case”. The Convertigo XML out pout will be displayed below the testcase :

Configure Build options

Now in the Assert window you will be able to write your assertions this way:
Assert ok
<My Xpath ok 1>
<My Xpath ok 2>
...
<My Xpath ok 3>
Assert nok
<My Xpath not ok 1>
<My Xpath not ok 2>
<My Xpath not ok 3>
  To have this test case to be a success:
  • you must have all the <my Xpath ok> to match
  • and none of the <xpath not ok> to match.
  You can use the “Test XPATH” button to see if the assertions you wrote are valid for this test case.

Configure Build options

    You can add as many test cases from any project for this Jenkins step you want. By clicking on “Add test case”

Using test results

Convertigo Jenkins Plugin will generate a .xml file in the /TestReports directory. This is a standard Junit XML test format that can be read by any other Jenkins Plugin.
    For example configure in the Post build step the Result reader

Configure Build options

Configure Build options

    When you run a Jenkins Build you can see in the Console the plugin execution

Configure Build options

    And the test results .

Configure Build options

And the console output :

Configure Build options

Convertigo as Industrialized mobile build platform

With Convertigo Jenkins CI plugin, Developers can now use one of the best Continuous Integration platform to build and test Enterprise Mobile Applications connected to valuable Enterprise Data. More information on wiki.jenkins-ci.org.

Leave a comment