Package org.jboss.arquillian.graphene.proxy

Examples of org.jboss.arquillian.graphene.proxy.GrapheneProxyInstance


        });
    }

    protected static WebElement findElement(GrapheneContext context, final GrapheneProxy.FutureTarget target) {
        final WebElement element = GrapheneProxy.getProxyForFutureTarget(context, target, WebElement.class, INTERFACES_PROXY_SHOULD_IMPLEMENET);
        final GrapheneProxyInstance elementProxy = (GrapheneProxyInstance) element;

        InterceptorBuilder b = new InterceptorBuilder();
        b.interceptInvocation(WrapsElement.class, new WrapsElementInterceptor(elementProxy)).getWrappedElement();

        elementProxy.registerInterceptor(b.build());
        elementProxy.registerInterceptor(new StaleElementInterceptor());
        elementProxy.registerInterceptor(new SearchContextInterceptor());
        return element;
    }
View Full Code Here


            throw new IllegalArgumentException("The paremeter [requestExpected] is null.");
        }
        if (target == null) {
            throw new IllegalArgumentException("The paremeter [target] is null.");
        }
        GrapheneProxyInstance proxy;
        if (GrapheneProxy.isProxyInstance(target)) {
            proxy = (GrapheneProxyInstance) ((GrapheneProxyInstance) target).copy();
        } else {
            proxy = (GrapheneProxyInstance) GrapheneProxy.getProxyForTarget(context, target);
        }
        proxy.registerInterceptor(new Interceptor() {
            @Override
            public Object intercept(InvocationContext context) throws Throwable {

                guard.clearRequestDone();
View Full Code Here

            LazyContext context = (LazyContext) LAZY_CONTEXTS.get().get(qualifier);
            if (context == null) {
                try {
                    context = new LazyContext(qualifier, new BrowserActions(qualifier.getName()));
                    context.handler = GrapheneContextualHandler.forFuture(context, context.getFutureTarget());
                    GrapheneProxyInstance proxy = (GrapheneProxyInstance) context.getWebDriver();
                    proxy.registerInterceptor(new SearchContextInterceptor());
                    proxy.registerInterceptor(new StaleElementInterceptor());
                    context.installatorProvider = new RemotePageExtensionInstallatorProvider(context.registry, (JavascriptExecutor) context.getWebDriver(JavascriptExecutor.class));
                    final GrapheneContext finalContext = context;
                    context.getBrowserActions().performAction(new Callable<Void>() {
                        @Override
                        public Void call() throws Exception {
View Full Code Here

            throw new IllegalArgumentException("The paremeter [requestExpected] is null.");
        }
        if (target == null) {
            throw new IllegalArgumentException("The paremeter [target] is null.");
        }
        GrapheneProxyInstance proxy;
        if (GrapheneProxy.isProxyInstance(target)) {
            proxy = (GrapheneProxyInstance) ((GrapheneProxyInstance) target).copy();
        } else {
            proxy = (GrapheneProxyInstance) GrapheneProxy.getProxyForTarget(target);
        }
        proxy.registerInterceptor(new Interceptor() {
            @Override
            public Object intercept(InvocationContext context) throws Throwable {
                RequestGuard guard = JSInterfaceFactory.create(RequestGuard.class);
                guard.clearRequestDone();
                Object result =  context.invoke();
View Full Code Here

            throw new IllegalArgumentException("The paremeter [requestExpected] is null.");
        }
        if (target == null) {
            throw new IllegalArgumentException("The paremeter [target] is null.");
        }
        GrapheneProxyInstance proxy;
        if (GrapheneProxy.isProxyInstance(target)) {
            proxy = (GrapheneProxyInstance) ((GrapheneProxyInstance) target).copy();
        } else {
            proxy = (GrapheneProxyInstance) GrapheneProxy.getProxyForTarget(target);
        }
        proxy.registerInterceptor(new Interceptor() {
            @Override
            public Object intercept(InvocationContext context) throws Throwable {

                guard.clearRequestDone();
View Full Code Here

    }

    protected static WebElement findElement(final GrapheneProxy.FutureTarget target) {
        final WebElement element = GrapheneProxy.getProxyForFutureTarget(target, WebElement.class, Locatable.class,
                WrapsElement.class);
        final GrapheneProxyInstance elementProxy = (GrapheneProxyInstance) element;

        InterceptorBuilder b = new InterceptorBuilder();
        b.interceptInvocation(WrapsElement.class, new WrapsElementInterceptor(elementProxy)).getWrappedElement();

        elementProxy.registerInterceptor(b.build());
        elementProxy.registerInterceptor(new StaleElementInterceptor());
        elementProxy.registerInterceptor(new SearchContextInterceptor());
        return element;
    }
View Full Code Here

     *
     * @return the instance of proxy to thread local context of WebDriver
     */
    public static WebDriver getProxy() {
        WebDriver webdriver = GrapheneProxy.getProxyForHandler(HANDLER.get(), null, WebDriver.class, JavascriptExecutor.class, HasInputDevices.class);
        GrapheneProxyInstance proxy = (GrapheneProxyInstance) webdriver;
        proxy.registerInterceptor(new SearchContextInterceptor());
        proxy.registerInterceptor(new StaleElementInterceptor());
        return webdriver;
    }
View Full Code Here

     *
     * @return the instance of proxy to thread local context of WebDriver
     */
    public static <T extends WebDriver> T getProxyForDriver(Class<T> webDriverImplClass, Class<?>... additionalInterfaces) {
        T webdriver = GrapheneProxy.<T>getProxyForHandler(HANDLER.get(), webDriverImplClass, additionalInterfaces);
        GrapheneProxyInstance proxy = (GrapheneProxyInstance) webdriver;
        proxy.registerInterceptor(new SearchContextInterceptor());
        proxy.registerInterceptor(new StaleElementInterceptor());
        return webdriver;
    }
View Full Code Here

     */

    public static <T> T getProxyForInterfaces(Class<?>... interfaces) {
        Class<?>[] interfacesIncludingWebdriver = GrapheneProxyUtil.concatClasses(interfaces, WebDriver.class);
        T webdriver = GrapheneProxy.<T>getProxyForHandler(HANDLER.get(), null, interfacesIncludingWebdriver);
        GrapheneProxyInstance proxy = (GrapheneProxyInstance) webdriver;
        proxy.registerInterceptor(new SearchContextInterceptor());
        proxy.registerInterceptor(new StaleElementInterceptor());
        return webdriver;
    }
View Full Code Here

TOP

Related Classes of org.jboss.arquillian.graphene.proxy.GrapheneProxyInstance

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.