我的 Android 应用使用 FacebookSDK 进行登录.这是第一个屏幕,除非您登录,否则您无法进行任何操作.
My Android app uses FacebookSDK for login. It's the first screen, and you can't do anything unless you login.
我想编写一些 Espresso 测试以在 Greenhouse 持续集成服务器上运行.
I want to write some Espresso tests to be ran on Greenhouse Continuous integration server.
我在 iOS 上搜索并找到了 FBSDKTestUsersManager,但在 Android 上没有类似的东西.
I searched and I found FBSDKTestUsersManager on iOS, but nothing similar on Android.
What I plan to do is create a flavor of test and when that flavor is selected instead of a normal Facebook login button, I'd display a button that gets a test access token for the user, then brings them to the homepage的应用程序.但是,我不能这样做,因为 Android 上不存在 FBSDKTestUsersManager.
What I plan to do is create a flavor of test and when that flavor is selected instead of a normal Facebook login button, I'd display a button that gets a test access token for the user, then brings them to the homepage of the app. However, I can't do that cause FBSDKTestUsersManager doesn't exist on Android.
有什么建议吗?
解决方案是将 UIAutomator 与 Espresso for Android 一起参与您的测试.可以在测试环境下离开您的应用程序并在 Facebook 登录对话框上执行一些操作.类似的问题这里和我的博文.
The solution is to involve UIAutomator in your tests together with Espresso for Android. It will be possible to go outside of your app under test context and perform some actions on Facebook login dialog. Similar question here and the example in my blog post.
这篇关于为登录 Facebook 的 Android 应用编写测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
在android中剪切、复制、粘贴Cut, copy, paste in android(在android中剪切、复制、粘贴)
android EditText 融入背景android EditText blends into background(android EditText 融入背景)
更改 EditText 的线条颜色 - AndroidChange Line Color of EditText - Android(更改 EditText 的线条颜色 - Android)
EditText 始终显示带 2 位小数的数字EditText showing numbers with 2 decimals at all times(EditText 始终显示带 2 位小数的数字)
更改光标在展开的 EditText 中的开始位置Changing where cursor starts in an expanded EditText(更改光标在展开的 EditText 中的开始位置)
android中的EditText,adjustPan,ScrollView问题EditText, adjustPan, ScrollView issue in android(android中的EditText,adjustPan,ScrollView问题)