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

[WOO POS] UI tests for Simple products banner in Products screen #12428

Draft
wants to merge 17 commits into
base: trunk
Choose a base branch
from

Conversation

AnirudhBhat
Copy link
Contributor

@AnirudhBhat AnirudhBhat commented Aug 28, 2024

Closes: #12377

Description

This PR:

  1. Sets up mock API responses required for successfully writing UI tests for POS screens
  2. Adds UI tests for Simple products only banner in Products screen

Testing information

Ensure the CI is happy - specifically, UI test pipeline is green.

The tests that have been performed

  1. UI test to verify Simple products only banner is displayed
  2. UI test to verify Simple products only banner's title and message are correctly displayed
  3. UI test to verify Simple products only banner opens Product info dialog when clicked on learn more
  4. UI test to verify Simple products only banner is dismissed when closed

Images/gif

Screen.Recording.2024-08-21.at.6.22.44.PM.mov
  • 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.

@AnirudhBhat AnirudhBhat added category: ui tests Related to UI testing. feature: point of sale POS project type: task An internally driven task. labels Aug 28, 2024
@dangermattic
Copy link
Collaborator

1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Aug 28, 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
Commitd064a29
Direct Downloadwoocommerce-wear-prototype-build-pr12428-d064a29.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Aug 28, 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
Commitd064a29
Direct Downloadwoocommerce-prototype-build-pr12428-d064a29.apk

…products-banner

# Conflicts:
#	WooCommerce/src/main/kotlin/com/woocommerce/android/ui/woopos/home/WooPosHomeProductInfoDialog.kt
#	WooCommerce/src/main/kotlin/com/woocommerce/android/ui/woopos/home/products/WooPosBanner.kt
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 40.64%. Comparing base (c79075c) to head (d064a29).

Files Patch % Lines
...ocommerce/android/ui/moremenu/MoreMenuViewModel.kt 0.00% 1 Missing ⚠️
...ce/android/ui/woopos/home/products/WooPosBanner.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              trunk   #12428      +/-   ##
============================================
- Coverage     40.64%   40.64%   -0.01%     
  Complexity     5602     5602              
============================================
  Files          1214     1214              
  Lines         68105    68106       +1     
  Branches       9358     9358              
============================================
  Hits          27683    27683              
- Misses        37885    37886       +1     
  Partials       2537     2537              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -321,7 +321,8 @@ class MoreMenuViewModel @Inject constructor(
mapOf(VALUE_MORE_MENU_PAYMENTS_BADGE_VISIBLE to isPaymentBadgeVisible().toString())
)
moreMenuNewFeatureHandler.markPaymentsIconAsClicked()
triggerEvent(MoreMenuEvent.ViewPayments)
// triggerEvent(MoreMenuEvent.ViewPayments)
triggerEvent(MoreMenuEvent.NavigateToWooPosEvent)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change was made solely to run UI tests and needs to be reverted. The reason for the change is that the store used for UI testing doesn't pass IPP onboarding, which causes the POS setting to not appear in the settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: ui tests Related to UI testing. feature: point of sale POS project type: task An internally driven task.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Woo POS[ Add UI tests for Simple products only banner
4 participants