我需要为加载栏编写espresso测试用例

时间:2019-04-26 10:04:32

标签: android kotlin android-espresso

在调用微调器setVisibility时是否显示微调器,我需要编写espresso测试。这是代码 MainActivity.kt

doAsync {
            try {
                activityIndicator!!.setVisibility(View.VISIBLE);
                appList = getAppList(requestBody, LAUNCHER_BASE_URL)
                Log.d("App list =", appList.toString())
                appInfoList = populateList()
            }
            catch (e: Exception) {
                Log.e("Exception-launcher", e.toString())
            }
            uiThread {
                adapter =  Adapter(applicationContext, appInfoList!!,contentResolver,packageManager,applicationContext)
                recyclerView!!.adapter = adapter
                recyclerView!!.layoutManager = GridLayoutManager(applicationContext, 3)
                activityIndicator!!.setVisibility(View.INVISIBLE)
            }

activity_main.xml

<com.wang.avi.AVLoadingIndicatorView
        android:id="@+id/avi"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        style="@style/AVLoadingIndicatorView"
        android:visibility="visible"
        app:indicatorName="LineSpinFadeLoaderIndicator"
        app:indicatorColor="@color/colorPrimary"
        android:gravity="center"/>

0 个答案:

没有答案