[JVM][Android][Espresso] Howto get cucumber reports

437 views
Skip to first unread message

Stabilitron Kanifolev

unread,
Dec 9, 2014, 7:36:36 PM12/9/14
to cu...@googlegroups.com
Hi everyone!

I try to use Cucumber with Espresso. I use this InstrumentationTestRunner.  And it works (i can run test from AndroidStudio and see some result), but i can't get reports from device.  

public class EspressoInstrumentation extends GoogleInstrumentationTestRunner {
    private CucumberInstrumentationHelper helper = new CucumberInstrumentationHelper(this);

    @Override
    public void onCreate(Bundle arguments) {
        helper.onCreate(arguments);
        super.onCreate(arguments);
    }

    @Override
    public void onStart() {
        helper.onStart();
    }
}

I use that annotation

@CucumberOptions(format = {"pretty","html:/data/data/com.example.myapplication/report"},features = "features")
public class CucumberActivitySteps extends ActivityInstrumentationTestCase2<MainActivity> 

and expect to receive report with command

adb pull /data/data/com.example.myapplication cucumber-report-android

But there is no any files.

I should call some methods from runner on finish or something?

I use gradle.


Sebas Ranga

unread,
Sep 1, 2015, 3:16:56 PM9/1/15
to Cukes
The folder where you place the results needs to exist already in the device by the time the tests are actually executed.

In your example the folder /data/data/com.example.myapplication/ should be created correctly but the probably the report folder does not exist on the device, unless you manually create it.

Björn Rasmusson

unread,
Sep 2, 2015, 2:15:20 AM9/2/15
to Cukes
Hi,

According to my limited experience it is possible to use adb pull to access /data/data/<app>/ on an emulator, but I have not been able to do it on an actual device.
On an actual device a I have only been able to use adb pull to access files, like cucumber reports, placed on the sdcard.

Regards
Björn
 
Reply all
Reply to author
Forward
Message has been deleted
0 new messages