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

Feature Proposal: Support for Record and Replay Backend Traffic #44

Open
aniket-k-mukherjee opened this issue Sep 7, 2024 · 15 comments

Comments

@aniket-k-mukherjee
Copy link
Contributor

aniket-k-mukherjee commented Sep 7, 2024

Summary:
We propose to enhance the Appium Interceptor Plugin with the ability to add multiple records simultaneously and replay them in the order they were originally captured. This feature aims to provide a more robust and flexible way to mock backend interactions during app automation, ensuring a controlled and consistent environment for UI testing.

Problem Statement:
Currently, backend dependencies can create challenges in maintaining a stable and reliable test environment, particularly for sanity test suites. Variability in backend responses can lead to inconsistent test results, which complicates the automation process and impacts test accuracy.

Proposed Solution:
1.⁠ ⁠Support for Multiple Records:

  • Allow users to add multiple records at once.
  • Replays the recorded responses in the exact order they were captured.
  • This capability will enable testers to mock the entire backend during app automation, simulating real-world scenarios without relying on live backend services.

2.⁠ ⁠Introduction of Default Mocks:

  • Provide an option to set defaultMocks for specific APIs.
  • These mocks will return a static response every time the API is called from the UI.
  • For scenarios where an API is called multiple times (e.g., 5 times), the corresponding 5 predefined responses will be returned in sequence, mimicking real backend behavior.

Benefits:
•⁠ ⁠Backend Independence: Removes dependencies on backend services, enabling a more reliable and isolated test environment.
•⁠ ⁠Consistent Testing: Ensures a stable and consistent UI testing experience by simulating backend interactions with predetermined responses.
•⁠ ⁠Enhanced Test Automation: Creates a more suitable and effective sanity test suite by providing predictable and controlled testing conditions.

If this proposal is accepted, we have a working solution ready for implementation which we are currently using in our organisation, and we can raise a PR to contribute this functionality.

Looking forward to your feedback!

@aniket-k-mukherjee aniket-k-mukherjee changed the title ###*Feature Proposal: Support for Record and Replay Backend Traffic* Feature Proposal: Support for Record and Replay Backend Traffic Sep 7, 2024
@aniket-k-mukherjee
Copy link
Contributor Author

@sudharsan-selvaraj let me know what are your views on it

@saikrishna321
Copy link
Member

@GitAniketM Interesting! Looking forward for the PR

@aniket-k-mukherjee
Copy link
Contributor Author

Ok, cool @saikrishna321

@sudharsan-selvaraj
Copy link
Member

@aniket-k-mukherjee Thank you for the proposal and the solution seems promising.

I recommend creating a branch and pushing the fixes incrementally to facilitate a faster feedback cycle.

Looking forward to the implementation.

@aniket-k-mukherjee
Copy link
Contributor Author

have raised PR #49, please do check and lemme know

@aniket-k-mukherjee
Copy link
Contributor Author

hi @sudharsan-selvaraj @saikrishna321 did you guys get time to check the PR. Would like to know if there are any suggested changes or modifications

@aniket-k-mukherjee
Copy link
Contributor Author

aniket-k-mukherjee commented Oct 7, 2024

hi @saikrishna321 @sudharsan-selvaraj , i have updated the release version, still its failing in actions. In npm packages, i can see that the last version there is 1.0.0-beta.10, whereas in the repo its upgraded to 1.0.0-beta.12.
The error is that, 1.0.0 tag already exists. Should i push a new tag !?? and raise another PR !?

@saikrishna321
Copy link
Member

@aniket-k-mukherjee I have published a new version now. [email protected]

Please check.

Also can you please give me your opencollective account name.

@aniket-k-mukherjee
Copy link
Contributor Author

aniket-k-mukherjee commented Oct 8, 2024

hi @saikrishna321 , yes the new version is visible now in npm , but in repo's releases tab, its still showing the older version
my opencollective account name is: ASK Mukherjee

@aniket-k-mukherjee
Copy link
Contributor Author

aniket-k-mukherjee commented Oct 8, 2024

And also, I have not updated the readme for this feature, i will update it soon and raise PR 😅.

@saikrishna321
Copy link
Member

@aniket-k-mukherjee Can't find you on opencollective. Can you please give me the link to your profile

@aniket-k-mukherjee
Copy link
Contributor Author

aniket-k-mukherjee commented Oct 9, 2024

@aniket-k-mukherjee
Copy link
Contributor Author

@saikrishna321 , lemme know if you got the opencollective account or if there is an issue with that

@saikrishna321
Copy link
Member

@aniket-k-mukherjee Invite sent in opencollective for payout. Please accept

@aniket-k-mukherjee
Copy link
Contributor Author

@saikrishna321 , accepted the invite. Have submitted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants