AppiumTestDistribution / appium-interceptor-plugin

Appium 2.0 plugin to mock api calls for android apps
30 stars 11 forks source link

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

Open aniket-k-mukherjee opened 2 months ago

aniket-k-mukherjee commented 2 months ago

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:

2.⁠ ⁠Introduction of Default Mocks:

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 commented 2 months ago

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

saikrishna321 commented 2 months ago

@GitAniketM Interesting! Looking forward for the PR

aniket-k-mukherjee commented 2 months ago

Ok, cool @saikrishna321

sudharsan-selvaraj commented 2 months ago

@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 commented 2 months ago

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

aniket-k-mukherjee commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

@aniket-k-mukherjee I have published a new version now. appium-interceptor@1.0.0-beta.12

Please check.

Also can you please give me your opencollective account name.

aniket-k-mukherjee commented 1 month ago

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 commented 1 month ago

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

saikrishna321 commented 1 month ago

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

aniket-k-mukherjee commented 1 month ago

@saikrishna321 , https://opencollective.com/aniket-mukherjee

aniket-k-mukherjee commented 1 month ago

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

saikrishna321 commented 1 month ago

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

aniket-k-mukherjee commented 1 month ago

@saikrishna321 , accepted the invite. Have submitted