cucumber-android
cucumber-android copied to clipboard
Running features not found in resources
I'd like to be able to source my feature files externally (the use case is not your typical Android application - it's a custom device and test automation is running as part of some end-user scenarios).
Having .feature files on the local filesystem would work (but a mechanism that would allow me to supply gherkin scripts from a source of my choosing would be better). I've tried running "am instrument -e features [path.to.file]" but it looks like cucumber-android is still looking for a path within resources, not the filesystem.
Curious if this is possible with the current implementation?
Currently only test application assets are supported. You can bundle all feature files within test app and then choose which one to run. The path you supply is on your local machine? Then it can't work at all because tests are executed on device and don't have access to your computer. If features would be somewhere on device, e.g sdcard, downloads then it would require changes in CucumberAndroidJUnitRunner
Thanks for the info @lsuski - I suspected this might be the case.
Tests are on the device (they will be downloaded from a web service).
Would you consider accepting a PR that adds either filesystem support, or the ability to provide a ResourceLoader?
If it will be working then I don't see any problem to accept it
I have a couple of working versions, but I see that you're using file: URIs to load Android resources. I'm trying to load actual file: resources, so there's a conflict.
The two solutions I have for this are:
- look for an absolute file:/// URI
- default the features option to an "android.resource:" URI
Both options run cukelator, pass all unit tests, and run file-based tests, which works for me.
I'll have a PR (or two) for you soon.
So I've added both PRs here but obviously only one should be chosen.