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

test: bump detox + implement dynamic scroll in e2e tests #8174

Merged
merged 8 commits into from
Dec 21, 2023

Conversation

cortisiko
Copy link
Member

@cortisiko cortisiko commented Dec 20, 2023

Description

The purpose of this PR is to accomplish two things:

bump detox version (this hasn't been done in a couple of months)
Implement dynamic scroll in tests

Previously, the use of APIs higher than 30 was hindered by an Android blocker on Detox's end. As mentioned in #6384

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 a tapAndHold() action. See the open issue in wix/detox wix/Detox#3762

With this new detox version bump, the blocker has been lifted, allowing us to utilize Android 31+.

Furthermore, how we scroll to elements introduces flakiness. Instead of hardcoding a scroll speed in tests, we will now introduce dynamic scrolling. We will scroll on a view until the element is visible within the viewport. This was done using whileElement

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Smoke run: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/42936d4e-1df8-40ca-bd88-4f408cdd655a

Regression Run: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/cb83ae29-a0a4-49f5-a2f5-7c6683bf38e3

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Copy link

Updated dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
detox 20.13.1...20.14.3 None +0/-0 8.36 MB wix.mobile

@cortisiko cortisiko added No QA Needed/E2E Only Apply this label when your PR does not need any QA effort. team-mobile-client labels Dec 20, 2023
@codecov-commenter
Copy link

codecov-commenter commented Dec 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e2121e9) 39.61% compared to head (164275b) 39.61%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8174   +/-   ##
=======================================
  Coverage   39.61%   39.61%           
=======================================
  Files        1233     1233           
  Lines       29810    29810           
  Branches     2839     2839           
=======================================
  Hits        11810    11810           
  Misses      17306    17306           
  Partials      694      694           

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

@cortisiko cortisiko marked this pull request as ready for review December 21, 2023 00:30
@cortisiko cortisiko requested a review from a team as a code owner December 21, 2023 00:30
@cortisiko cortisiko added the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Dec 21, 2023
Copy link
Contributor

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/029320f5-67f2-4af8-a828-dc829fd157db
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

@Cal-L
Copy link
Contributor

Cal-L commented Dec 21, 2023

What's the difference between the scroll before and dynamic scrolling?

Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

left some comments

.detoxrc.js Outdated Show resolved Hide resolved
@cortisiko
Copy link
Member Author

What's the difference between the scroll before and dynamic scrolling?

The way we scrolled before was non-deterministic. Depending on various screen sizes, whenever we scroll, the element may or may not be visible. This PR introduces a way to scroll by a defined number of pixels until the desired element is visible.

Copy link
Contributor

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/65b897eb-189f-4850-9743-1eaf80b14ac9
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

Copy link
Member

@SamuelSalas SamuelSalas left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

Lgtm

Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

Copy link

sonarcloud bot commented Dec 21, 2023

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link
Contributor

@chrisleewilcox chrisleewilcox left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/af5faf99-d294-4d74-a80e-294a9dc317b4
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

@cortisiko cortisiko removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Dec 21, 2023
@cortisiko cortisiko merged commit 725003e into main Dec 21, 2023
30 checks passed
@cortisiko cortisiko deleted the detox/bump-to-v20.14.3 branch December 21, 2023 23:23
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2023
@metamaskbot metamaskbot added the release-7.15.0 Issue or pull request that will be included in release 7.15.0 label Dec 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
E2E No QA Needed/E2E Only Apply this label when your PR does not need any QA effort. release-7.15.0 Issue or pull request that will be included in release 7.15.0 team-mobile-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants