Package org.seleniumhq.selenium.fluent

Examples of org.seleniumhq.selenium.fluent.Monitor$Timer


public class CompositeMonitorTest {

    @Test
    public void onlyOneTimerIsStarted() {
        Monitor m1 = mock(Monitor.class);
        when(m1.start("foo")).thenReturn(new Monitor.Timer.NULL());
        Monitor m2 = mock(Monitor.class);
        Monitor.Timer t2 = mock(Monitor.Timer.class);
        when(m2.start("foo")).thenReturn(t2);
        Monitor m3 = mock(Monitor.class);
        when(m3.start("foo")).thenReturn(new Monitor.Timer.NULL());

        CompositeMonitor monitor = new CompositeMonitor(m1, m2, m3);
        Monitor.Timer chosenTimer = monitor.start("foo");

        assertThat(chosenTimer, equalTo(t2));
View Full Code Here


        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));
View Full Code Here

TOP

Related Classes of org.seleniumhq.selenium.fluent.Monitor$Timer

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.