This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[android] - fix dialog fragment setup, add regression test
- Loading branch information
Showing
2 changed files
with
52 additions
and
9 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
...stApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/fragment/MapDialogFragmentTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.mapbox.mapboxsdk.testapp.fragment | ||
|
||
import android.support.test.espresso.Espresso | ||
import android.support.test.espresso.Espresso.onView | ||
import android.support.test.espresso.action.ViewActions.click | ||
import android.support.test.espresso.matcher.ViewMatchers.withId | ||
import android.support.test.filters.LargeTest | ||
import android.support.test.rule.ActivityTestRule | ||
import android.support.test.runner.AndroidJUnit4 | ||
import com.mapbox.mapboxsdk.testapp.R | ||
import com.mapbox.mapboxsdk.testapp.action.WaitAction | ||
import com.mapbox.mapboxsdk.testapp.activity.maplayout.MapInDialogActivity | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
/** | ||
* Regression test that validates that a map inside a DialogFragment can be opened and closed. | ||
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
@LargeTest | ||
class MapDialogFragmentTest { | ||
|
||
@get:Rule | ||
var activityRule: ActivityTestRule<MapInDialogActivity> = ActivityTestRule(MapInDialogActivity::class.java) | ||
|
||
@Test | ||
fun openCloseDialog() { | ||
onView(withId(R.id.button_open_dialog)).perform(click()) | ||
onView(withId(R.id.mapView)).perform(WaitAction(2500)) | ||
Espresso.pressBack() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters