-
Notifications
You must be signed in to change notification settings - Fork 36
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
E2E tests setup and initial tests #1417
Conversation
- It needs to be transpiled, so was excepted from the node_modules in transformIgnorePatterns - The global window variable had to be removed because it was breaking this code: https://github.com/typeorm/typeorm/blob/e4de0403e1f666639c0198e216409f997121c1e8/src/platform/BrowserPlatformTools.template#L20
- Android Notes - increases android's minSdkVersion to 18 - adds kotlin support - disables split ABI APKs for debug builds - Yarn Scripts - test:e2e:android to run on device - test:e2e:android:emu to run on emulator
So we don't have to hardcode devices/emulators in package.json This is somewhat hacky, there are dummy ones there or else detox will complain. But the device name keys are only generated last second before detox.init in e2e/init.js
until wix/Detox#445 is handled
DefinitelyTyped PR for missing testID props was merged
this includes some fixes we need, like android connectivity issue from wix/Detox#1601
failures due to misconfiguration (or random node module breakages) result in a whole bunch of unrelated/confusing failures in the tests, and there's no point of continuing tests if there's no detox anyway
react-devtools --depends-on--> electron -> electron-download -> fs-extra 0.3 for some reason detox loads fs-extra 0.3, though it depends on ^4.0.2 and that's why we can't have nice things
- find Text element by type - try to also find a Text child of the given testID - handle matching multiple children and read each recursively
50811db
to
5a90cf1
Compare
Conflicts: src/ui/registration/components/entropy.tsx
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.
Android Emulator
- I start up an emulator and then run:
yarn start
# separate terminal
yarn run e2e:android:emu
BUILD SUCCESSFUL
01_landing.spec.ts
passes
03_recovery.spec.ts
and 02_creation.spec.ts
fail to run with ReferenceError: device is not defined
.
The others fail as they have no tests.
Android Device
yarn start
yarn run e2e:android
BUILD SUCCESSFUL
then same as above. 01 passes but the other two say that device is not defined
from the e2e/utils.ts
file
I assume this isn't as intended?
I'm going to see if I can get this to run on iOS now.
iOS DeviceI ran There should also be some documentation somewhere regarding the pitfalls - e.g. needing the bundle server started and having the bundle fully loaded before running the tests. |
There's also a conflict with the new entropy screen, because the infinite loop animation hangs detox :/ |
can't access devices unless detox.init is called
Conflicts: src/ui/recovery/components/inputSeedPhrase.tsx
I can confirm the hanging on the entropy screen. Next is: Input Seed Phrase Screen 'Multiple UI elements matched for given criteria.' as part of 'should add words to seed phrase on tap' test At e2e/utils.ts:42 try {
//console.error('expect with child')
await expect(el).toBeVisible()
} catch (err) { |
will need later for REPL
because it's an infinite loop animation using callbacks, always keeping the UI module busy, so detox need to be told to ignore that. Spoilers: it still doesn't work because the android disableSynchronization support is broken
this has a branch merged from leanmazzu/Detox.git with unreleased support for disableSynchronization now the e2e/01_new_user/02_creation test should be able to work around the hand animation screen Spoilers: it can't, the loop is never broken....
I'm using a fork of detox with an unreleased branch to support proper disabling of synchronization, so we can avoid the infinite animation issue. Another issue with the new entropy screen was the the animation loop would continue even after the animation component was unmounted, so even in the step after the entropy collection detox would hang (and presumably would hang forever if the hand animation is ever rendered) These issues have been addressed in the last couple commits |
Clearing the timeout is not useful, it will have already fired. The problem is with the recursive callbacks, which must be broken with a flag
b8b437a
to
92984eb
Compare
I have moved the detox fork to the @jolocom organization and updated package.json. The |
Tested as well, this looks good, outside of the merge conflicts I think this can be merged. An extra issue should be created to add documentation on how to run this. I found the comments left by @saifahn really helpful. |
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, we should update the README with instructions for running these.
Conflicts: yarn.lock
Resolves #1415
This builds on #1410 which must be merged firstNOTES
minSdkVersion
bumped to 18yarn e2e:android
to run the testsyarn e2e:android -r
to reuse last app installation and prevent detox from reinstallingyarn e2e:android -r recovery
to run the tests matching "recovery" (this is somewhat broken)