From b1ba2e8ad79f0ef2fce2f3a13a48b2a2516f9caa Mon Sep 17 00:00:00 2001 From: swordstream Date: Mon, 21 Aug 2017 01:01:41 +0800 Subject: [PATCH] revise the format of doc --- .../android_coverage_cn.md | 10 +++++----- .../writing-running-appium/android_coverage.md | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/cn/writing-running-appium/android_coverage_cn.md b/docs/cn/writing-running-appium/android_coverage_cn.md index a256911c0..8918011b6 100644 --- a/docs/cn/writing-running-appium/android_coverage_cn.md +++ b/docs/cn/writing-running-appium/android_coverage_cn.md @@ -16,11 +16,11 @@ src/main/java/com/example/pkg ``` 你在配置Caps时要做如下设置 - `automationName` : `uiautomator2` (无视大小写) - `androidCoverage` : {package}/{instrumentation class}, 在我们的例子中是com.example.pkg/com.example.pkg.JacocoInstrumentation - `appWaitActivity` : 用作Insutrment的Activity的全名,在我们的例子中是com.example.pkg.InstrumentActivity - `appWaitPackage` : {package},在我们的例子中是com.example.pkg - `androidCoverageEndIntent` : 用作将当前coverage输出至文件中的BroadCasterReceiver的Action名,在我们的例子中是 `com.example.pkg.END_EMMA` + * automationName : `uiautomator2` (无视大小写) + * androidCoverage : {package}/{instrumentation class}, 在我们的例子中是com.example.pkg/com.example.pkg.JacocoInstrumentation + * appWaitActivity : 用作Insutrment的Activity的全名,在我们的例子中是com.example.pkg.InstrumentActivity + * appWaitPackage : {package},在我们的例子中是com.example.pkg + * androidCoverageEndIntent : 用作将当前coverage输出至文件中的BroadCasterReceiver的Action名,在我们的例子中是 `com.example.pkg.END_EMMA` 工作原理 Appium 会用类似的命令启动应用:`adb shell am instrument -e coverage true -w com.example.pkg/com.example.pkg.JacocoInstrumentation` diff --git a/docs/en/writing-running-appium/android_coverage.md b/docs/en/writing-running-appium/android_coverage.md index d4510c649..e6bc696e3 100644 --- a/docs/en/writing-running-appium/android_coverage.md +++ b/docs/en/writing-running-appium/android_coverage.md @@ -8,17 +8,17 @@ You may need the following structure of files: ``` src/main/java/com/example/pkg - |____ MainActivity.java *Your main activity* - |____ InstrumentActivityListener.java *A customized interface for exporting coverage to files* - |____ InstrumentActivity.java *Activity launched for coverage. But in most cases, this should be same as MainActivity. The only difference is that it will include a `InstrumentActivityListener` to export coverage data to disk files. - |____ JacocoInstrumentation.java The instrument class created by you. Also it needs to implement `InstrumentActivitylistener`. - |____ EndEmmaBroadCast.java A broadcast receiver which will be invoked by appium-uiautomator2-driver at the end of testing. You need implementing logic to invoke InstrumentActivityListener so as to export coverage to files. + |____ MainActivity.java Your main activity + |____ InstrumentActivityListener.java A customized interface for exporting coverage to files + |____ InstrumentActivity.java Activity launched for coverage. But in most cases, this should be same as MainActivity. The only difference is that it will include a `InstrumentActivityListener` to export coverage data to disk files. + |____ JacocoInstrumentation.java The instrument class created by you. Also it needs to implement `InstrumentActivitylistener`. + |____ EndEmmaBroadCast.java A broadcast receiver which will be invoked by appium-uiautomator2-driver at the end of testing. You need implementing logic to invoke InstrumentActivityListener so as to export coverage to files. ``` Configure followings in your caps: - `automationName` : `uiautomator2` (case irrelevant) - `androidCoverage` : {package}/{instrumentation class}, in our example, `com.example.pkg/com.example.pkg.JacocoInstrumentation` - `appWaitActivity` : the FQCN of the activity of InstrumentActivity, in our example, `com.example.pkg.InstrumentActivity` - `appWaitPackage` : {package},in our example, `com.example.pkg` + * automationName : `uiautomator2` (case irrelevant) + * androidCoverage : {package}/{instrumentation class}, in our example, `com.example.pkg/com.example.pkg.JacocoInstrumentation` + * appWaitActivity : the FQCN of the activity of InstrumentActivity, in our example, `com.example.pkg.InstrumentActivity` + * appWaitPackage : {package},in our example, `com.example.pkg` `androidCoverageEndIntent` : The action of the broadcast receiver to invoke the exporting of coverage data to files, in our example `com.example.pkg.END_EMMA` Methodology