Most TestLink [1] users are aware that there is an external API, maybe for the external API token being displayed in the user profile section. Today after a meeting with Peter Florijn [2], I realized that the same may not be true for Testopia [3] users.

I am quite new to Testopia, and there are many features that I haven’t used yet. But if I understand it correctly, the database is interfaced by several Perl scripts that are, by its turns, exposed as Web Service (most of them). The web services are available via a JSON and a XML-RPC API (what is very useful, TestLink supports supports only XML-RPC).

The communication between different programming languages and the external API’s is accomplished by a client API. In TestLink you have testlink-java-api [4] and testlink-api-java-client [5].

Testopia has a Java client too, available in Testopia source repository [6] and can be used to integrate your existing Java code with Testopia.

Peter and I have been working on Jenkins Testopia Plug-in [7], released few weeks ago and with its new version being released at this very moment. It’s been fun to write this new plug-in, and we are using a type of Scrum to manage the project, what makes it even more interesting.

During the project feature definition and initial structure, we created a new implementation, motivated by the following reasons (in no special order):

  • Provide an API for Maven developers
  • Publish this new API to Maven central repository (so Gradle, Ivy and Maven users could use it too)
  • Use a non DDD (Domain Driven Design) approach, as it helps debugging serialization issues in Jenkins (only one element talks to Testopia. So we put this element in Jenkins master, and don't have to worry about calls to objects methods serialized to slaves)
  • Test doubles, so we could increase test coverage without the need of a Testopia instance running

We haven’t released this API to Maven central yet, as we still have to polish the code, add tests and more methods. But you can already start playing with this API, the code is at GitHub, [8], and here’s a Snippet of code to get you started with the API.

TestopiaAPI api = new URL("http://localhost/bugzilla-4.2.1/xmlrpc.cgi");
api.login("root", "pass");
TestRun testCaseRun = api.getTestRun(1);
TestCase[] testCases = api.getTestCases(this.getTestRunId());
for(TestCase testCase : testCases) {
  Status status = Status.BLOCKED;
  api.update(testCase, testCase.getRunId(), testCase.getBuildId(), testCase.getEnvId());

Have fun!

  • [1]
  • [2]
  • [3]
  • [4]
  • [5]
  • [6]
  • [7]
  • [8]