-
Notifications
You must be signed in to change notification settings - Fork 992
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing UI test in settings activity (#360)
* Fixing UI test for clicking log out in settings * fixing broken UI tests
- Loading branch information
Showing
5 changed files
with
23 additions
and
5 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,12 +1,21 @@ | ||
package utils | ||
import android.support.annotation.IdRes | ||
import android.support.test.espresso.Espresso.onView | ||
import android.support.test.espresso.matcher.ViewMatchers.* | ||
import android.support.test.espresso.action.ViewActions.click | ||
import android.support.test.espresso.matcher.RootMatchers.isDialog | ||
import android.support.test.espresso.matcher.ViewMatchers.withId | ||
import android.support.test.espresso.matcher.ViewMatchers.withText | ||
import android.widget.Button | ||
import org.hamcrest.core.AllOf.allOf | ||
import org.hamcrest.core.IsInstanceOf.instanceOf | ||
|
||
class Events { | ||
|
||
fun clickOnView(@IdRes viewId: Int) { | ||
onView(withId(viewId)).perform(click()) | ||
} | ||
} | ||
|
||
fun clickOnButtonInDialog(text: String) { | ||
onView(allOf(instanceOf(Button::class.java), withText(text))).inRoot(isDialog()).perform(click()) | ||
} | ||
} |
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
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
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