Package org.seleniumhq.selenium.fluent

Examples of org.seleniumhq.selenium.fluent.FluentExecutionStopped


        assertThat(chosenTimer, equalTo(t2));
    }

    @Test
    public void allAreVisitedWithExceptionAndLastExceptionIsReturned() {
        FluentExecutionStopped boo = new FluentExecutionStopped("boo", null);
        FluentExecutionStopped boo2 = new FluentExecutionStopped("boo2", null);

        WebElement we = mock(WebElement.class);

        Monitor m1 = mock(Monitor.class);
        when(m1.exceptionDuringExecution(boo, we)).thenReturn(boo);
        Monitor m2 = mock(Monitor.class);
        when(m2.exceptionDuringExecution(boo, we)).thenReturn(boo);
        Monitor m3 = mock(Monitor.class);
        when(m3.exceptionDuringExecution(boo, we)).thenReturn(boo2);

        CompositeMonitor monitor = new CompositeMonitor(m1, m2, m3);
        FluentExecutionStopped newException = monitor.exceptionDuringExecution(boo, we);

        assertThat(newException, equalTo(boo2));

        verify(m1).exceptionDuringExecution(boo, we);
        verify(m2).exceptionDuringExecution(boo, we);
View Full Code Here


        file.deleteOnExit();
        when(ts.getScreenshotAs(OutputType.FILE)).thenReturn(file);

        ScreenShotOnError ssoe = new ScreenShotOnError(ts, ScreenShotOnErrorTest.class, "target/test-classes/", "target/");
        ssoe.setContext("baz");
        FluentExecutionStopped boo = new FluentExecutionStopped("boo", null);
        FluentExecutionStopped bar = ssoe.exceptionDuringExecution(boo, null);
        assertThat(bar, equalTo(boo));

        assertThat(new File("target/baz_screenshot.png").exists(), equalTo(true));

    }
View Full Code Here

        }
        return monitors[0].start(item);
    }

    public FluentExecutionStopped exceptionDuringExecution(FluentExecutionStopped ex, WebElement webElement) {
        FluentExecutionStopped rv = ex;
        for (Monitor monitor : monitors) {
            rv = monitor.exceptionDuringExecution(rv, webElement);
        }
        return rv;
    }
View Full Code Here

TOP

Related Classes of org.seleniumhq.selenium.fluent.FluentExecutionStopped

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.