Package org.arquillian.extension.recorder.screenshooter.event

Examples of org.arquillian.extension.recorder.screenshooter.event.ScreenshooterExtensionConfigured


    @Test
    public void takeAfterTestTrueScreenshotMethodTest() throws Exception {

        Mockito.when(configuration.getTakeAfterTest()).thenReturn(false); // false in config

        fire(new ScreenshooterExtensionConfigured());

        initRecorderStrategyRegister();

        // true in annotation
        fire(new Before(FakeAnnotatedClass.class, FakeAnnotatedClass.class.getMethod("takeAfterTestMethod")));
View Full Code Here


    @Test
    public void takeWhenTestFailedTrueScreenshotMethodTest() throws Exception {

        Mockito.when(configuration.getTakeWhenTestFailed()).thenReturn(false); // false in config

        fire(new ScreenshooterExtensionConfigured());

        initRecorderStrategyRegister();

        // true in annotation
        fire(new Before(FakeAnnotatedClass.class, FakeAnnotatedClass.class.getMethod("takeWhenTestFailedMethod")));
View Full Code Here

    }

    @Test
    public void strategyCreatorTest() {
        fire(new ArquillianDescriptorImpl("arquillian.xml"));
        fire(new ScreenshooterExtensionConfigured());

        ScreenshooterConfiguration configuration = getManager().getContext(ApplicationContext.class)
            .getObjectStore()
            .get(ScreenshooterConfiguration.class);
View Full Code Here

    @Test
    public void beforeTestEventTakeBeforeTestFalse() throws Exception {

        Mockito.when(configuration.getTakeBeforeTest()).thenReturn(false);

        fire(new ScreenshooterExtensionConfigured());
        fire(new Before(FakeTestClass.class, FakeTestClass.class.getMethod("fakeTest")));

        assertEventFired(BeforeScreenshotTaken.class, 0);
        assertEventFired(TakeScreenshot.class, 0);
        assertEventFired(AfterScreenshotTaken.class, 0);
View Full Code Here

    public void beforeTestEventTakeBeforeTestTrue() throws Exception {

        Mockito.when(configuration.getTakeBeforeTest()).thenReturn(true);
        Mockito.when(configuration.getScreenshotType()).thenReturn("PNG");

        fire(new ScreenshooterExtensionConfigured());
        fire(new Before(FakeTestClass.class, FakeTestClass.class.getMethod("fakeTest")));

        assertEventFired(BeforeScreenshotTaken.class, 1);
        assertEventFired(TakeScreenshot.class, 1);
        assertEventFired(AfterScreenshotTaken.class, 1);
View Full Code Here

    public void afterTestEventTakeAfterTestTrue() throws Exception {

        Mockito.when(configuration.getTakeAfterTest()).thenReturn(true);
        Mockito.when(configuration.getScreenshotType()).thenReturn("PNG");

        fire(new ScreenshooterExtensionConfigured());
        fire(new Before(FakeTestClass.class, FakeTestClass.class.getMethod("fakeTest")));

        bind(TestScoped.class, TestResult.class, new TestResult(Status.PASSED));

        fire(new After(FakeTestClass.class, FakeTestClass.class.getMethod("fakeTest")));
View Full Code Here

        Mockito.when(configuration.getTakeAfterTest()).thenReturn(true);
        Mockito.when(configuration.getScreenshotType()).thenReturn("PNG");
        Mockito.when(configuration.getTakeWhenTestFailed()).thenReturn(false);

        fire(new ScreenshooterExtensionConfigured());
        fire(new Before(FakeTestClass.class, FakeTestClass.class.getMethod("fakeTest")));

        bind(TestScoped.class, TestResult.class, new TestResult(Status.FAILED));

        fire(new After(FakeTestClass.class, FakeTestClass.class.getMethod("fakeTest")));
View Full Code Here

        Mockito.when(configuration.getTakeAfterTest()).thenReturn(true);
        Mockito.when(configuration.getScreenshotType()).thenReturn("PNG");
        Mockito.when(configuration.getTakeWhenTestFailed()).thenReturn(true);

        fire(new ScreenshooterExtensionConfigured());
        fire(new Before(FakeTestClass.class, FakeTestClass.class.getMethod("fakeTest")));

        bind(TestScoped.class, TestResult.class, new TestResult(Status.FAILED));

        fire(new After(FakeTestClass.class, FakeTestClass.class.getMethod("fakeTest")));
View Full Code Here

    public void afterTestEventTestStatusPassed() throws Exception {

        Mockito.when(configuration.getTakeAfterTest()).thenReturn(true);
        Mockito.when(configuration.getScreenshotType()).thenReturn("PNG");

        fire(new ScreenshooterExtensionConfigured());
        fire(new Before(FakeTestClass.class, FakeTestClass.class.getMethod("fakeTest")));

        bind(TestScoped.class, TestResult.class, new TestResult(Status.PASSED));

        fire(new After(FakeTestClass.class, FakeTestClass.class.getMethod("fakeTest")));
View Full Code Here

TOP

Related Classes of org.arquillian.extension.recorder.screenshooter.event.ScreenshooterExtensionConfigured

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.