fingerprintjs-pro-react-native
fingerprintjs-pro-react-native copied to clipboard
E2E tests
- Bootstrap
e2e-appusing expo for running the E2E tests via Detox. - Introduced new
e2e-tests.ymlworkflow for running e2e tests. It runs on on pull requests and after release. When triggered on release, it will install released version and use it for testing. - Set
minSdkVersionto24on android to fix failing E2E app build. Reflects the same change made in react-native 0.76
Note: Currently one of the iOS tests are failing due to issue addressed in this PR.
Coverage report
St.:grey_question: |
Category | Percentage | Covered / Total |
|---|---|---|---|
| π΄ | Statements | 47.14% | 66/140 |
| π΄ | Branches | 38.78% | 19/49 |
| π΄ | Functions | 43.9% | 18/41 |
| π΄ | Lines | 45.59% | 62/136 |
Test suite run success
21 tests passing in 3 suites.
Report generated by π§ͺjest coverage report action from d8ef8d02da86b2eee3eab4bb367f91ebc33ce728
Show full coverage report
| St | File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
|---|---|---|---|---|---|---|
| π΄ | All files | 47.14 | 38.77 | 43.9 | 45.58 | |
| π‘ | Β FingerprintJsProAgent.ts | 76.92 | 76.47 | 100 | 76.92 | 39,59-62,95,103 |
| π‘ | Β FingerprintJsProContext.ts | 75 | 100 | 0 | 75 | 5 |
| π’ | Β FingerprintJsProProvider.tsx | 93.33 | 50 | 100 | 93.33 | 44 |
| π΄ | Β errors.ts | 15.38 | 10.71 | 15.38 | 15.38 | 8-33,56-249,272-285,332-336,343-379,383 |
| π΄ | Β index.ts | 0 | 0 | 0 | 0 | |
| π΄ | Β types.ts | 0 | 0 | 0 | 0 | |
| π’ | Β useVisitorData.ts | 100 | 100 | 100 | 100 |
Tested with Android, all is good, a few feedback:
- I tested it with a real device instead of emulator. It was easy to find what configuration to change, I just looked it up in detox docs. No need to mention how to do this in this repo because it is a good idea to direct users to read detox docs if they need to do something different, so all is good
- I faced an error saying "Could not get unknown property 'release' for SoftwareComponent container of type org.gradle.api.internal.component.DefaultSoftwareComponentContainer.". I expect that you've faced the same, probably? The fix is to make modifications in
e2e-app/node_modules/expo-modules-core/android/ExpoModulesCorePlugin.gradleso that it doesn't throw an error. We can make this change permanent by applying the change on eachpnpm installby using a library like patch-package - I had to create
e2e-app/android/local.propertiesfile with the content ofsdk.dir=<REDACTED>to indicate Android SDK path. I think we should document this