Skip to content

Commit 5d3c2a6

Browse files
committed
chore: update screenshots usage
1 parent fca6aac commit 5d3c2a6

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

app/src/androidTest/java/com/sample/browserstack/samplecalculator/EnsureOperationTests.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,6 @@ public void setUp() {
3535
mainActivity = activityRule.getActivity();
3636
}
3737

38-
void childScreenshotMethod(String screenshotName) {
39-
NativeScreenshot.capture(screenshotName);
40-
}
41-
42-
void parentScreenshotMethod(String screenshotName) {
43-
childScreenshotMethod(screenshotName);
44-
}
45-
4638
@Test
4739
public void ensureAdditionWorks() {
4840
onView(withId(R.id.buttonOne)).perform(click());
@@ -57,7 +49,6 @@ public void ensureAdditionWorks() {
5749

5850
@Test
5951
public void ensureSubtractionWorks() {
60-
NativeScreenshot.capture("pre_subtraction");
6152
onView(withId(R.id.buttonTwo)).perform(click());
6253
onView(withId(R.id.buttonTwo)).perform(click());
6354
onView(withId(R.id.buttonSubtract)).perform(click());
@@ -77,7 +68,7 @@ public void ensureMultiplicationWorks() {
7768
onView(withId(R.id.buttonEqual)).perform(click());
7869
onView(withId(R.id.editText)).check(matches(withText("60")));
7970

80-
childScreenshotMethod("post_multiplication");
71+
NativeScreenshot.capture("post_multiplication");
8172
}
8273

8374
@Test
@@ -89,6 +80,6 @@ public void ensureDivisionWorks() {
8980
onView(withId(R.id.buttonEqual)).perform(click());
9081
onView(withId(R.id.editText)).check(matches(withText("4")));
9182

92-
parentScreenshotMethod("post_division");
83+
NativeScreenshot.capture("post_division");
9384
}
9485
}

app/src/androidTest/java/com/sample/browserstack/samplecalculator/NativeScreenshot.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public final class NativeScreenshot {
2121
private NativeScreenshot() {}
2222

2323
/**
24-
* Captures screenshot using Android Screenshot library and stores in the filesystem.
24+
* Captures screenshot using Androidx Screenshot library and stores in the filesystem.
2525
* Special Cases:
2626
* If the screenshotName contains spaces or does not pass validation, the corresponding
2727
* screenshot is not visible on BrowserStack's Dashboard.

0 commit comments

Comments
 (0)