我开始使用Espresso,我对如何编写此测试有疑问,请帮助我获得更好的想法或点资源,帮助我开始
My applicaitn
WelComeAcitivty -> this inlucde a button (LoadReceipe) When click on this it will load ReceipeListActivity
RecipeListActivity-> this acitivty show a fragment (RecepieFragmet built using RecyleView)
When you click on recipe item it will load another activity (ReceipeDetailActivity which also showing data in a fragment)
RecyleViewAdapter show Recipe Image and ReceipeTitle ( Imageview & textView)
ReceipeDetailActivity-> this activity hold a fragment and display detail of the receipe Fragment contains IamgeView receipeImage/TextView TitleOf Receipe/TextView Details of Cooking instruction
我的问题? 1)如何编写Espresso UI测试以验证ReceipeList-fragment 是否正确显示数据?正确显示文字和图像? 如果图像无法加载显示正确的占位符图像?
2)如何验证项目点击事件以加载正确的详细信息视图?
3)如果没有数据显示空视图(FrameLayout带有文本视图“显示无数据”)
4)如果有网络错误显示重试视图? RetryView包含TextVew和Button(点击按钮重试加载配方网络调用)