Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detox: How to bypass authentication when testing

I have an app that uses OAuth. I don't want to have to use an external, unmocked server to be able to log in. Is there a way of bypassing the authentication on detox-tested applications?

Something such as: A GoTo navigational screen detox method, or a testing-only dark launched button that will navigate to the home screen.

Any help is very appreciated

like image 803
Paul Brittain Avatar asked Oct 21 '25 04:10

Paul Brittain


1 Answers

The way we solved this, was by creating a mock server, implementing there a very simple OAuth and point the app there.

Another way is to create a specific implementation on the app to open directly certain page (for instance with specific test deep linking).

like image 88
mloureiro Avatar answered Oct 23 '25 00:10

mloureiro