This repository has been archived by the owner on Feb 20, 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.
Added UI tests for the Submenu About settings.
- Loading branch information
Showing
6 changed files
with
152 additions
and
27 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
21 changes: 21 additions & 0 deletions
21
app/src/androidTest/java/org/mozilla/fenix/helpers/matchers/TextViewRegexMatcher.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,21 @@ | ||
package org.mozilla.fenix.helpers.matchers | ||
|
||
import android.view.View | ||
import android.widget.TextView | ||
import androidx.test.espresso.matcher.BoundedMatcher | ||
import org.hamcrest.Description | ||
import java.util.regex.Pattern | ||
|
||
class TextViewRegexMatcher(private val regex: String) : BoundedMatcher<View, TextView>(TextView::class.java) { | ||
private val pattern = Pattern.compile(regex) | ||
|
||
override fun describeTo(description: Description?) { | ||
description?.appendText("Checking the matcher on received view: with pattern=$regex") | ||
} | ||
|
||
override fun matchesSafely(item: TextView?): Boolean { | ||
return item?.text?.let { | ||
pattern.matcher(it).matches() | ||
} ?: false | ||
} | ||
} |
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
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