Discussion:
[Cucumber] [JVM] [Android] [Espresso] Howto build reports
Stabilitron Kanifolev
2014-12-10 00:25:19 UTC
Permalink
Hi everyone=)

I try to use Cucumber with Espresso. I use this InstrumentationTestRunner

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();
}
}

and it works (i can run test from ide and see some result), but i can't get
reports.

I use that annotation for steps class

@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 get response from console "0 files pulled. 0
files skipped.").

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

I use gradle.
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Stabilitron Kanifolev
2014-12-12 20:43:51 UTC
Permalink
Have anyone some example project of using Cucumber with Espresso or only with custom InstrumentationRunner with CucumberInstrumentationCore? I really want to get bdd with android works.
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Björn Rasmusson
2014-12-14 10:27:44 UTC
Permalink
Post by Stabilitron Kanifolev
Hi everyone=)
I try to use Cucumber with Espresso. I use this InstrumentationTestRunner
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();
}
}
and it works (i can run test from ide and see some result), but i can't
get reports.
I use that annotation for steps class
@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 get response from console "0 files pulled. 0
files skipped.").
I should call some methods from runner on finish or something?
I use gradle.
Hi,

I did some experimentation with the https://github.com/cucumber/cucumber-jvm/tree/master/examples/android/cukeulator-test
modified to use Espresso according to the setup above (with maven, and
executed on emulator).

Then I got reports generated successfully. In case of the html-formatter,
running the command:
adb pull /data/data/cucumber.example.android.cukeulator report-files
afterwards generated the response:
6 files pulled. 0 files skipped.
(the interesting file is this case is:
/data/data/cucumber.example.android.cukeulator/report/report.js, which
contains the specific data for this test run, the other files are identical
for all test runs).

Best Regards
Björn
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...