Package org.seleniumhq.selenium.fluent.internal

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


    protected final List<WebElement> actualFindElements(By by, Context ctx) {
        return null;
    }

    public FluentWebElements filter(final FluentMatcher matcher) {
        Context ctx = Context.singular(context, "filter", null, matcher);
        return makeFluentWebElements(executeAndWrapReThrowIfNeeded(new FilterMatches(matcher), ctx), ctx, monitor);
    }
View Full Code Here


        Context ctx = Context.singular(context, "filter", null, matcher);
        return makeFluentWebElements(executeAndWrapReThrowIfNeeded(new FilterMatches(matcher), ctx), ctx, monitor);
    }

    public FluentWebElement first(final FluentMatcher matcher) {
        Context ctx = Context.singular(context, "first", null, matcher);
        return executeAndWrapReThrowIfNeeded(new MatchesFirst(matcher), ctx);
    }
View Full Code Here

            return newFluentWebElements(multiple(tagName("span"), "span"));
        }

        protected BaseFluentWebElements newFluentWebElements(MultipleResult multiple) {
            List<WebElement> result = multiple.getResult();
            Context ctx = multiple.getCtx();
            List<FluentWebElement> elems = new ArrayList<FluentWebElement>();
            for (WebElement aResult : result) {
                elems.add(new FluentWebElement(delegate, new WebElementHolder(null, aResult, null), ctx, monitor, booleanInsteadOfNotFoundException));
            }
            return new FluentWebElements(delegate, elems, ctx, monitor, booleanInsteadOfNotFoundException);
View Full Code Here

            return new FluentWebElement(delegate, result, context, monitor, booleanInsteadOfNotFoundException);
        }

        public TestableString url() {
            Execution<String> execution = new CurrentUrl();
            Context ctx = Context.singular(context, "url");
            return new TestableString(execution, ctx, monitor).within(getPeriod());
        }
View Full Code Here

            return null;
        }

        public TestableString title() {
            Execution<String> execution = new GetTitle();
            Context ctx = Context.singular(context, "title");
            return new TestableString(execution, ctx, monitor).within(getPeriod());
        }
View Full Code Here

        protected abstract List<WebElement> findElements(By by, Context ctx);

        private SingleResult single(final By by, final String tagName) {
            final By by2 = fixupBy(by, tagName);
            Context ctx = contextualize(by, tagName);
            final WebElementHolder result;
            try {
                changeTimeout();
                FindElement execution = new FindElement(by2, tagName, ctx, getSearchContext());
                WebElement found = executeAndWrapReThrowIfNeeded(execution, null, ctx, true);
View Full Code Here

        }

        private MultipleResult multiple(By by, final String tagName) {
            final By by2 = fixupBy(by, tagName);
            final List<WebElement> result;
            Context ctx = Context.plural(context, tagName, by);
            try {
                changeTimeout();
                FindElements execution = new FindElements(by2, tagName, ctx);
                result = executeAndWrapReThrowIfNeeded(execution, null, ctx, true);
            } finally {
View Full Code Here

        }
    };

    @Test
    public void stringShouldBeSomething() {
        Context ctx = Context.singular(null, "dummy2");
        new TestableString(FOO_EXECUTION, ctx, new Monitor.NULL()).shouldBe("foo");
        try {
            new TestableString(FOO_EXECUTION, ctx, new Monitor.NULL()).shouldBe("bar");
            fail("should have barfed");
        } catch (FluentExecutionStopped e) {
View Full Code Here

        }
    }

    @Test
    public void stringShouldBeSomethingWithinSomeTime() {
        Context ctx = Context.singular(null, "dummy2");
        new TestableString(FOO_EXECUTION, ctx, new Monitor.NULL()).within(secs(1)).shouldBe("foo");
        try {
            new TestableString(FOO_EXECUTION, ctx, new Monitor.NULL()).within(secs(1)).shouldBe("bar");
            fail("should have barfed");
        } catch (FluentExecutionStopped e) {
View Full Code Here

        }
    }

    @Test
    public void unsupportedOperationExceptionShouldBeReThrownAsIs() {
        Context ctx = Context.singular(null, "dummy2");
        try {
            new TestableString(new Execution<String>() {
                public String execute() {
                    throw new UnsupportedOperationException("oops");
                }
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.