mauriciotogneri / green-coffee

Green Coffee
MIT License
231 stars 21 forks source link

JUnit rule instead of extending GreenCoffeeTest #8

Closed tomkoptel closed 7 years ago

tomkoptel commented 7 years ago

Hello @mauriciotogneri !

Thank you for great lib :)

I am wondering if we can make use of JUnit rule?

public class DownloadsActivityTest {
  @Rule public GreenCoffeeRule rule = new GreenCoffeeRule(
      new GreenCoffeeConfig(Environment.DIRECTORY_DOWNLOADS)
                .withFeatureFromAssets("assets/my_case.feature")
                .scenarios());

  @Test
  public void test() {
     rule.start(steps);
  }
}
mauriciotogneri commented 7 years ago

Hi @tomkoptel, I'm glad you like the library.

Your approach looks interesting, but how do I launch the Activity that I want to test?

mauriciotogneri commented 7 years ago

Hi @tomkoptel, could you take a look at it?