-
Notifications
You must be signed in to change notification settings - Fork 452
test(mobile): add E2E tests for main navigation (Wallet 4.0 & legacy) #14749
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
Open
deepyjr
wants to merge
4
commits into
develop
Choose a base branch
from
feat/e2e-nav-bar
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
e0853aa
test(mobile): add testIDs for main navigation e2e testing
deepyjr 2be6bcf
test(mobile): add e2e page object and specs for main navigation
deepyjr 10cc40f
refactor(mobile): unify tab navigation selectors and enhance portfoli…
deepyjr 07c9edd
fix(tests): merge the 2 tests inside one
deepyjr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "live-mobile": minor | ||
| --- | ||
|
|
||
| Add E2E test infrastructure for main navigation (Wallet 4.0 and legacy) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| /* eslint-disable @typescript-eslint/no-var-requires */ | ||
| /** | ||
| * Mock for @sbaiahmed1/react-native-blur used during E2E (Detox) builds. | ||
| * | ||
| * BlurView's UIViewPropertyAnimator sets an NSNull delegate on CAAnimation, | ||
| * which crashes DetoxSync's animation tracking on iOS. | ||
| * Replacing native blur components with plain Views avoids the crash while | ||
| * keeping the rest of the UI intact. | ||
| */ | ||
| const React = require("react"); | ||
| const { View } = require("react-native"); | ||
|
|
||
| const passthrough = React.forwardRef((props, ref) => { | ||
| const { style, children } = props; | ||
| return React.createElement(View, { ref, style }, children); | ||
deepyjr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }); | ||
|
|
||
| passthrough.displayName = "BlurViewMock"; | ||
|
|
||
| module.exports = { | ||
| BlurView: passthrough, | ||
| VibrancyView: passthrough, | ||
| LiquidGlassView: passthrough, | ||
| LiquidGlassContainer: passthrough, | ||
| ProgressiveBlurView: passthrough, | ||
| BlurSwitch: passthrough, | ||
| default: passthrough, | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
apps/ledger-live-mobile/src/mvvm/components/MainTabBar/types.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,14 @@ const TAB_ICONS: Partial<Record<string, TabIconConfig>> = { | |
| [NavigatorName.Earn]: { icon: Chart5, activeIcon: Chart5Fill }, | ||
| [NavigatorName.CardTab]: { icon: CreditCard, activeIcon: CreditCardFill }, | ||
| }; | ||
|
|
||
| const TAB_TEST_IDS: Partial<Record<string, string>> = { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you can use it for some test id declaration accross the PR
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok i will update |
||
| [NavigatorName.Portfolio]: "w40-tab-home", | ||
| [NavigatorName.Swap]: "w40-tab-swap", | ||
| [NavigatorName.Earn]: "w40-tab-earn", | ||
| [NavigatorName.CardTab]: "w40-tab-card", | ||
| }; | ||
|
|
||
| export const useMainTabBarViewModel = ({ | ||
| state, | ||
| navigation, | ||
|
|
@@ -43,6 +51,7 @@ export const useMainTabBarViewModel = ({ | |
| state.routes.map(route => ({ | ||
| value: route.name, | ||
| label: t(LABELKEY_MAP[route.name] ?? route.name), | ||
| testID: TAB_TEST_IDS[route.name], | ||
| ...TAB_ICONS[route.name], | ||
| })), | ||
| [state.routes, t], | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.