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

Controlling Detox Relaunch behaviours in between running tests #4587

Open
harsh25jai opened this issue Sep 23, 2024 · 2 comments
Open

Controlling Detox Relaunch behaviours in between running tests #4587

harsh25jai opened this issue Sep 23, 2024 · 2 comments

Comments

@harsh25jai
Copy link

Description

I am facing issues in controlling detox behaviour in between running test cases.

For Ex:-

I have role-based login implemented, to test these from single test case file (login.test.jsx) I want to relaunch detox when jumping from 1 test case to another but I don't want this for all the test cases present in the file so can't use beforeEach.

I am currently using device.launchApp() after finishing the required test.

Next Issue is I want my next file (dashboard.test.jsx) should have contained the app state and does not require login again, but after finishing each test case file, detox autmatically reinstalls the app and does not allow to maintain app state.
I have already done a lot of research on this to implement test case using --reuse, device.reloadReactNative, etc...

If possible please create simpler indi-direct methods to controll detox behaviours in more dynamic way.

Thanks

Your environment

Detox version: v20.25.6
React Native version: v0.70.3
Node version: v20.17.0
Device model: Pixel 5
OS: Android 14
Test-runner (select one): jest

@harsh25jai
Copy link
Author

Also if possible please run react-native bundler by default when running detox test's in debug as its required and close as soon as test's are finished.

@noomorph
Copy link
Collaborator

Could you explain this with an example, please? Some dummy tests with your comments would be helpful to understand your situation better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants