Skip to content

Conversation

@hichamboushaba
Copy link
Member

@hichamboushaba hichamboushaba commented Dec 5, 2024

Description

As part of my Hack Week, I'm bringing back the ApiFaker project paqN3M-SI-p2, and I'm splitting the feature into multiple PRs.

This PR adds a UI bottom banner to the main app when the ApiFaker is enabled, and the banner allows an easy path to disabling the ApiFaker.

I added unit-tests-exemption label because the class ApiFakerUiHelper has UI logic and can't be unit tested.

Steps to reproduce

  1. Use a debug build.
  2. Open the app settings.
  3. Tap on Developer Options.
  4. Tap on ApiFaker.
  5. Add some fake endpoints definitions.
  6. Enable the ApiFaker.

Testing information

  • Confirm that when enabled, a bottom banner is shown on all app Activities (Login, MainActivity, Settings)
  • Confirm that tapping on the banner shows a dialog that allows disabling the ApiFaker.

The tests that have been performed

^

Images/gif



  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

Reviewer (or Author, in the case of optional code reviews):

Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement:

  • The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
  • Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
  • Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on big (tablet) and small (phone) in case of UI changes, and no regressions are added.

@hichamboushaba hichamboushaba added type: task An internally driven task. status: do not merge Dependent on another PR, ready for review but not ready for merge. labels Dec 5, 2024
@dangermattic
Copy link
Collaborator

dangermattic commented Dec 5, 2024

3 Warnings
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
⚠️ Class ApiFakerUiHelper is missing tests, but unit-tests-exemption label was set to ignore this.
⚠️ Class QueryParameterConverter is missing tests, but unit-tests-exemption label was set to ignore this.

Generated by 🚫 Danger

@hichamboushaba hichamboushaba marked this pull request as ready for review December 5, 2024 11:42
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Dec 5, 2024

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App Name WooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commit60ba59a
Direct Downloadwoocommerce-wear-prototype-build-pr13076-60ba59a.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Dec 5, 2024

📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App Name WooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commit60ba59a
Direct Downloadwoocommerce-prototype-build-pr13076-60ba59a.apk

@hichamboushaba hichamboushaba added this to the 21.3 milestone Dec 5, 2024
@hafizrahman hafizrahman self-assigned this Dec 10, 2024
Copy link
Contributor

@hafizrahman hafizrahman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Followed the test instruction and banner appeared correctly and dialog also worked 👍🏼

Code looks good too.

This makes sure the log is not printed when the matched endpoints use different query parameters.
[Hack Week] ApiFaker: match endpoints using query parameters
@hichamboushaba hichamboushaba removed the status: do not merge Dependent on another PR, ready for review but not ready for merge. label Dec 17, 2024
@hichamboushaba hichamboushaba merged commit e02f25c into task/api-faker-3 Dec 17, 2024
3 of 4 checks passed
@hichamboushaba hichamboushaba deleted the task/api-faker-4 branch December 17, 2024 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: task An internally driven task. unit-tests-exemption

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants