Skip to content
This repository was archived by the owner on Apr 3, 2020. It is now read-only.

Cordova Unit Tests

Junmin edited this page Mar 7, 2014 · 23 revisions

How to Run

  • Pre-steps for both command line and Eclipse:

    Ensure an emulator or device is running.

    Navigate to xwalk_core_library, Run:

    $ android update project -p . -t android-19 --subprojects

    Navigate to the /test directory, Run:

    For 3.0.0 branch:

    $ android update project -p . -t android-17 --subprojects

    For 3.3.0 branch:

    $ android update project -p . -t android-19 --subprojects

    Copy assets in xwalk_core_library into assets of the test project.

  • Running from command line:

    $ ant debug install

    $ adb shell am instrument -w org.apache.cordova.test/android.test.InstrumentationTestRunner

  • Running from within Eclipse:

    File -> New -> Android Project from Existing Code

    Select the /test directory

    Right click the project, and select Debug As -> Android Project

    Right click the project, and select Debug As -> Android JUnit Project.

Note If the build the Unit test for 3.3.0 branch, please download the robotium-solo-4.0.jar from http://robotium.googlecode.com/files/robotium-solo-4.0.jar, and locate it under /test/libs.

Results

Test Case Result Note
BackButtonMultiPageTest 1/3 passed, 2 Failed testViaBackButtonOnLayout,testViaBackButtonOnView, testViaHref, testViaLoadUrl
CordovaActivityTest 3/4 passed testPauseAndResume (Fixed)
CordovaResourceApiTest 11/13 passed, 2 Failed testWebViewRequestIntercept, testWebViewWhiteListRejection
CordovaTest 2/2 passed
ErrorUrlTest 1/2 passed testUrl
GapClientTest 2/2 passed
HtmlNotFoundTest 1/2 passed testUrl (Fixed)
IFrameTest 0/2 passed testIframeDest, testIframeHistory (Fixed)
PluginManagerTest 2/2 passed
UserWebViewTest 2/2 passed
Clone this wiki locally