Skip to content

Client setup

Access token

Zafira provides REST API to track test automation results (use Swagger to learn API). You have diffent options of integration of your test client. Carina automation framework has integration with Zafira under the hood. Regardless of integration flow you selected, first of all you will need access token generated. Navigate to Username > Profile in top navigation menu:

Scroll down and generate new access token:

Zafira uses stateless authenticatication using JWT technology. In general clients stores refresh token that is used to generate access token with 5-hours expiration term.

POST /api/auth/refresh
  "refreshToken": "<access_token>"

  "type": "Bearer",
  "accessToken": "eyJhbGciOiJIUzUxMiJ9...",
  "refreshToken": "eyJhbGciOiJIUzUxMi9...",
  "expiresIn": 300

All HTTP calls that requires authorization context should contain header:

Authorizarion: Bearer <auth_token>

Integration with Carina

Carina automation framework tacks test results in Zafira by default, all you need is valid access token in file.


Verify following properties:

  • zafira_enabled=true
  • zafira_service_url=YOUR_ZAFIRA_URL

By default zafira_project=UNKNOWN but using admin user you are capable to create multiple projects via Zafira UI (Top menu > Project > Create). When new project created you may override zafira_project property and track resutls in appropriate context.

Integration with TestNG

If you are implementing your own TestNG-based automation project you can easily setup integration with Zafira using TestNG listener.

  • Add Zafira client as Maven dependency:
  • Create and place in resource folder, update configuration
  • Include com.qaprosoft.zafira.listener.ZafiraListener as TestNG listener:
        <listener class-name="com.qaprosoft.zafira.listener.ZafiraListener"/>


public class LoginTest {

Languages and frameworks supported