revise the format of doc

This commit is contained in:
swordstream
2017-08-21 01:01:41 +08:00
parent f61cadc718
commit b1ba2e8ad7
2 changed files with 14 additions and 14 deletions

View File

@@ -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`

View File

@@ -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