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

Fix ignored OrdersUITest #12963

Merged
merged 2 commits into from
Nov 25, 2024
Merged

Fix ignored OrdersUITest #12963

merged 2 commits into from
Nov 25, 2024

Conversation

irfano
Copy link
Contributor

@irfano irfano commented Nov 20, 2024

Description

OrdersUITest was ignored during toolbar refactoring process. Some parts of the order-related tests were addressed in #12906. This PR resolves the remaining issues with OrdersUITest.

Before, OrdersUITest was failing with the following error:

 androidx.test.espresso.AmbiguousViewMatcherException: 'view.getId() is <2131364783/com.woocommerce.android.dev:id/toolbar>' matches 2 views in the hierarchy:
- [1] MaterialToolbar{id=2131364783, res-name=toolbar, visibility=VISIBLE, width=1069, height=154, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=com.google.android.material.appbar.CollapsingToolbarLayout$LayoutParams@YYYYYY, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=-154.0, child-count=3}
- [2] MaterialToolbar{id=2131364783, res-name=toolbar, visibility=VISIBLE, width=1080, height=154, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=android.widget.LinearLayout$LayoutParams@YYYYYY, tag=null, root-is-layout-requested=false, has-input-connection=false, x=0.0, y=0.0, child-count=3}

This error was caused by duplicate toolbars on the screen. I'm not sure if this is optimal or not, but it falls outside the scope of this PR. To resolve the AmbiguousViewMatcherException, I used the first found toolbar to assert the toolbar title.

Steps to reproduce

Test OrdersUITest.

Testing information

The tests that have been performed

OrdersUITest

  • 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.

@irfano irfano added the category: ui tests Related to UI testing. label Nov 20, 2024
@irfano irfano added this to the 21.2 milestone Nov 20, 2024
@irfano irfano requested a review from a team as a code owner November 20, 2024 16:07
@irfano irfano requested a review from AnirudhBhat November 20, 2024 16:08
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Nov 20, 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
Commite3a3235
Direct Downloadwoocommerce-wear-prototype-build-pr12963-e3a3235.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Nov 20, 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
Commite3a3235
Direct Downloadwoocommerce-prototype-build-pr12963-e3a3235.apk

@irfano irfano force-pushed the fix/ignored-ordersuitest branch from 7973dea to e3a3235 Compare November 20, 2024 16:50
@wpmobilebot wpmobilebot modified the milestones: 21.2, 21.3 Nov 22, 2024
@wpmobilebot
Copy link
Collaborator

Version 21.2 has now entered code-freeze, so the milestone of this PR has been updated to 21.3.

@AnirudhBhat AnirudhBhat self-assigned this Nov 25, 2024
Copy link
Contributor

@AnirudhBhat AnirudhBhat left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

@AnirudhBhat AnirudhBhat merged commit e5d79d7 into trunk Nov 25, 2024
17 of 20 checks passed
@AnirudhBhat AnirudhBhat deleted the fix/ignored-ordersuitest branch November 25, 2024 10:00
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants