Skip to content

Commit

Permalink
fix video render and attach to report portal
Browse files Browse the repository at this point in the history
  • Loading branch information
saikrishna321 committed Jul 1, 2019
1 parent 1a3ffc5 commit b4cef91
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -151,7 +151,7 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.14.3</version>
<version>6.11</version>
</dependency>
<dependency>
<groupId>org.im4java</groupId>
Expand Down
11 changes: 9 additions & 2 deletions src/main/java/com/video/recorder/AppiumScreenRecorder.java
Expand Up @@ -18,9 +18,9 @@ public class AppiumScreenRecorder extends Helpers implements IScreenRecord {
@Override
public void stopVideoRecording(String className, String methodName,
String videoFileName) throws IOException {
String videoPath = System.getProperty("user.dir");
if (AppiumDeviceManager.getMobilePlatform()
.equals(MobilePlatform.IOS)) {
String videoPath = System.getProperty("user.dir");
String videoLocationIOS =
videoPath + FileLocations.IOS_SCREENSHOTS_DIRECTORY
+ AppiumDeviceManager.getAppiumDevice().getDevice().getUdid()
Expand All @@ -30,7 +30,14 @@ public void stopVideoRecording(String className, String methodName,
String base64 = ((IOSDriver) AppiumDriverManager.getDriver()).stopRecordingScreen();
saveVideo(base64, videoLocationIOS);
} else {
((AndroidDriver) AppiumDriverManager.getDriver()).stopRecordingScreen();
String videoLocationIOS =
videoPath + FileLocations.ANDROID_SCREENSHOTS_DIRECTORY
+ AppiumDeviceManager.getAppiumDevice().getDevice().getUdid()
+ "/" + getCurrentTestClassName()
+ "/" + getCurrentTestMethodName()
+ "/" + getCurrentTestMethodName() + ".mp4";
String base64 = ((AndroidDriver) AppiumDriverManager.getDriver()).stopRecordingScreen();
saveVideo(base64, videoLocationIOS);
}
}

Expand Down

0 comments on commit b4cef91

Please sign in to comment.