jhipster / generator-jhipster-react-native

A React Native blueprint for JHipster
https://jhipster-sample-app-react-native.vercel.app/
Apache License 2.0
262 stars 54 forks source link

Add support for e2e testing with OAuth #888

Open mraible opened 2 years ago

mraible commented 2 years ago

Describe the bug

Not a bug per se, just a missing feature. In run-detox-tests.sh, there's this code:

# if oauth, only run the launch screen since you need to authenticate for entities
if [ "$JHI_AUTH_TYPE" = "oauth2" ] ; then
  rm -rf e2e/entities
fi

The entity tests don't support logging in with OIDC and are therefore unreachable. We should fix this.

Instructions To reproduce

Create a React Native app with oauth2 and detox. Then, run detox tests.

Versions (please complete the following information):

irwansyahwii commented 2 months ago

@mraible can I take this?

mraible commented 2 months ago

Yes

irwansyahwii commented 2 months ago

@mraible I just finished setting up my dev env and managed to run the generated app and Detox. I am using RN generator from the main branch and for the backend I generated using nodejs generator.

I have several questions to ask:

  1. I can't find run-detox-tests.sh. Where can I find it?
  2. When I following the the generator wizard and specifying the backend location, the e2e tests generated doesn't contain any account related tests. But when I didn't specied the backend location it generated the account related tests. Which one should I choose?
  3. Do I just need to add more tests in the e2e test folder to test all the authentication functionalities of the app using OAuth as the backend?