Codename One - Test Recorder: execute a test on a real device

牧云@^-^@ 提交于 2019-12-01 11:57:28

问题


In the developer guide of Codename One, it's written so: «Codename One includes a built in testing framework and test recorder tool as part of the simulator. This allows developers to build both functional and unit test execution on top of Codename One. It even enables sending tests for execution on the device (pro-only feature).»

Using a pro account, what are the steps to do a test on a real device?


回答1:


You need to set the build hint build.unitTest=1 which will build a version of the app that just executes the unit tests. This isn't as useful without continuous integration which is an enterprise feature...

To implement this you can do something like add a build target to your ant file:

<target name="test-for-ios-device" depends="clean,copy-ios-override,copy-libs,jar,clean-override">
    <codeNameOne 
        jarFile="${dist.jar}"
        displayName="${codename1.displayName}"
        packageName = "${codename1.packageName}"
        mainClassName = "${codename1.mainName}"
        version="${codename1.version}"
        icon="${codename1.icon}"
        vendor="${codename1.vendor}"
        subtitle="${codename1.secondaryTitle}"
        buildArgs="build.unitTest=1"
        targetType="iphone"
        certificate="${codename1.ios.debug.certificate}"
        certPassword="${codename1.ios.debug.certificatePassword}"
        provisioningProfile="${codename1.ios.debug.provision}"
        appid="${codename1.ios.appid}"
        />
</target>

With the enterprise version you can do a synchronized build, get the result then run it on devices using appium etc. We'll come up with a guide for that soon.



来源:https://stackoverflow.com/questions/47369441/codename-one-test-recorder-execute-a-test-on-a-real-device

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!