Testing Support Library在Android测试中的使用
来源:互联网 发布:手机淘宝密码修改 编辑:程序博客网 时间:2024/06/05 10:26
Testing Support Library(以下简称TSL)是google提供的Android测试框架,用来帮助android的自动化测试。
一 搭建TSL
TSL是包含在Android Support Repository里面的,可以通过Android SDK Manger来获取。
步骤:
1. 打开Android SDK Manager,mac上可以在命令行输入android即可。
2. 在Extras目录下, 找到Android Support Repository
3. 选中之后,点击Install packages按钮。
默认会安装在你的Android SDK的目录下,<sdk>/extras/android/m2repository, 此目录下的android.support.test包包含有Android Testing Support Library的类们。
4. 在build.gradle文件里添加TSL的依赖。
dependencies { androidTestCompile 'com.android.support.test:runner:0.4' // Set this dependency to use JUnit 4 rules androidTestCompile 'com.android.support.test:rules:0.4' // Set this dependency to build and run Espresso tests androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1' // Set this dependency to build and run UI Automator tests androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'}5. 在build.gradle里设置AndroidJUnitRunner为默认的test instrumentation runner
android { defaultConfig { testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" }}
0 0
- Testing Support Library在Android测试中的使用
- Android Testing Support Library
- android 的 Testing Support Library 测试支持包(库)
- Android中的support library
- Android新提供的测试框架支持库学习 && Testing Support Library
- Testing Support Library
- (8.1.5.9)Android Testing Support Library翻译之 ATSL 中的 JUnit4 规则
- 使用Android design support library在Eclipse和Android Studio
- (8.1.5.8)Android Testing Support Library翻译之 AndroidJUnitRunner
- Eclipse下使用Android Design Support Library中的控件
- 在Maven项目中使用Android Support Library
- 在Maven项目中使用Android Support Library
- Android Design Support Library在eclipse中使用
- Android Design Support Library 使用
- Android Support Annotation Library 使用
- Android Design Support Library使用
- 【Android】Android Design Support Library 的使用
- Android Design Support Library使用详解
- CentOS 7 设置开启默认启用命令行模式而非图形界面
- <LeetCode OJ> 19. Remove Nth Node From End of List
- Ext.js5(表单)的容器(表单load测试数据)(表单填写的数据的保存)(vtype)(combineErrors)(插入())(文本框的布局)(36)
- 接收系统广播
- MBR 之 硬盘基本知识(磁道、扇区、柱面、磁头数、簇、MBR、DBR)
- Testing Support Library在Android测试中的使用
- Spark + ansj 对大数据量中文进行分词
- Android Application之onLowMemory与omTrimMemory
- 安卓打包签名之-export aborted because fatal lint errors were found
- 产品策划一:移动App项目研发流程及版本规划
- Description Resource Path Location Type Java compiler level does not match the version of the instal
- 获取当前分辨率及dip值
- Java中的ReentrantLock和synchronized两种锁定机制的对比
- [干货]Android编程开发规范