Skip to content

Commit

Permalink
fix: change default gesture from Tap to Fling, fix failing CI (softwa…
Browse files Browse the repository at this point in the history
…re-mansion#2023)

## Description

Unfortunately, the `Tap` gesture as the default gesture in
ScreenGestureDetector breaks the back button on Android and iOS.
Somehow, gesture detector while "tapping" just taps and holds the back
button, resulting in breaking CI and our testing apps.
This PR changes this gesture to `Fling`, resulting in correct behavior.
It cannot be changed to `Manual` gesture, since it also breaks the iOS
CI.

## Changes

- Changed gesture from Tap to Fling
- Updated detox from 20.11.4 to 20.17.0
- Fixed Android E2E tests by building the bundle with .so files on
x86_64 architecture
- Changed scroll action that was opening background apps preview on
Android 33 (and higher) levels
- Adjusted CI parameters, fixed the typo of artifact names

## Test code and steps to reproduce

You can go through Example app and try to click back button in `Events`.
Right now it should work properly.

## Checklist

- [x] Ensured that CI passes

---------

Co-authored-by: m-bert <michal.bert@swmansion.com>
  • Loading branch information
2 people authored and ja1ns committed Oct 9, 2024
1 parent 239711e commit fff6203
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/android-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
working-directory: ${{ env.WORKING_DIRECTORY }}
run: yarn build-e2e-android
- name: Run emulator and tests
uses: reactivecircus/android-emulator-runner@v2.28.0
uses: reactivecircus/android-emulator-runner@v2
with:
working-directory: ${{ env.WORKING_DIRECTORY }}
api-level: 31
Expand All @@ -59,5 +59,5 @@ jobs:
- uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: android-fail-screen-shoots
name: android-fail-screen-shots
path: ${{ env.WORKING_DIRECTORY }}/artifacts
2 changes: 1 addition & 1 deletion .github/workflows/ios-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ jobs:
- uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: ios-fail-screen-shoots
name: ios-fail-screen-shots
path: ${{ env.WORKING_DIRECTORY }}/artifacts
4 changes: 2 additions & 2 deletions Example/.detoxrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ module.exports = {
type: 'android.apk',
binaryPath: 'android/app/build/outputs/apk/debug/app-debug.apk',
build:
'cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..',
'cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug -PreactNativeArchitectures=x86_64 && cd ..',
reversePorts: [8081],
},
'android.release': {
type: 'android.apk',
binaryPath: 'android/app/build/outputs/apk/release/app-release.apk',
build:
'cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..',
'cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release -PreactNativeArchitectures=x86_64 && cd ..',
},
},
devices: {
Expand Down
2 changes: 1 addition & 1 deletion Example/e2e/examplesTests/events.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('Events', () => {
await waitFor(element(by.id('root-screen-playground-Events')))
.toBeVisible()
.whileElement(by.id('root-screen-examples-scrollview'))
.scroll(200, 'down');
.scroll(100, 'down', NaN, 0.85);
});

it('should Events playground exist', async () => {
Expand Down
2 changes: 1 addition & 1 deletion Example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@types/react-native-restart": "^0.0.0",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.3.1",
"detox": "^20.11.4",
"detox": "^20.17.0",
"eslint": "^8.19.0",
"glob-to-regexp": "^0.4.1",
"jest": "^29.3.1",
Expand Down
61 changes: 54 additions & 7 deletions Example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1323,6 +1323,11 @@
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.48.0.tgz#642633964e217905436033a2bd08bf322849b7fb"
integrity sha512-ZSjtmelB7IJfWD2Fvb7+Z+ChTIKWq6kjda95fLcQKNS5aheVHn4IkfgRQE3sIIzTcSLwLcLZUD9UBt+V7+h+Pw==

"@flatten-js/interval-tree@^1.1.2":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@flatten-js/interval-tree/-/interval-tree-1.1.2.tgz#fcc891da48bc230392884be01c26fe8c625702e8"
integrity sha512-OwLoV9E/XM6b7bes2rSFnGNjyRy7vcoIHFTnmBR2WAaZTf0Fe4EX4GdA65vU1KgFAasti7iRSg2dZfYd1Zt00Q==

"@hapi/hoek@^9.0.0":
version "9.3.0"
resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.3.0.tgz#8368869dcb735be2e7f5cb7647de78e167a251fb"
Expand Down Expand Up @@ -2752,6 +2757,16 @@ buffer@^5.5.0:
base64-js "^1.3.1"
ieee754 "^1.1.13"

bunyamin@^1.5.0:
version "1.5.2"
resolved "https://registry.yarnpkg.com/bunyamin/-/bunyamin-1.5.2.tgz#681db204c0b16531369d5c1f6c89dc8d760b7558"
integrity sha512-Xp2nfqk33zt3nX90OSTkLVOc5N+1zdR3MWvfLHoIrm3cGRkdxPTPYB9CCgrDV8oum5rbghJjAbmXFXOrRXvMtg==
dependencies:
"@flatten-js/interval-tree" "^1.1.2"
multi-sort-stream "^1.0.4"
stream-json "^1.7.5"
trace-event-lib "^1.3.1"

bunyan-debug-stream@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/bunyan-debug-stream/-/bunyan-debug-stream-3.1.0.tgz#78309c67ad85cfb8f011155334152c49209dcda8"
Expand All @@ -2769,6 +2784,18 @@ bunyan@^1.8.12:
mv "~2"
safe-json-stringify "~1"

bunyan@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/bunyan/-/bunyan-2.0.5.tgz#9dd056755220dddd8b5bb9cf76f3d0d766e96e71"
integrity sha512-Jvl74TdxCN6rSP9W1I6+UOUtwslTDqsSFkDqZlFb/ilaSvQ+bZAnXT/GT97IZ5L+Vph0joPZPhxUyn6FLNmFAA==
dependencies:
exeunt "1.1.0"
optionalDependencies:
dtrace-provider "~0.8"
moment "^2.19.3"
mv "~2"
safe-json-stringify "~1"

bytes@3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048"
Expand Down Expand Up @@ -3252,10 +3279,10 @@ detect-newline@^3.0.0:
resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651"
integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==

detox@^20.11.4:
version "20.11.4"
resolved "https://registry.yarnpkg.com/detox/-/detox-20.11.4.tgz#2347f320da0e7eae2a0c2691bf8986768d02d8ee"
integrity sha512-P48KAtK8qIDOxJKUl4q/syPkuHz67kAeFlNodBZg5aO4hJiH+RsbEkQfJSYkTCeZV800EcmUQwZK2M5amLoYaw==
detox@^20.17.0:
version "20.17.0"
resolved "https://registry.yarnpkg.com/detox/-/detox-20.17.0.tgz#836d2ebb193572e1f4a97e44af343891a5658f7b"
integrity sha512-IasYgexfkrCoZuJTaqqKHQ2yflK+tnqifzdLwrp4hdTWlXUlG9j/YcM1Dn3ThSs3b6VNMtbSe6xoPkKD0oNiIQ==
dependencies:
ajv "^8.6.3"
bunyan "^1.8.12"
Expand All @@ -3269,6 +3296,7 @@ detox@^20.11.4:
funpermaproxy "^1.1.0"
glob "^8.0.3"
ini "^1.3.4"
jest-environment-emit "^1.0.5"
json-cycle "^1.3.0"
lodash "^4.17.11"
multi-sort-stream "^1.0.3"
Expand Down Expand Up @@ -3721,6 +3749,11 @@ execa@^5.0.0, execa@^5.1.1:
signal-exit "^3.0.3"
strip-final-newline "^2.0.0"

exeunt@1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/exeunt/-/exeunt-1.1.0.tgz#af72db6f94b3cb75e921aee375d513049843d284"
integrity sha512-dd++Yn/0Fp+gtJ04YHov7MeAii+LFivJc6KqnJNfplzLVUkUDrfKoQDTLlCgzcW15vY5hKlHasWeIsQJ8agHsw==

exit@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c"
Expand Down Expand Up @@ -4874,6 +4907,20 @@ jest-each@^29.6.3:
jest-util "^29.6.3"
pretty-format "^29.6.3"

jest-environment-emit@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/jest-environment-emit/-/jest-environment-emit-1.0.5.tgz#e6f33451f98b88ccd48e9e1188bb535880f03c1b"
integrity sha512-OsQ08AhYxkkyDBTIow+9ogNmJheQIGWQKp0Nku+1ToLWjAj2Pd6LmypN8HgUIqYHs4HFcqkQ25kaf1qExmoZpg==
dependencies:
bunyamin "^1.5.0"
bunyan "^2.0.5"
bunyan-debug-stream "^3.1.0"
funpermaproxy "^1.1.0"
lodash.merge "^4.6.2"
node-ipc "9.2.1"
strip-ansi "^6.0.0"
tslib "^2.5.3"

jest-environment-node@^29.2.1, jest-environment-node@^29.6.4:
version "29.6.4"
resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.6.4.tgz#4ce311549afd815d3cafb49e60a1e4b25f06d29f"
Expand Down Expand Up @@ -6215,7 +6262,7 @@ ms@2.1.3:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==

multi-sort-stream@^1.0.3:
multi-sort-stream@^1.0.3, multi-sort-stream@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/multi-sort-stream/-/multi-sort-stream-1.0.4.tgz#e4348edc9edc36e16333e531a90c0f166235cc99"
integrity sha512-hAZ8JOEQFbgdLe8HWZbb7gdZg0/yAIHF00Qfo3kd0rXFv96nXe+/bPTrKHZ2QMHugGX4FiAyET1Lt+jiB+7Qlg==
Expand Down Expand Up @@ -7537,7 +7584,7 @@ stream-chain@^2.2.5:
resolved "https://registry.yarnpkg.com/stream-chain/-/stream-chain-2.2.5.tgz#b30967e8f14ee033c5b9a19bbe8a2cba90ba0d09"
integrity sha512-1TJmBx6aSWqZ4tx7aTpBDXK0/e2hhcNSTV8+CbFJtDjbb+I1mZ8lHit0Grw9GRT+6JbIrrDd8esncgBi8aBXGA==

stream-json@^1.7.4:
stream-json@^1.7.4, stream-json@^1.7.5:
version "1.8.0"
resolved "https://registry.yarnpkg.com/stream-json/-/stream-json-1.8.0.tgz#53f486b2e3b4496c506131f8d7260ba42def151c"
integrity sha512-HZfXngYHUAr1exT4fxlbc1IOce1RYxp2ldeaf97LYCOPSoOqY/1Psp7iGvpb+6JIOgkra9zDYnPX01hGAHzEPw==
Expand Down Expand Up @@ -7840,7 +7887,7 @@ tslib@^1.8.1:
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==

tslib@^2.0.1:
tslib@^2.0.1, tslib@^2.5.3:
version "2.6.2"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae"
integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==
Expand Down
2 changes: 1 addition & 1 deletion src/gesture-handler/ScreenGestureDetector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
getAnimationForTransition,
} from './constraints';

const EmptyGestureHandler = Gesture.Tap();
const EmptyGestureHandler = Gesture.Fling();

const ScreenGestureDetector = ({
children,
Expand Down

0 comments on commit fff6203

Please sign in to comment.