File tree Expand file tree Collapse file tree
WordPress/src/androidTest/java/org/wordpress/android Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package org.wordpress.android
2+
3+ import androidx.lifecycle.ProcessLifecycleOwner
4+ import dagger.hilt.android.testing.HiltAndroidTest
5+ import org.junit.Assert.assertFalse
6+ import org.junit.Test
7+ import org.wordpress.android.AppInitializer.ApplicationLifecycleMonitor
8+ import org.wordpress.android.support.BaseTest
9+
10+ /* *
11+ * This tests if [ProcessLifecycleOwner] observer works at the app startup.
12+ *
13+ * [WordPress.appIsInTheBackground] is set to false when [ApplicationLifecycleMonitor.onAppComesFromBackground] is
14+ * called.
15+ */
16+ @HiltAndroidTest
17+ class AppInitializerTest : BaseTest () {
18+ @Test
19+ fun verifyOnAppComesFromBackgroundCalled () {
20+ assertFalse(WordPress .appIsInTheBackground)
21+ }
22+ }
Original file line number Diff line number Diff line change @@ -175,6 +175,7 @@ public void goToBackup() {
175175 public StatsPage goToStats () {
176176 goToMenuTab ();
177177 clickQuickActionOrSiteMenuItem (R .id .quick_action_stats_button , R .string .stats );
178+ idleFor (4000 );
178179 dismissJetpackAdIfPresent ();
179180 waitForElementToBeDisplayedWithoutFailure (R .id .tabLayout );
180181
You can’t perform that action at this time.
0 commit comments