-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
test: Add android detox coverage with new RN upgrade #6384
Conversation
- Bump RN to 0.71.6 and update pods - Add @ethereumjs/util - Bump metro-react-native-babel-preset - Bump rn-nodeify - Bump package.json node engine - Update Yarn lockfile
This reverts commit ad58291.
This reverts commit d8f7279.
…Mask/metamask-mobile into upgrade/react-native/0.71.6
disable android keyboard learning feature
Updated dependencies detected. Learn more about Socket for GitHub ↗︎
|
This reverts commit 3d805bd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Development & PR Process
release-xx
label to identify the PR slated for a upcoming release (will be used in release discussion)needs-dev-review
label when work is completedneeds-qa
label when dev review is completedQA Passed
label when QA has signed offDescription
This PR enables Detox testing with Android on the react native upgrade PR. Initially, our test runs were limited to iOS devices, where we relied primarily on TestIDs to identify elements. However, when extending our test coverage to Android, we had to incorporate different detox matchers. To address these minor variations in platforms, we employ a straightforward IF-ELSE statement. We first verify whether the tests are executed on an iOS platform. If so, we utilize the
byId
matcher approach; otherwise, we resort to thebyLabel
matcher.An example of this would be tapping on the confirm button on the transaction confirmation modal:
In the above code block, we are verifying whether the current test is running on an iOS device. If it is an iOS device, we perform a tap action on the confirm button using the testID. However, if it is not an iOS device, we tap the confirm button byLabel.
NOTE
We have identified an ongoing visibility issue in React Native, which becomes more pronounced when running tests on devices with smaller screens. This issue is currently an open ticket in the react-native repo. Tests failed with a visibility error similar to
Test Failed: 15.0sec timeout expired without matching of given matcher: (view has effective visibility <VISIBLE> and view.getGlobalVisibleRect() covers at least <75> percent of the view's area)
There is currently an issue when running detox on android 12 and 13 (API 32/33) which prevents the tests from running. The issue is, the
tap()
action is treated like atapAndHold()
action. See the open issue in wix/detox hereThere are intermitted failures on bitrise due to network latency during the yarn setup step. See [Android] When executing the "yarn setup" command on Bitrise, intermittent failures related to the "Sharp" package occur. #6778
Detox has an intermittent crash on iOS which looks like:
If you do encounter this error, try kicking off another test run. A short-term solution until this is addressed is to have test retries.
To trigger Android tests
Run this command:
yarn test:e2e:android:debug --testNamePattern="Smoke"
Screenshots/Recordings
I was able to get tests running and passing on my local machine, see comment here: #6384 (comment)
As well as bitrise:
https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/8ac3dc28-a4e7-4d17-be6a-7e4ccd244eba
https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/1a34585a-5f4b-48cc-8730-3282f2b89f93
https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/70280740-3d02-45f4-9e6e-b836738e176b
https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/d4d4cf3a-f6ed-40bf-9f1a-33e8b24a07de
Issue
Progresses #5913
Checklist