Package org.seleniumhq.selenium.fluent.internal

Examples of org.seleniumhq.selenium.fluent.internal.Context


        }
    }

    @Test
    public void stringShouldNotRegexMatchSomethingEvenIfThereAreNewlines() {
        Context ctx = Context.singular(null, "dummy2");
        try {
            new TestableString(MARY_EXECUTION_WITH_NEWLINES, ctx, new Monitor.NULL()).shouldNotMatch("(.*)12(.*)");
        } catch (FluentExecutionStopped e) {
            assertThat(e.getMessage(), equalTo("AssertionError during invocation of: ?.dummy2().shouldNotMatch('(.*)12(.*)')"));
            String causeMessage = getCauseMessage(e);
View Full Code Here


    }


    @Test
    public void stringShouldRegexMatchSomethingWithinSomeTime() {
        Context ctx = Context.singular(null, "dummy2");
        new TestableString(MARY_EXECUTION, ctx, new Monitor.NULL()).within(secs(1)).shouldMatch(".* Has \\d\\d.*");
        try {
            new TestableString(MARY_EXECUTION, ctx, new Monitor.NULL()).within(secs(1)).shouldMatch(".* blort \\d\\d.*");
            fail("should have barfed");
        } catch (FluentExecutionStopped e) {
View Full Code Here

        }
    }

    @Test
    public void stringShouldNotRegexMatchSomethingWithinSomeTime() {
        Context ctx = Context.singular(null, "dummy2");
        new TestableString(MARY_EXECUTION, ctx, new Monitor.NULL()).within(secs(1)).shouldNotMatch(".* blort \\d\\d.*");
        try {
            new TestableString(MARY_EXECUTION, ctx, new Monitor.NULL()).within(secs(1)).shouldNotMatch(".* Has \\d\\d.*");
            fail("should have barfed");
        } catch (FluentExecutionStopped e) {
View Full Code Here

    public void can_be_true() {

        Execution<Boolean> exTrue = mock(Execution.class);
        when(exTrue.doExecution()).thenReturn(true);

        Context ctx = Context.singular(null, "dummy");
        TestableValue<Boolean> wev = new TestableValue<Boolean>(exTrue, ctx, new Monitor.NULL());

        TestableValue<Boolean> foo = wev.shouldBe(true);
        assertEquals(true, foo.value());
        foo = wev.shouldNotBe(false);
View Full Code Here

    public void can_be_false() {

        Execution<Boolean> exFalse = mock(Execution.class);
        when(exFalse.doExecution()).thenReturn(false);

        Context ctx = Context.singular(null, "dummy");
        TestableValue<Boolean> wev = new TestableValue<Boolean>(exFalse, ctx, new Monitor.NULL());

        TestableValue<Boolean> foo = wev.shouldBe(false);
        assertEquals(false, foo.value());
        foo = wev.shouldNotBe(true);
View Full Code Here

        Execution<Boolean> exFalse = mock(Execution.class);
        when(exFalse.doExecution()).thenReturn(false);
        when(exFalse.doExecution()).thenReturn(true);

        Context ctx = Context.singular(null, "dummy");
        TestableValue<Boolean> wev = new TestableValue<Boolean>(exFalse, ctx, new Monitor.NULL());

        TestableValue<Boolean> foo = wev.within(millis(100)).shouldBe(true);
        assertEquals(true, foo.value());
View Full Code Here

    @Test
    public void assertionError_should_be_wrapped_in_context_exception() {

        try {
            Context dummy_context = Context.singular(null, "dummy");
            fc.executeAndWrapReThrowIfNeeded(new Execution() {
                public Void execute() {
                    throw new AssertionError("Oops");
                }
            }, null, dummy_context, true);
View Full Code Here

    @Test
    public void testAllTheMethods() throws IllegalAccessException, InvocationTargetException {
        WebDriver wd = mock(WebDriver.class);
        Monitor m = new Monitor.NULL();
        Context c = Context.singular(null, "y");
        By byID = By.id("foo");

        FluentWebDriver.BooleanResultsAdapter bwa = new FluentWebDriver.BooleanResultsAdapter(wd, m, c);

        int count = 0;
View Full Code Here

    private FluentWebElements setUp() {
        WebDriver wd = mock(WebDriver.class);

        List<FluentWebElement> elems = asList(mock(FluentWebElement.class), mock(FluentWebElement.class));
        Context ctx = Context.singular(null, "x");
        return new FluentWebElements(wd, elems, ctx, new Monitor.NULL(), false);
    }
View Full Code Here

TOP

Related Classes of org.seleniumhq.selenium.fluent.internal.Context

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.