ericcornelissen / NervousFish

An app for your :iphone: to exchange public-keys in a secure manner.
GNU Lesser General Public License v3.0
2 stars 4 forks source link

Add conditional tests for NFC/Bluetooth button on devices that support it #255

Closed ericcornelissen closed 7 years ago

ericcornelissen commented 7 years ago

User story

As a developer I want some way of automatically verifying that the Bluetooth/NFC fab buttons work even if it is not covered by any CI.

What

This issue demands that tests are added to the MainActivitySteps that only run when Bluetooth/NFC are available on the device on which the tests are ran. Otherwise the tests should be skipped/do nothing.

Why

This issue is needed for the project because it provides the minimum possible guarentee that these buttons work and do not crash the app. Some people (including myself) tend to run androidTests on their mobile device (which is likely to have Bluetooth/NFC).

How

This feature can be added by creating new Scenarios in the MainActivity.feature file where the step definitions only conditionally (if Bluetooth/NFC are available) verify behavior and otherwise do nothing/don't fail.

Definition of ready

n/a

Definition of done

This task can be considered done when

Notes

None

ericcornelissen commented 7 years ago

A test for the NFC button has been created with PR #311 🎉

However, Bluetooth proofs rather difficult 😕 This is because, when you enter the BluetoothConnectionActivity, you are prompted to set your device status to discoverable, however I've not been able to control this popup through the automated androidTests...

ericcornelissen commented 7 years ago

With commit c2305b9 on #311, there now also is a test for the Bluetooth button 🎉 It is less restrictive then the NFC test, since it only tests whether or not the app crashes. By doing that the "you are prompted to set your device status to discoverable"-problem has been circumvented, providing a minimum level of certainty the button is working.