Skip to main content

Sync Data From APIs/API Cases

For test steps imported from APIs/API cases, their request data can be synchronized with the associated API documentation/use cases.

When importing APIs/API cases into test steps, you can choose Manual or Automated mode.

The Manual mode is suitable for scenarios where multiple people collaborate, meaning that in a project, the API specification, development, and testing processes have a clear division of labor, and each process has a dedicated person in charge. The processes require data independence to avoid unintended changes affecting each other. After ensuring the stability of the API documentation/use case data, the tester can manually synchronize it with the test steps.

The Automated mode is suitable for small teams or independent developers, meaning that in a project, the API specification, development, and testing processes are all handled by a single role, improving the efficiency of API maintenance and testing. When the APIs/API cases in "API Management" change, the APIs/API case data in the test steps will also be adjusted accordingly, ensuring data consistency between "API Management" and "Automated Testing".

Sync Relationship Table

Test Step Generation MethodAssociated DataTest Step Sync ModeSync Content
Imported from API - Manual modeAPI DocumentationManual mode (click "Update" button in test steps)✅ Changes in "parameter name", "Path", "Method", "pre/post-actions", etc. in the API documentation.

❌ "Parameter values".
Imported from API - Automated modeAPI DocumentationAutomated mode (when API documentation is updated and saved)✅ Changes in "parameter name", "Path", "Method", "pre/post-actions", etc. in the API documentation.

❌ "Parameter values".
Imported from API Use Case - CopyAPI DocumentationManual mode (click "Update" button in test steps)✅ Changes in "parameter name", "Path", "Method", "pre/post-actions", etc. in the API documentation.

❌ "Parameter values".
Imported from API Use Case - ReferenceAPI Use CaseAutomated mode (when API use case is updated and saved)✅ Reference API use case data, any changes in the API use case will affect the content of this test step.

Manual Sync Mode

When the Manual mode is selected, the associated button will appear in "blue". When there are any changes of API documentation in the "API Management" , the data in the test steps will not be updated in real-time. Testers can manually click the "Update" button in the "Test Steps" details to synchronize the changes from the APIs/API Cases to the test steps.

This mode is suitable for testing scenarios where testers have a large number of requests for fine-tuning the request parameters, avoiding unintended influences on these test data and ensuring isolation between test data and data from the APIs being developed.

In Manual mode, the dropdown menu of the associated button also supports manually filtering the scope of data synchronization.

Sync API Documentation

For test steps generated by importing from an API → Manual update or importing from an API use case → Copy, the associated content is the API documentation. These test steps can be synchronized with the API documentation content by clicking the "Sync Now" button on the page.

info

After triggering a manual sync, the test step will synchronize data from the API documentation, including "parameter name", "pre/post-scripts", etc. Note that the sync object is the API documentation, and if the request parameters in the API documentation do not have sample values set, the synchronized content will not include "parameter values".

After clicking the "Update" button in the test step, it will trigger the data synchronization mechanism, and the button will indicate "Synced". After confirming that the synchronized data is correct, you also need to click the "Save" button in the upper-right corner to save the test step.

Batch Sync Data

If most of the data in the current test steps are using the Manual mode, and the tester has confirmed that the data in these API documentation/use cases is correct, and wants to quickly synchronize the data to the test steps, they can click the "Update" button on the test step page to perform a batch sync operation.

Automated Sync Mode

The associated button will appear in orange. This mode is suitable for small teams or independent developers, where a single role is responsible for the API definition, development, and testing processes in a project. When the API documentation in "API Management" changes, the associated data in the test steps will be automatically synchronized and kept consistent, improving the efficiency of API maintenance and testing.

Sync APIs

For test steps associated with API documentation, when the sync mode is set to Auto Sync, if there are changes in the API documentation and it is saved, the data will be updated in real-time in the test step. The synchronized content is consistent with the Manual Sync mode described above.

In Automated mode, any inconsistencies between the data in the test step and the API documentation will be highlighted. Testers can choose to "Revert" to maintain complete consistency with the API documentation, or they can choose to "Save to Document", which will overwrite the data in the API documentation with the data from the test step, keeping them consistent.

Sync API Cases

For test steps that reference an API cases, the API cases and the test step will use the same request data. To make this logic clearer and more intuitive, and to ensure the uniqueness of API use case data management in "API Management", changes need to be made in the referenced API use case in "API Management".

After clicking the "Edit" button in the instruction on the test step page, you will be taken to the associated API use case page to make adjustments. The test step will automatically synchronize the data after the changes to the API use case, including "parameter name", "parameter value", "pre/post-scripts", and all other request content.