Skip to content

Commit 2cf86c4

Browse files
Indentations
1 parent 0700b4d commit 2cf86c4

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

app/src/androidTest/java/com/saucelabs/mydemoapp/android/screenshot/SauceLabsCustomScreenshot.java

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,42 +13,42 @@
1313

1414
public class SauceLabsCustomScreenshot {
1515

16-
private static final AtomicInteger screenshotId = new AtomicInteger(1);
16+
private static final AtomicInteger screenshotId = new AtomicInteger(1);
1717

18-
public static void capture(String screenshotName) {
19-
try {
20-
screenshotName = String.format("%04d-%s", screenshotId.getAndIncrement(), screenshotName);
18+
public static void capture(String screenshotName) {
19+
try {
20+
screenshotName = String.format("%04d-%s", screenshotId.getAndIncrement(), screenshotName);
2121

22-
ScreenCapture capture = Screenshot.capture();
23-
capture.setFormat(Bitmap.CompressFormat.PNG);
24-
capture.setName(screenshotName);
22+
ScreenCapture capture = Screenshot.capture();
23+
capture.setFormat(Bitmap.CompressFormat.PNG);
24+
capture.setName(screenshotName);
2525

26-
SauceLabsScreenCaptureProcessor processor = new SauceLabsScreenCaptureProcessor();
27-
processor.process(capture);
26+
SauceLabsScreenCaptureProcessor processor = new SauceLabsScreenCaptureProcessor();
27+
processor.process(capture);
2828

29-
String savedScreenshotPath = new File(processor.getPathForFile(screenshotName) + ".png").getPath();
29+
String savedScreenshotPath = new File(processor.getPathForFile(screenshotName) + ".png").getPath();
3030

31-
Log.i("SauceLabs", String.format("Screenshot saved to %s", savedScreenshotPath));
32-
} catch (Exception e) {
33-
Log.e("SauceLabs", "Failed to capture screenshot", e);
34-
}
35-
}
31+
Log.i("SauceLabs", String.format("Screenshot saved to %s", savedScreenshotPath));
32+
} catch (Exception e) {
33+
Log.e("SauceLabs", "Failed to capture screenshot", e);
34+
}
35+
}
3636

37-
private static class SauceLabsScreenCaptureProcessor extends BasicScreenCaptureProcessor {
37+
private static class SauceLabsScreenCaptureProcessor extends BasicScreenCaptureProcessor {
3838

39-
private static final String SAUCE_LABS_CUSTOM_SCREENSHOTS = "sauce_labs_custom_screenshots";
39+
private static final String SAUCE_LABS_CUSTOM_SCREENSHOTS = "sauce_labs_custom_screenshots";
4040

41-
public SauceLabsScreenCaptureProcessor() {
42-
super();
41+
public SauceLabsScreenCaptureProcessor() {
42+
super();
4343

44-
File downloadsDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
45-
File screenshotsDir = new File(downloadsDir, SAUCE_LABS_CUSTOM_SCREENSHOTS);
46-
this.mDefaultScreenshotPath = screenshotsDir;
47-
}
44+
File downloadsDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
45+
File screenshotsDir = new File(downloadsDir, SAUCE_LABS_CUSTOM_SCREENSHOTS);
46+
this.mDefaultScreenshotPath = screenshotsDir;
47+
}
4848

49-
public String getPathForFile(String name) {
50-
File file = new File(mDefaultScreenshotPath, getFilename(name));
51-
return file.getAbsolutePath();
52-
}
53-
}
49+
public String getPathForFile(String name) {
50+
File file = new File(mDefaultScreenshotPath, getFilename(name));
51+
return file.getAbsolutePath();
52+
}
53+
}
5454
}

0 commit comments

Comments
 (0)