Skip to content

Commit

Permalink
add back in report helper
Browse files Browse the repository at this point in the history
  • Loading branch information
laves committed Feb 14, 2024
1 parent f05637c commit e74ff3b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@

import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.microsoft.appcenter.espresso.Factory;
import com.microsoft.appcenter.espresso.ReportHelper;

import org.junit.After;
import org.junit.Before;
import org.junit.Rule;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
Expand All @@ -34,6 +38,9 @@

public class BaseTest {

@Rule
public ReportHelper reportHelper = Factory.getReportHelper();

Context testContext;
Context appContext;
AssetManager assetManager;
Expand Down Expand Up @@ -63,6 +70,11 @@ public void Setup() throws Exception {
accessKey = appContext.getString(R.string.pvTestingAccessKey);
}

@After
public void TearDown() {
reportHelper.label("Stopping App");
}

public static String[] getModelFiles() {
Context context = InstrumentationRegistry.getInstrumentation().getTargetContext();
String resPath = new File(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
import androidx.test.ext.junit.rules.ActivityScenarioRule;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import com.microsoft.appcenter.espresso.Factory;
import com.microsoft.appcenter.espresso.ReportHelper;

import org.hamcrest.Matcher;
import org.junit.After;
import org.junit.Before;
Expand Down Expand Up @@ -83,6 +86,9 @@ public void perform(UiController uiController, View view) {
@RunWith(AndroidJUnit4.class)
public class IntegrationTest {

@Rule
public ReportHelper reportHelper = Factory.getReportHelper();

@Rule
public ActivityScenarioRule<MainActivity> activityScenarioRule =
new ActivityScenarioRule<>(MainActivity.class);
Expand All @@ -97,6 +103,11 @@ public void intentsTeardown() {
Intents.release();
}

@After
public void TearDown() {
reportHelper.label("Stopping App");
}

@Test
public void testOrca() {
onView(withId(R.id.testButton)).perform(click());
Expand Down

0 comments on commit e74ff3b

Please sign in to comment.