Sha256: 3bacf4e9b9ed033712d423c57d292ed2cdabf8a3db179eb6da7698f6e384f7ad

Contents?: true

Size: 1.22 KB

Versions: 40

Compression:

Stored size: 1.22 KB

Contents

package sh.calaba.instrumentationbackend.actions.webview;


import sh.calaba.instrumentationbackend.InstrumentationBackend;
import sh.calaba.instrumentationbackend.Result;
import sh.calaba.instrumentationbackend.actions.Action;
import android.webkit.WebView;

public class DumpHtml implements Action {

    @Override
    public Result execute(String... args) {
    	                         
    	Result result = Result.successResult();
    	for (CalabashChromeClient ccc : CalabashChromeClient.findAndPrepareWebViews()) {
    		final WebView webView = ccc.getWebView();

            InstrumentationBackend.solo.getCurrentActivity().runOnUiThread(new Runnable() {
                @Override
                public void run() {

                    webView.loadUrl("javascript:(function() {" +
                               "prompt('calabash:' + document.body.parentNode.innerHTML);" +
                               "})()");
                }
            });
            String r = ccc.getResult();
            System.out.println("Html:");
            System.out.println("" + r);
            result.addBonusInformation(r);
        }

        return result;
    }

            @Override
    public String key() {
        return "dump_html";
    }
}

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
calabash-android-0.3.3.pre3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpHtml.java
calabash-android-0.3.3.pre2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpHtml.java
calabash-android-0.3.3.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpHtml.java
calabash-android-0.3.2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpHtml.java
calabash-android-0.3.2.pre5 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpHtml.java
calabash-android-0.3.2.pre4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpHtml.java
calabash-android-0.3.2.pre3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpHtml.java
calabash-android-0.3.2.pre2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpHtml.java
calabash-android-0.3.2.pre1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpHtml.java
calabash-android-0.3.1 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpHtml.java
calabash-android-0.3.0 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpHtml.java
calabash-android-0.3.0.pre10 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpHtml.java
calabash-android-0.3.0.pre9 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpHtml.java
calabash-android-0.3.0.pre8 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpHtml.java
calabash-android-0.3.0.pre7 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpHtml.java
calabash-android-0.3.0.pre6 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpHtml.java
calabash-android-0.3.0.pre5 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpHtml.java
calabash-android-0.3.0.pre4 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpHtml.java
calabash-android-0.3.0.pre3 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpHtml.java
calabash-android-0.3.0.pre2 test-server/instrumentation-backend/src/sh/calaba/instrumentationbackend/actions/webview/DumpHtml.java