mirror of
https://github.com/appium/appium.git
synced 2026-01-25 19:59:17 -06:00
revise the format of doc
This commit is contained in:
@@ -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`
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user