From 5989d6b82aaf5896742fc2abd6910a53543d11a1 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 13 Jan 2022 18:16:41 +0100 Subject: [PATCH 1/2] Test analytics opt-in screen from the settings --- .../java/im/vector/app/ui/UiAllScreensSanityTest.kt | 1 - .../im/vector/app/ui/robot/settings/SettingsSecurityRobot.kt | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/vector/src/androidTest/java/im/vector/app/ui/UiAllScreensSanityTest.kt b/vector/src/androidTest/java/im/vector/app/ui/UiAllScreensSanityTest.kt index 042e9ef3ee..b424c026ce 100644 --- a/vector/src/androidTest/java/im/vector/app/ui/UiAllScreensSanityTest.kt +++ b/vector/src/androidTest/java/im/vector/app/ui/UiAllScreensSanityTest.kt @@ -69,7 +69,6 @@ class UiAllScreensSanityTest { preferences { crawl() } voiceAndVideo() ignoredUsers() - // TODO Test analytics securityAndPrivacy { crawl() } labs() advancedSettings { crawl() } diff --git a/vector/src/androidTest/java/im/vector/app/ui/robot/settings/SettingsSecurityRobot.kt b/vector/src/androidTest/java/im/vector/app/ui/robot/settings/SettingsSecurityRobot.kt index f2607bbc1c..168db3e0e9 100644 --- a/vector/src/androidTest/java/im/vector/app/ui/robot/settings/SettingsSecurityRobot.kt +++ b/vector/src/androidTest/java/im/vector/app/ui/robot/settings/SettingsSecurityRobot.kt @@ -33,5 +33,8 @@ class SettingsSecurityRobot { clickOnPreference(R.string.encryption_export_e2e_room_keys) pressBack() */ + + clickOnPreference(R.string.settings_opt_in_of_analytics) + Espresso.pressBack() } } From 891367752b6ff1ebf0b79fa40fe41d815513463f Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 26 Jan 2022 18:00:49 +0100 Subject: [PATCH 2/2] Test the legals screen (#4709) --- .../vector/app/ui/UiAllScreensSanityTest.kt | 4 +-- .../ui/robot/settings/SettingsHelpRobot.kt | 6 ---- .../ui/robot/settings/SettingsLegalsRobot.kt | 29 +++++++++++++++++++ .../app/ui/robot/settings/SettingsRobot.kt | 4 +++ 4 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 vector/src/androidTest/java/im/vector/app/ui/robot/settings/SettingsLegalsRobot.kt diff --git a/vector/src/androidTest/java/im/vector/app/ui/UiAllScreensSanityTest.kt b/vector/src/androidTest/java/im/vector/app/ui/UiAllScreensSanityTest.kt index b424c026ce..d625cf0390 100644 --- a/vector/src/androidTest/java/im/vector/app/ui/UiAllScreensSanityTest.kt +++ b/vector/src/androidTest/java/im/vector/app/ui/UiAllScreensSanityTest.kt @@ -72,8 +72,8 @@ class UiAllScreensSanityTest { securityAndPrivacy { crawl() } labs() advancedSettings { crawl() } - // TODO Rework this part (Legals, etc.) - // helpAndAbout { crawl() } + helpAndAbout { crawl() } + legals { crawl() } } elementRobot.newDirectMessage { diff --git a/vector/src/androidTest/java/im/vector/app/ui/robot/settings/SettingsHelpRobot.kt b/vector/src/androidTest/java/im/vector/app/ui/robot/settings/SettingsHelpRobot.kt index 75f610d016..cf0c997d80 100644 --- a/vector/src/androidTest/java/im/vector/app/ui/robot/settings/SettingsHelpRobot.kt +++ b/vector/src/androidTest/java/im/vector/app/ui/robot/settings/SettingsHelpRobot.kt @@ -16,10 +16,6 @@ package im.vector.app.ui.robot.settings -import com.adevinta.android.barista.interaction.BaristaClickInteractions.clickOn -import com.adevinta.android.barista.interaction.BaristaDialogInteractions.clickDialogPositiveButton -import im.vector.app.R - class SettingsHelpRobot { fun crawl() { @@ -34,7 +30,5 @@ class SettingsHelpRobot { clickOn(R.string.settings_privacy_policy) pressBack() */ - clickOn(R.string.settings_third_party_notices) - clickDialogPositiveButton() } } diff --git a/vector/src/androidTest/java/im/vector/app/ui/robot/settings/SettingsLegalsRobot.kt b/vector/src/androidTest/java/im/vector/app/ui/robot/settings/SettingsLegalsRobot.kt new file mode 100644 index 0000000000..842471752a --- /dev/null +++ b/vector/src/androidTest/java/im/vector/app/ui/robot/settings/SettingsLegalsRobot.kt @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2021 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package im.vector.app.ui.robot.settings + +import com.adevinta.android.barista.interaction.BaristaClickInteractions.clickOn +import com.adevinta.android.barista.interaction.BaristaDialogInteractions.clickDialogPositiveButton +import im.vector.app.R + +class SettingsLegalsRobot { + + fun crawl() { + clickOn(R.string.settings_third_party_notices) + clickDialogPositiveButton() + } +} diff --git a/vector/src/androidTest/java/im/vector/app/ui/robot/settings/SettingsRobot.kt b/vector/src/androidTest/java/im/vector/app/ui/robot/settings/SettingsRobot.kt index a9c053f6c3..561f14c6f2 100644 --- a/vector/src/androidTest/java/im/vector/app/ui/robot/settings/SettingsRobot.kt +++ b/vector/src/androidTest/java/im/vector/app/ui/robot/settings/SettingsRobot.kt @@ -64,4 +64,8 @@ class SettingsRobot { fun helpAndAbout(block: SettingsHelpRobot.() -> Unit) { clickOnAndGoBack(R.string.preference_root_help_about) { block(SettingsHelpRobot()) } } + + fun legals(block: SettingsLegalsRobot.() -> Unit) { + clickOnAndGoBack(R.string.preference_root_legals) { block(SettingsLegalsRobot()) } + } }