Availability: Enterprise Edition
Swagger (now part of the OpenAPI initiative) is a framework used to define and document RESTful APIs. It provides a standardized way to describe an API’s structure, endpoints, and functionality. From a test automation perspective, Swagger files are invaluable because they:
- Simplify Automation: By providing a machine-readable API definition, Swagger files eliminate manual efforts to document or interpret APIs.
- Ensure Completeness: They detail all available endpoints, methods, parameters, and responses, reducing the risk of missing test coverage.
- Enhance Collaboration: Swagger’s standardized format is easily understood by developers, testers, and other stakeholders, ensuring seamless communication.
In ACCELQ, you can leverage Swagger files to automatically generate Actions for testing API endpoints, drastically reducing setup time and improving efficiency in API test automation.
Benefits of Using Swagger Import in ACCELQ
- Bulk Action Creation: Generate multiple Actions at once based on Swagger definitions, saving significant time and effort.
- Consistency: Automatically mapped Actions ensure uniformity in naming conventions and test structure.
- Error Handling: ACCELQ supports creating Actions for both successful and error responses, ensuring comprehensive test coverage.
- Enhanced Test Coverage: All API endpoints are listed, so no endpoint is inadvertently missed.
With this feature, testers can focus more on test logic and validations rather than the repetitive task of manual Action creation.
Step-by-Step Guide to Importing Swagger Definitions in ACCELQ
1. Accessing the Swagger Import Feature
To begin importing your Swagger definition:
- Navigate to the Import Assets menu under "+" icon in the top-nav.
- Choose Import Swagger (API).
- You will be directed to the Swagger Import screen.
2. Selecting the Swagger Source
On the Swagger Import screen, you can select the source of the Swagger definition:
- URL: Enter the URL of your Swagger file (supported formats: OpenAPI 2.0 and 3.0).
- File: Upload a local file containing the Swagger definition.
Click Parse Swagger to proceed.
3.1 Viewing and Selecting Endpoints
Once the Swagger file is parsed:
- Endpoints are grouped under modules (e.g., Pet, Store).
- Select the endpoints for which you want to create Actions. Note:
- Some methods, such as
uploadImage
, may not be supported. - Endpoints are distinctly listed for each possible response, including error cases.
- Some methods, such as
Important Notes:
- Action Names: Action names are populated by default, but it's strongly recommended to review and modify them as needed.
- Missing Input Information: Endpoints requiring additional input, such as payload or query parameters, are marked with a red dot. Click the associated icon to open the configuration modal and provide the required details.
Note: Each selected Endpoint creates an Action in ACCELQ at the end of the import process.
3.2 Configuring API Details
For endpoints with missing details:
- Open the configuration modal by clicking the red dot icon.
- Provide the required details, such as:
- Payload
- Query parameters
- Headers
- Review and ensure completeness before proceeding.
3.3 Setting Up Verifications
While in the API configuration modal:
- Set up required verifications on the response body, status code, and headers.
- Hover over response nodes to add verifications as needed.
3.4 Base URL Management
If multiple Base URLs are available, you can:
- Mark one of the Base URLs as "Default," which will be used in the generated Actions.
Click Next to head to Context selection.
4. Selecting a Context
After selecting endpoints and completing their configuration:
- Choose the Context in which the created Actions will be stored.
- You can assign different Contexts for each module independently.
Click Create Actions to navigate to next screen.
5. Creating Actions
Once all configurations are complete:
- Click Create Actions to generate Actions for each selected endpoint.
- After creation, you will be navigated to the Entity Explorer, where the newly created Actions will be listed.
You can now:
- Open and review the Actions.
- Edit them further as needed to onboard them into your project.
Comments
0 comments
Please sign in to leave a comment.