QA Testing Guide for GetVesselReportTemplateFunction

Overview

The GetVesselReportTemplateFunction is an Azure Function that returns excel file. It is exposed as an HTTP GET endpoint.

# Endpoint Details

  • HTTP Method: GET

  • Route: /v1/vessel/report

  • Authorization: Bearer Token (JWT)

Test Scenarios

# 1. Valid Request

## Objective:

Verify that the function returns excel file 'VesselReportTemplate.xlsx' with HTTP CODE 200.

## Steps:

  • Send a GET request to /v1/vessel/report with:

  • A valid Bearer token in the Authorization header.

  • Verify the response:

  • Status Code: 200 OK

  • Response Body: Excel file VesselReportTemplate.xlsx.

  • Response Content Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.

## Expected Result:

The response contains an excel file.

Test Data

Authorization header

# 2. Unauthorized Request

## Objective:

Verify that the function rejects requests without a valid authorization token.

## Steps:

  • Send a GET request to /v1/vessel/report with:

  • No Authorization header or an invalid Bearer token.

  • Verify the response:

  • Status Code: 401 Unauthorized

  • Response Body: JSON object of type ErrorResponse with a description of the error.

## Expected Result:

The response indicates that the request is unauthorized.

Test Data

No Authorization header

Tools and Environment

  • Tools: Postman, OpenAPI UI, or any HTTP client.

  • Environment: CommonCore Stage https://apim-abs-cc-scus-stg.azure-api.net.

  • Dependencies: No dependencies.

Additional Notes

  • Validate the excel file.

  • Validate the response schema for unsuccessful test cases to ensure it matches the expected type (ErrorResponse).

  • Log any discrepancies or unexpected behavior for further investigation.

  • Ensure proper cleanup of test data after execution.

  • How to get token link.

  • Client ID, tenant ID, and secret for testing can be requested from the CC team.