video-recorder-java
video-recorder-java copied to clipboard
[Testng] can't record video when extends class `AbstractTestNGSpringContextTests`
Steps: I can't record video when implement a testng test as below:
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE)
@ContextConfiguration(classes = [AppConfig.class])
@TestExecutionListeners(PATestListener.class)
public class TestNgVideoTest extends AbstractTestNGSpringContextTests {
@Test
@Video
public void shouldFailAndCreateRecordWithTestName() {
Thread.sleep(1000);
assert false
}
@Test
@Video(name = "second_test")
public void videoShouldHaveNameSecondTest(){
Thread.sleep(1000);
assert true
}
}
But it will work as usual when i removing AbstractTestNGSpringContextTests
I implement this because i want to develop test for Spring application
Hm, but I don't see that you applied VideoListener. See TestNG example from readme
I just add VideoListener in testsuite.xml file as below or i add Listeners annotation as example. The result will be the same:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Automated test example">
<listeners>
<listener class-name="com.automation.remarks.testng.VideoListener"></listener>
</listeners>
<test name="Verify test video recording">
<classes>
<class name="vn.kms.ktaf.patest.tests.TestNgVideoTest">
<methods>
<include name="shouldFailAndCreateRecordWithTestName"></include>
<include name="videoShouldHaveNameSecondTest">
</include>
</methods>
</class>
</classes>
</test>
</suite>
Interesting case, need to look inside AbstractTestNGSpringContextTests and debug. I don't know why is it so.
I will add log for you immediately test_with_abstract.log
@SergeyPirogov : please take a look at log file