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

Running features not found in resources #32

Open
dazwin opened this issue Nov 2, 2019 · 5 comments · May be fixed by #33
Open

Running features not found in resources #32

dazwin opened this issue Nov 2, 2019 · 5 comments · May be fixed by #33

Comments

@dazwin
Copy link

dazwin commented Nov 2, 2019

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?

@lsuski
Copy link
Contributor

lsuski commented Nov 2, 2019

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

@dazwin
Copy link
Author

dazwin commented Nov 7, 2019

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?

@lsuski
Copy link
Contributor

lsuski commented Nov 7, 2019

If it will be working then I don't see any problem to accept it

@dazwin
Copy link
Author

dazwin commented Nov 13, 2019

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.

@dazwin
Copy link
Author

dazwin commented Nov 13, 2019

So I've added both PRs here but obviously only one should be chosen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants