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

Simulate NFC scan event in Android with Detox #2699

Open
chrisfinch opened this issue Mar 22, 2021 · 2 comments
Open

Simulate NFC scan event in Android with Detox #2699

chrisfinch opened this issue Mar 22, 2021 · 2 comments

Comments

@chrisfinch
Copy link

Hi,

Thanks for providing this open source software, your effort is really appreciated.

The android app I want to test responds to scans of NFC tags;

  • A tag is scanned and depending on the status of that tag navigation and data loading occurs in the app.

In order to test the app I need to simulate the scan event of different types of tags in order to trigger all my navigation routes.

From a test I need to either;

  • Call RN js application code where I can create functions that just trigger my scan capturing code directly

or

  • Call Native Android code that can simulate an NFC scan that will be picked up by the RN side

or

  • Send a fake scan event intent to the app running in emulator that will be interpreted as the NFC scan event

I've done a lot of googling but cannot find any examples of anyone doing something like this.

Any info would be really useful as it looks like Detox would meet all our e2e testing needs apart from this one!

Thanks!

@stale
Copy link

stale bot commented Apr 21, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back.

Thank you for your contributions!

For more information on bots in this reporsitory, read this discussion.

@d4vidi
Copy link
Collaborator

d4vidi commented Apr 25, 2021

@chrisfinch So I'm taking this as a feature suggestion -- but also, seems like you'd be interesting on introducing this feature into Detox yourself? If so, that would be amazing and we'll do our best to support that.
In any case, offhand, the intent-based solution seems the most black-box-ish, and probably aligns with what is required by the app in order to support NFC tags regardless of Detox. Wdyt?

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

3 participants