[Cucumber-JVM] Get cucumber reports for Android tests

869 views
Skip to first unread message

Oana Rusu

unread,
Dec 5, 2013, 11:09:38 AM12/5/13
to cu...@googlegroups.com
Hello,

I am trying to get Cucumber reports, but I get a message with permission denied.

In my Manifest file I have:
    <uses-permission android:name="android.
permission.READ_EXTERNAL_STORAGE" />   
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />       


and in my class I have:
@RunWith (Cucumber.class)
@CucumberOptions(format = {"pretty", "html:/data/data/android.test/cucumber-html", "json:/data/data/android.test/report.json"}, features = "features")
public class RunTestAT {

}

When I try to run the tests I get:
FileNotFound :data/data/android.test/report.json open failed: EACCES (Permission denied).

Can you help me get reports for my tests?

Thanks,
Oana

Frieder Bluemle

unread,
Dec 6, 2013, 4:08:55 AM12/6/13
to cu...@googlegroups.com
Hi, access to /data/data/ requires a rooted device or you have to run the command using "run-as your.package.name", or an emulator.
You can try to write the reports to the sdcard instead like this:
@CucumberOptions(format = {"pretty", "html:/sdcard/android.test/cucumber-html", "json:/sdcard/android.test/report.json"}, features = "features")
adb pull /sdcard/android.test

Oana Rusu

unread,
Dec 27, 2013, 6:45:27 AM12/27/13
to cu...@googlegroups.com
Hi,

Thanks for the answer. It works now, but I am given an empty report. Do you know what may cause this?
The file is created on the device, but it is empty.

Thanks,
Oana

Jy Yang

unread,
Dec 27, 2013, 10:45:28 AM12/27/13
to cu...@googlegroups.com
It's a bug of cucumber android...when there's error during test execution, sometimes the test app ends before it writes the ending parts of the report file. As a result, they are not formatted well. For JSON report, it only flush to the file right before all test finishes, so if your test app ends due to error before that, it has nothing. But this is not always the case. In fact this rarely happens to me, so I am not sure what's the reliable way to reproduce this. If you can find it and post on the forum, it will help them fix the problem.

Oana Rusu於 2013年12月27日星期五UTC+8下午7時45分27秒寫道:

Oana Rusu

unread,
Dec 29, 2013, 6:12:01 AM12/29/13
to cu...@googlegroups.com
Hi,

Thanks for this. I always get the empty report, so I am not sure what may cause this.

Thanks,
Oana

aslak hellesoy

unread,
Dec 29, 2013, 6:33:26 AM12/29/13
to Cucumber Users
On Sun, Dec 29, 2013 at 11:12 AM, Oana Rusu <oana.r...@gmail.com> wrote:
Hi,

Thanks for this. I always get the empty report, so I am not sure what may cause this.


Like I said - there is a pending bugfix. This means that the bug has been identified, someone has submitted a proposed bugfix, but the fix has not yet been released.

Makes sense?

It's getting a little hard to follow this conversation. Could you please head over to http://cukes.info/posting-rules.html and learn about interleaved answers?

Thanks,
Aslak

--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
Message has been deleted
0 new messages