diff options
author | 2024-12-05 18:33:05 +0000 | |
---|---|---|
committer | 2024-12-09 14:56:34 +0000 | |
commit | bc9ec8c7e15c44c92d0116be6e68d32d4bf2f3a8 (patch) | |
tree | 2a1d0bc65eed11ec1221260054744202c86578e5 | |
parent | c39032e4a1a3f3362da9416f51b57488834e5bf2 (diff) |
Relax test for opening location page from subpage
See more info in b/320820266#comment10.
Bug: 320820266
Test: Treehugger
Flag: NONE Test only change
Relnote: N/a
Change-Id: Ie3e5aa01a00e7ce939b04831d6f858aacbc4b17b
LOW_COVERAGE_REASON=b/360423897
2 files changed, 11 insertions, 13 deletions
diff --git a/tests/functional/safetycenter/subpages/src/android/safetycenter/functional/ui/PrivacySubpageTest.kt b/tests/functional/safetycenter/subpages/src/android/safetycenter/functional/ui/PrivacySubpageTest.kt index 7ad83b949..c3e104504 100644 --- a/tests/functional/safetycenter/subpages/src/android/safetycenter/functional/ui/PrivacySubpageTest.kt +++ b/tests/functional/safetycenter/subpages/src/android/safetycenter/functional/ui/PrivacySubpageTest.kt @@ -47,9 +47,9 @@ import com.android.safetycenter.testing.UiTestHelper.waitAllTextDisplayed import com.android.safetycenter.testing.UiTestHelper.waitAllTextNotDisplayed import com.android.safetycenter.testing.UiTestHelper.waitButtonDisplayed import com.android.safetycenter.testing.UiTestHelper.waitDisplayed -import com.android.safetycenter.testing.UiTestHelper.waitPageTitleDisplayed import com.android.safetycenter.testing.UiTestHelper.waitSourceIssueDisplayed import com.android.safetycenter.testing.UiTestHelper.waitSourceIssueNotDisplayed +import java.util.regex.Pattern import org.junit.After import org.junit.Before import org.junit.Rule @@ -98,7 +98,7 @@ class PrivacySubpageTest { context.getString(firstSource.summaryResId), "Controls", context.getString(lastSource.titleResId), - context.getString(lastSource.summaryResId) + context.getString(lastSource.summaryResId), ) } } @@ -117,7 +117,7 @@ class PrivacySubpageTest { waitButtonDisplayed("Exit test activity") { it.click() } waitAllTextDisplayed( context.getString(source.titleResId), - context.getString(source.summaryResId) + context.getString(source.summaryResId), ) } } @@ -156,16 +156,16 @@ class PrivacySubpageTest { context.launchSafetyCenterActivity(extras) { waitAllText( displayed = sensorPrivacyManager.supportsSensorToggle(CAMERA), - text = "Camera access" + text = "Camera access", ) waitAllText( displayed = sensorPrivacyManager.supportsSensorToggle(MICROPHONE), - text = "Microphone access" + text = "Microphone access", ) waitAllTextDisplayed("Show clipboard access") waitAllText( displayed = getPermissionControllerBool("config_display_show_password_toggle"), - text = "Show passwords" + text = "Show passwords", ) waitAllTextDisplayed("Location access") } @@ -179,16 +179,14 @@ class PrivacySubpageTest { val source: SafetySource = sourcesGroup.safetySources.first() val extras = Bundle() extras.putString(EXTRA_SAFETY_SOURCES_GROUP_ID, sourcesGroup.id) + val containsLocationPattern = Pattern.compile(".*[Ll]ocation.*") // NOTYPO context.launchSafetyCenterActivity(extras) { - openPageAndExit("Location access") { - waitPageTitleDisplayed("Location") - waitAllTextDisplayed("Use location") - } + openPageAndExit("Location access") { waitDisplayed(By.text(containsLocationPattern)) } waitAllTextDisplayed( context.getString(source.titleResId), - context.getString(source.summaryResId) + context.getString(source.summaryResId), ) } } @@ -225,7 +223,7 @@ class PrivacySubpageTest { permissionControllerContext.resources.getIdentifier( resourceName, "bool", - "com.android.permissioncontroller" + "com.android.permissioncontroller", ) return permissionControllerContext.resources.getBoolean(resourceId) } diff --git a/tests/utils/safetycenter/java/com/android/safetycenter/testing/UiTestHelper.kt b/tests/utils/safetycenter/java/com/android/safetycenter/testing/UiTestHelper.kt index 0e062692a..c7d195528 100644 --- a/tests/utils/safetycenter/java/com/android/safetycenter/testing/UiTestHelper.kt +++ b/tests/utils/safetycenter/java/com/android/safetycenter/testing/UiTestHelper.kt @@ -175,7 +175,7 @@ object UiTestHelper { fun waitGroupShownOnHomepage(context: Context, group: SafetySourcesGroup) { waitAllTextDisplayed( context.getString(group.titleResId), - context.getString(group.summaryResId) + context.getString(group.summaryResId), ) } |