Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Testng] can't record video when extends class AbstractTestNGSpringContextTests #42

Open
mario8x opened this issue Sep 24, 2017 · 4 comments

Comments

@mario8x
Copy link

mario8x commented Sep 24, 2017

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

@mario8x mario8x changed the title Can't record video when extends class AbstractTestNGSpringContextTests [Testng] can't record video when extends class AbstractTestNGSpringContextTests Sep 24, 2017
@SergeyPirogov
Copy link
Owner

Hm, but I don't see that you applied VideoListener. See TestNG example from readme

@mario8x
Copy link
Author

mario8x commented Sep 24, 2017

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>

@SergeyPirogov
Copy link
Owner

Interesting case, need to look inside AbstractTestNGSpringContextTests and debug. I don't know why is it so.

@mario8x
Copy link
Author

mario8x commented Sep 24, 2017

I will add log for you immediately
test_with_abstract.log

@SergeyPirogov : please take a look at log file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants