feat: patrol on-device integration smoke test
This commit is contained in:
parent
d6f4c434fa
commit
6f6fa20b58
10 changed files with 466 additions and 6 deletions
|
|
@ -0,0 +1,38 @@
|
|||
package com.app.smol_mail.integration;
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
import org.junit.runners.Parameterized.Parameters;
|
||||
import pl.leancode.patrol.PatrolJUnitRunner;
|
||||
|
||||
// The Patrol host class: each Dart test in the integration_test directory is
|
||||
// executed through this JUnit suite. Its package is the flavored applicationId
|
||||
// (com.app.smol_mail + .integration suffix); the namespace differs, so
|
||||
// MainActivity needs the explicit import below.
|
||||
@RunWith(Parameterized.class)
|
||||
public class MainActivityTest {
|
||||
|
||||
@Parameters(name = "{0}")
|
||||
public static Object[] testCases() {
|
||||
PatrolJUnitRunner instrumentation =
|
||||
(PatrolJUnitRunner) InstrumentationRegistry.getInstrumentation();
|
||||
instrumentation.setUp(com.example.smol_mail.MainActivity.class);
|
||||
instrumentation.waitForPatrolAppService();
|
||||
return instrumentation.listDartTests();
|
||||
}
|
||||
|
||||
public MainActivityTest(String dartTestName) {
|
||||
this.dartTestName = dartTestName;
|
||||
}
|
||||
|
||||
private final String dartTestName;
|
||||
|
||||
@Test
|
||||
public void runDartTest() {
|
||||
PatrolJUnitRunner instrumentation =
|
||||
(PatrolJUnitRunner) InstrumentationRegistry.getInstrumentation();
|
||||
instrumentation.runDartTest(dartTestName);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue