Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Mock Data provider for API Testing #496

Open
varshil-shah opened this issue Nov 9, 2024 · 5 comments
Open

Implement Mock Data provider for API Testing #496

varshil-shah opened this issue Nov 9, 2024 · 5 comments
Labels
enhancement New feature or request priority: low Low priority issue

Comments

@varshil-shah
Copy link

varshil-shah commented Nov 9, 2024

Implement Mock Data provider for API Testing

Description

Currently, when testing API endpoints in the API Dash repository, users must manually enter or modify details such as email, username, and other user-specific information. This manual effort can be tedious and error-prone, especially during repeated testing. To streamline this process, we propose implementing a feature that generates random placeholder values for common fields like email, username, etc.

Feature Details

Introduce a set of predefined random data variables (e.g., {{$randomEmail}}, {{$randomUsername}}) that can be used in the API requests. These placeholders will automatically populate with randomized data when the API is called, allowing testers to quickly simulate unique user details without manual input.

Benefits

  • Increased Efficiency: Simplifies testing by automating data entry, reducing repetitive manual work.
  • Consistency: Standardizes testing by providing consistent random values across sessions.
  • Enhanced User Experience: Enables faster and more reliable API testing workflows.

Implementation Suggestions

  1. Define random generators for various data types (e.g., email, username, numeric ID).
  2. Update the API to recognize and replace variables like {{$randomEmail}} with generated values.
  3. Ensure variables can be used across multiple endpoints, maintaining flexibility and ease of use.

This feature will greatly enhance developer productivity and provide a more seamless testing experience in the API Dash environment.

@varshil-shah varshil-shah added the enhancement New feature or request label Nov 9, 2024
@varshil-shah
Copy link
Author

Can I work on this issue???

@ashitaprasad
Copy link
Member

You can mention the below details in this thread:

  1. Where are you planning to add this feature in the UI? How will the user know this feature is available ?
  2. List of random data you will provide - how will you provide it? what package will you use?
  3. We already have environment variables .. will you leverage it?

@ashitaprasad ashitaprasad changed the title Implement Random Data Generator for API Dash Repository Implement Mock Data Generator for API Testing Nov 9, 2024
@ashitaprasad ashitaprasad changed the title Implement Mock Data Generator for API Testing Implement Mock Data provider for API Testing Nov 9, 2024
@varshil-shah
Copy link
Author

Implementation Details

  • UI Addition:
    This feature will be accessible within the request body editor. Users can invoke it by typing {{ (double curly brackets), which will reveal the list of available random placeholders.

  • Random Data Types:
    Initial options will include random values for email, username, names, and potentially others. The faker package in Flutter will be used to generate this data without needing to modify environment variables.

  • Package Used:
    I will utilize the faker package for Flutter to generate these random values.

  • Environment Variables:
    No need to leverage environment variables for this feature, as the faker package provides sufficient randomness for testing purposes.

@ashitaprasad
Copy link
Member

As you are a first time contributor to this project, I recommend you to pick up an open issue first and resolve it to get familiar with the codebase, before working on adding this completely new feature.

@ashitaprasad ashitaprasad added the priority: low Low priority issue label Nov 9, 2024
@varshil-shah
Copy link
Author

Alright, Thanks for your response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority: low Low priority issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants