Closed ysparrow closed 8 years ago
I'm not sure if it should be added as a library listener, by you can easily create SuiteVideoListener see code below:
package com.automation.remarks.testng;
import com.automation.remarks.video.RecorderFactory;
import com.automation.remarks.video.recorder.IVideoRecorder;
import com.automation.remarks.video.recorder.VideoRecorder;
import org.testng.ISuite;
import org.testng.ISuiteListener;
/**
* Created by sergey on 03.10.16.
*/
public class SuiteVideoListener implements ISuiteListener {
private IVideoRecorder recorder;
@Override
public void onStart(ISuite suite) {
if (VideoRecorder.conf().isVideoEnabled()) {
recorder = RecorderFactory.getRecorder();
recorder.start();
}
}
@Override
public void onFinish(ISuite suite) {
if (recorder != null) {
recorder.stopAndSave(suite.getName());
}
}
}
Thanks that's what we need ))
It would be nice to have configurable feature to record not only methods annotated with @Test, but also a whole test suite in one video file. Our test project has deep inheritance hierarchy with @Before/@After methods in each inherited class, and it is vital to have video for all those before/after activities also.