@RunWith(AndroidJUnit4.class)
public class FirstScreenShootTest {
@ClassRule
public static final LocaleTestRule localeTestRule = new LocaleTestRule();
@Rule
public ActivityTestRule<SomeActivity> activityRule = new ActivityTestRule<>(SomeActivity.class);
@BeforeClass
public static void setupClass() {
Screengrab.setDefaultScreenshotStrategy(new UiAutomatorScreenshotStrategy());
}
@AfterClass
public static void tearDownClass() throws Exception {
// Code executed after the last test method
}
@Before
public void setup() {
}
@After
public void tearDown() {
}
@Test
public void testTakeScreenshot() {
Screengrab.screenshot("file_name");
onView(withId(R.id.fab)).perform(click());
Screengrab.screenshot("after_click_screen_shot_file_name");
}
}
Add a task for automated screenshots
Context
With this task, the PlayStore listing will be localized for each supported language/city
This can be a simple step of the CI pipeline #19
References
Test class example: