android-espresso

testUI (Jenkins) using espresso

◇◆丶佛笑我妖孽 提交于 2019-12-20 09:56:23
问题 The app is passing the espresso tests locally, i mean directly to the devices and genymotion emulators. When I use Jenkins to built an app's image. The espresso test are not successful I get this error. JENKINS: java.lang.RuntimeException: Waited for the root of the view hierarchy to have window focus and not be requesting layout for over 10 seconds. If you specified a non default root matcher, it may be picking a root that never takes focus. Otherwise, something is seriously wrong. Selected

Espresso - Asserting a TextView with async loaded data

一曲冷凌霜 提交于 2019-12-20 09:37:58
问题 I'm writing a UI test with Google Espresso for Android and I'm stuck on how to assert a TextView text, which content is asynchronously loaded from a web service. My current code is: public class MyTest extends BaseTestCase<MyActivity>{ public void setUp() throws Exception { // (1) Tell the activity to load 'element-to-be-loaded' from webservice this.setActivityIntent(new Intent(Intent.ACTION_VIEW, Uri.parse("data://data/element-to-be-loaded"))); getActivity(); super.setUp(); } public void

Espresso Testing call view button click waiting after call api response data progressDialog dimission

一曲冷凌霜 提交于 2019-12-20 06:40:45
问题 I develop automation testing using via espresso library. Sometime I ever got error message "Could not launch intent Intent" when running test is make long time I call view btn click after api response data progress-dialog dimission. Please help me something ideas for those error who have experience automation testing using via espresso technic Thanks :D 回答1: This probably happens when there is a progress dialog after test finishes. So your next test can't launch itself when progress dialog is

How to execute a designated test suite class in Firebase Test Lab

痴心易碎 提交于 2019-12-20 04:53:15
问题 I have an espresso test suite class like this package instrumentedtest; import org.junit.ClassRule; import org.junit.rules.ExternalResource; import org.junit.runner.RunWith; import org.junit.runners.Suite; @RunWith(Suite.class) @Suite.SuiteClasses({ Test1.class, Test2.class, Test3.class }) public class POSRuleSuite { @ClassRule public static ExternalResource testRule = new ExternalResource() { @Override protected void before() throws Throwable { System.out.println("Testing starts.........");

How to execute a designated test suite class in Firebase Test Lab

为君一笑 提交于 2019-12-20 04:53:04
问题 I have an espresso test suite class like this package instrumentedtest; import org.junit.ClassRule; import org.junit.rules.ExternalResource; import org.junit.runner.RunWith; import org.junit.runners.Suite; @RunWith(Suite.class) @Suite.SuiteClasses({ Test1.class, Test2.class, Test3.class }) public class POSRuleSuite { @ClassRule public static ExternalResource testRule = new ExternalResource() { @Override protected void before() throws Throwable { System.out.println("Testing starts.........");

Writing tests for an Android app that logs into Facebook

核能气质少年 提交于 2019-12-20 03:11:28
问题 My Android app uses FacebookSDK for login. It's the first screen, and you can't do anything unless you login. I want to write some Espresso tests to be ran on Greenhouse Continuous integration server. 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

Testing Android PreferenceFragment with Espresso

故事扮演 提交于 2019-12-19 21:49:14
问题 I am trying to write tests for the PreferenceFragments fragment in Settings. However, I've been getting this error: android.support.test.espresso.NoMatchingViewException: No views in hierarchy found matching: is assignable from class: class android.widget.AdapterView The code for the Test is the following: @RunWith(AndroidJUnit4.class) @SmallTest public class SettingsFragmentTest { @Rule public ActivityTestRule<SettingsActivity> mActivityRule = new ActivityTestRule<>( SettingsActivity.class);

Check fragment visibility after clicking on Tab from TabLayout that only contains icon using Android Espresso

自作多情 提交于 2019-12-19 09:57:45
问题 I'm trying to check if my fragment is visible after performing a click on my tab from my tabLayout which has been set up with view pager. This is my actual activity code, inside my activity onCreate method: mViewPager = findViewById(R.id.contentFrameLayout); mViewPager.setAdapter(mSectionPageAdapter); mViewPager.setPagingEnabled(false); //Set up the tab layout to display tabs tabLayout = findViewById(R.id.homeTabs); tabLayout.setupWithViewPager(mViewPager); for (int i = 0; i< tabLayout

Espresso, Dagger2 set ViemodelProvider.Factory on BaseActivity

ぃ、小莉子 提交于 2019-12-19 05:21:03
问题 I have an abstract AccountRequiredActivity that looks like this (and works fine): public abstract class AccountRequiredActivity extends LifecycleActivity { @Inject ViewModelProvider.Factory viewModelFactory; private AccountViewModel accountViewModel; public abstract void doOnCreate(Bundle savedInstanceState); public abstract void doOnResume(); @Override protected final void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_loading_app);

Dagger code giving NoClassDefFoundError when Espresso Tests are run, normal run works fine

别说谁变了你拦得住时间么 提交于 2019-12-19 05:16:07
问题 Started exploring Espresso 2.0, but seem to have run into a hiccup. I cannot get the tests to successfully run against any project which includes Dagger. When I run the tests I get the following Exception (entire stacktrace at the end): java.lang.NoClassDefFoundError: com/pdt/daggerexample/model/DaggerExampleAppModule$$ModuleAdapter$ProvideMySingletonProvidesAdapter The application runs when not running from the AndroidInstrumentationTest. Here are some of the relevant files, I've also