From 99cb51af6bc3012101666306c238f01e494ca45b Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 31 Aug 2021 14:20:39 +0200 Subject: [PATCH 1/8] Test on intermediate API levels --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index e1d63a1520..984ae0748e 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -30,7 +30,7 @@ jobs: strategy: fail-fast: false matrix: - api-level: [21, 30] + api-level: [21, 28, 30] steps: - uses: actions/checkout@v2 - name: Set up Python 3.8 From fc22376050cdecef10ef19d9bc5a254ec056f2e5 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 31 Aug 2021 15:09:53 +0200 Subject: [PATCH 2/8] Ignore warning in test. There is probably a better way than using the GlobalScope, but I'm not sure how to do it now. --- .../java/org/matrix/android/sdk/common/CommonTestHelper.kt | 2 ++ .../java/org/matrix/android/sdk/common/CryptoTestHelper.kt | 2 ++ .../matrix/android/sdk/internal/crypto/ssss/QuadSTests.kt | 2 ++ .../matrix/android/sdk/session/space/SpaceCreationTest.kt | 2 ++ .../matrix/android/sdk/session/space/SpaceHierarchyTest.kt | 5 +++++ .../android/sdk/internal/task/CoroutineSequencersTest.kt | 3 +++ .../androidTest/java/im/vector/app/VerificationTestBase.kt | 1 + 7 files changed, 17 insertions(+) diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/CommonTestHelper.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/CommonTestHelper.kt index 6e07223ac7..7817351e53 100644 --- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/CommonTestHelper.kt +++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/CommonTestHelper.kt @@ -91,6 +91,7 @@ class CommonTestHelper(context: Context) { * * @param session the session to sync */ + @Suppress("EXPERIMENTAL_API_USAGE") fun syncSession(session: Session, timeout: Long = TestConstants.timeOutMillis) { val lock = CountDownLatch(1) @@ -327,6 +328,7 @@ class CommonTestHelper(context: Context) { assertTrue(latch.await(timeout ?: TestConstants.timeOutMillis, TimeUnit.MILLISECONDS)) } + @Suppress("EXPERIMENTAL_API_USAGE") fun retryPeriodicallyWithLatch(latch: CountDownLatch, condition: (() -> Boolean)) { GlobalScope.launch { while (true) { diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/CryptoTestHelper.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/CryptoTestHelper.kt index da176491c6..a8cbc160dd 100644 --- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/CryptoTestHelper.kt +++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/CryptoTestHelper.kt @@ -84,6 +84,7 @@ class CryptoTestHelper(private val mTestHelper: CommonTestHelper) { /** * @return alice and bob sessions */ + @Suppress("EXPERIMENTAL_API_USAGE") fun doE2ETestWithAliceAndBobInARoom(encryptedRoom: Boolean = true): CryptoTestData { val cryptoTestData = doE2ETestWithAliceInARoom(encryptedRoom) val aliceSession = cryptoTestData.firstSession @@ -255,6 +256,7 @@ class CryptoTestHelper(private val mTestHelper: CommonTestHelper) { ) } + @Suppress("EXPERIMENTAL_API_USAGE") fun createDM(alice: Session, bob: Session): String { val roomId = mTestHelper.runBlockingTest { alice.createDirectRoom(bob.myUserId) diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/ssss/QuadSTests.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/ssss/QuadSTests.kt index d14de30c90..74855b8630 100644 --- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/ssss/QuadSTests.kt +++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/ssss/QuadSTests.kt @@ -60,6 +60,7 @@ class QuadSTests : InstrumentedTest { } @Test + @Suppress("EXPERIMENTAL_API_USAGE") fun test_Generate4SKey() { val aliceSession = mTestHelper.createAccount(TestConstants.USER_ALICE, SessionTestParams(true)) @@ -275,6 +276,7 @@ class QuadSTests : InstrumentedTest { mTestHelper.signOutAndClose(aliceSession) } + @Suppress("EXPERIMENTAL_API_USAGE") private fun assertAccountData(session: Session, type: String): UserAccountDataEvent { val accountDataLock = CountDownLatch(1) var accountData: UserAccountDataEvent? = null diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/space/SpaceCreationTest.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/space/SpaceCreationTest.kt index b635ca1571..5911414c25 100644 --- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/space/SpaceCreationTest.kt +++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/space/SpaceCreationTest.kt @@ -50,6 +50,7 @@ class SpaceCreationTest : InstrumentedTest { private val commonTestHelper = CommonTestHelper(context()) @Test + @Suppress("EXPERIMENTAL_API_USAGE") fun createSimplePublicSpace() { val session = commonTestHelper.createAccount("Hubble", SessionTestParams(true)) val roomName = "My Space" @@ -133,6 +134,7 @@ class SpaceCreationTest : InstrumentedTest { } @Test + @Suppress("EXPERIMENTAL_API_USAGE") fun testSimplePublicSpaceWithChildren() { val aliceSession = commonTestHelper.createAccount("alice", SessionTestParams(true)) val bobSession = commonTestHelper.createAccount("bob", SessionTestParams(true)) diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/space/SpaceHierarchyTest.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/space/SpaceHierarchyTest.kt index 521b5805bd..1e57608200 100644 --- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/space/SpaceHierarchyTest.kt +++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/space/SpaceHierarchyTest.kt @@ -47,6 +47,7 @@ class SpaceHierarchyTest : InstrumentedTest { private val commonTestHelper = CommonTestHelper(context()) @Test + @Suppress("EXPERIMENTAL_API_USAGE") fun createCanonicalChildRelation() { val session = commonTestHelper.createAccount("John", SessionTestParams(true)) val spaceName = "My Space" @@ -171,6 +172,7 @@ class SpaceHierarchyTest : InstrumentedTest { // } @Test + @Suppress("EXPERIMENTAL_API_USAGE") fun testFilteringBySpace() { val session = commonTestHelper.createAccount("John", SessionTestParams(true)) @@ -254,6 +256,7 @@ class SpaceHierarchyTest : InstrumentedTest { } @Test + @Suppress("EXPERIMENTAL_API_USAGE") fun testBreakCycle() { val session = commonTestHelper.createAccount("John", SessionTestParams(true)) @@ -301,6 +304,7 @@ class SpaceHierarchyTest : InstrumentedTest { } @Test + @Suppress("EXPERIMENTAL_API_USAGE") fun testLiveFlatChildren() { val session = commonTestHelper.createAccount("John", SessionTestParams(true)) @@ -389,6 +393,7 @@ class SpaceHierarchyTest : InstrumentedTest { val roomIds: List ) + @Suppress("EXPERIMENTAL_API_USAGE") private fun createPublicSpace(session: Session, spaceName: String, childInfo: List> diff --git a/matrix-sdk-android/src/test/java/org/matrix/android/sdk/internal/task/CoroutineSequencersTest.kt b/matrix-sdk-android/src/test/java/org/matrix/android/sdk/internal/task/CoroutineSequencersTest.kt index 74b6c03d93..3572a1a546 100644 --- a/matrix-sdk-android/src/test/java/org/matrix/android/sdk/internal/task/CoroutineSequencersTest.kt +++ b/matrix-sdk-android/src/test/java/org/matrix/android/sdk/internal/task/CoroutineSequencersTest.kt @@ -32,6 +32,7 @@ class CoroutineSequencersTest: MatrixTest { private val dispatcher = Executors.newSingleThreadExecutor().asCoroutineDispatcher() @Test + @Suppress("EXPERIMENTAL_API_USAGE") fun sequencer_should_run_sequential() { val sequencer = SemaphoreCoroutineSequencer() val results = ArrayList() @@ -60,6 +61,7 @@ class CoroutineSequencersTest: MatrixTest { } @Test + @Suppress("EXPERIMENTAL_API_USAGE") fun sequencer_should_run_parallel() { val sequencer1 = SemaphoreCoroutineSequencer() val sequencer2 = SemaphoreCoroutineSequencer() @@ -86,6 +88,7 @@ class CoroutineSequencersTest: MatrixTest { } @Test + @Suppress("EXPERIMENTAL_API_USAGE") fun sequencer_should_jump_to_next_when_current_job_canceled() { val sequencer = SemaphoreCoroutineSequencer() val results = ArrayList() diff --git a/vector/src/androidTest/java/im/vector/app/VerificationTestBase.kt b/vector/src/androidTest/java/im/vector/app/VerificationTestBase.kt index 285f40aaf3..a562287263 100644 --- a/vector/src/androidTest/java/im/vector/app/VerificationTestBase.kt +++ b/vector/src/androidTest/java/im/vector/app/VerificationTestBase.kt @@ -107,6 +107,7 @@ abstract class VerificationTestBase { return result!! } + @Suppress("EXPERIMENTAL_API_USAGE") private fun syncSession(session: Session) { val lock = CountDownLatch(1) From ffedd6fcfab5c10bdb86232a96c38b8cf2f9727b Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 31 Aug 2021 16:07:20 +0200 Subject: [PATCH 3/8] Fix other warning --- .../session/room/timeline/TimelineForwardPaginationTest.kt | 2 +- .../session/room/timeline/TimelinePreviousLastForwardTest.kt | 4 ++-- .../matrix/android/sdk/session/space/SpaceHierarchyTest.kt | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/TimelineForwardPaginationTest.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/TimelineForwardPaginationTest.kt index f156a5eb64..0fe341cad6 100644 --- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/TimelineForwardPaginationTest.kt +++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/TimelineForwardPaginationTest.kt @@ -139,7 +139,7 @@ class TimelineForwardPaginationTest : InstrumentedTest { // Alice can see the first event of the room (so Back pagination has worked) snapshot.lastOrNull()?.root?.getClearType() == EventType.STATE_ROOM_CREATE // 6 for room creation item (backward pagination), 1 for the context, and 50 for the forward pagination - && snapshot.size == 6 + 1 + 50 + && snapshot.size == 57 // 6 + 1 + 50 } aliceTimeline.addListener(aliceEventsListener) diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/TimelinePreviousLastForwardTest.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/TimelinePreviousLastForwardTest.kt index 9ebac8766a..03a4d41988 100644 --- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/TimelinePreviousLastForwardTest.kt +++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/room/timeline/TimelinePreviousLastForwardTest.kt @@ -189,7 +189,7 @@ class TimelinePreviousLastForwardTest : InstrumentedTest { Timber.w(" event ${it.root}") } - snapshot.size == 8 + 1 + 35 + snapshot.size == 44 // 8 + 1 + 35 } bobTimeline.addListener(eventsListener) @@ -218,7 +218,7 @@ class TimelinePreviousLastForwardTest : InstrumentedTest { // Bob can see the first event of the room (so Back pagination has worked) snapshot.lastOrNull()?.root?.getClearType() == EventType.STATE_ROOM_CREATE // 8 for room creation item 60 message from Alice - && snapshot.size == 8 + 60 + && snapshot.size == 68 // 8 + 60 && snapshot.checkSendOrder(secondMessage, 30, 0) && snapshot.checkSendOrder(firstMessage, 30, 30) } diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/space/SpaceHierarchyTest.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/space/SpaceHierarchyTest.kt index 1e57608200..301cdea461 100644 --- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/space/SpaceHierarchyTest.kt +++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/space/SpaceHierarchyTest.kt @@ -181,7 +181,7 @@ class SpaceHierarchyTest : InstrumentedTest { Triple("A2", true, true) )) - val spaceBInfo = createPublicSpace(session, "SpaceB", listOf( + /* val spaceBInfo = */ createPublicSpace(session, "SpaceB", listOf( Triple("B1", true /*auto-join*/, true/*canonical*/), Triple("B2", true, true), Triple("B3", true, true) @@ -438,7 +438,7 @@ class SpaceHierarchyTest : InstrumentedTest { fun testRootSpaces() { val session = commonTestHelper.createAccount("John", SessionTestParams(true)) - val spaceAInfo = createPublicSpace(session, "SpaceA", listOf( + /* val spaceAInfo = */ createPublicSpace(session, "SpaceA", listOf( Triple("A1", true /*auto-join*/, true/*canonical*/), Triple("A2", true, true) )) From 73881d08138f23e20a119618b097b2b9f837827d Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 1 Sep 2021 14:52:28 +0200 Subject: [PATCH 4/8] Upgrade dependency on Barista. Should fix #3929 Barista has changed location since 4.0.0 --- vector/build.gradle | 2 +- .../vector/app/ui/UiAllScreensSanityTest.kt | 24 +++++++++---------- .../java/im/vector/app/ui/UiTestBase.kt | 10 ++++---- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/vector/build.gradle b/vector/build.gradle index 36023c1dcc..9d3cc7ec3c 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -521,7 +521,7 @@ dependencies { // Plant Timber tree for test androidTestImplementation 'net.lachlanmckee:timber-junit-rule:1.0.1' // "The one who serves a great Espresso" - androidTestImplementation('com.schibsted.spain:barista:3.9.0') { + androidTestImplementation('com.adevinta.android:barista:4.1.0') { exclude group: 'org.jetbrains.kotlin' } } 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 26365e0c72..19cded2948 100644 --- a/vector/src/androidTest/java/im/vector/app/ui/UiAllScreensSanityTest.kt +++ b/vector/src/androidTest/java/im/vector/app/ui/UiAllScreensSanityTest.kt @@ -30,18 +30,18 @@ import androidx.test.espresso.matcher.ViewMatchers.withText import androidx.test.ext.junit.rules.ActivityScenarioRule import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.LargeTest -import com.schibsted.spain.barista.assertion.BaristaListAssertions.assertListItemCount -import com.schibsted.spain.barista.assertion.BaristaVisibilityAssertions.assertDisplayed -import com.schibsted.spain.barista.interaction.BaristaClickInteractions.clickBack -import com.schibsted.spain.barista.interaction.BaristaClickInteractions.clickOn -import com.schibsted.spain.barista.interaction.BaristaClickInteractions.longClickOn -import com.schibsted.spain.barista.interaction.BaristaDialogInteractions.clickDialogNegativeButton -import com.schibsted.spain.barista.interaction.BaristaDialogInteractions.clickDialogPositiveButton -import com.schibsted.spain.barista.interaction.BaristaEditTextInteractions.writeTo -import com.schibsted.spain.barista.interaction.BaristaListInteractions.clickListItem -import com.schibsted.spain.barista.interaction.BaristaListInteractions.clickListItemChild -import com.schibsted.spain.barista.interaction.BaristaMenuClickInteractions.clickMenu -import com.schibsted.spain.barista.interaction.BaristaMenuClickInteractions.openMenu +import com.adevinta.android.barista.assertion.BaristaListAssertions.assertListItemCount +import com.adevinta.android.barista.assertion.BaristaVisibilityAssertions.assertDisplayed +import com.adevinta.android.barista.interaction.BaristaClickInteractions.clickBack +import com.adevinta.android.barista.interaction.BaristaClickInteractions.clickOn +import com.adevinta.android.barista.interaction.BaristaClickInteractions.longClickOn +import com.adevinta.android.barista.interaction.BaristaDialogInteractions.clickDialogNegativeButton +import com.adevinta.android.barista.interaction.BaristaDialogInteractions.clickDialogPositiveButton +import com.adevinta.android.barista.interaction.BaristaEditTextInteractions.writeTo +import com.adevinta.android.barista.interaction.BaristaListInteractions.clickListItem +import com.adevinta.android.barista.interaction.BaristaListInteractions.clickListItemChild +import com.adevinta.android.barista.interaction.BaristaMenuClickInteractions.clickMenu +import com.adevinta.android.barista.interaction.BaristaMenuClickInteractions.openMenu import im.vector.app.EspressoHelper import im.vector.app.R import im.vector.app.SleepViewAction diff --git a/vector/src/androidTest/java/im/vector/app/ui/UiTestBase.kt b/vector/src/androidTest/java/im/vector/app/ui/UiTestBase.kt index ed174b50a2..2cef326501 100644 --- a/vector/src/androidTest/java/im/vector/app/ui/UiTestBase.kt +++ b/vector/src/androidTest/java/im/vector/app/ui/UiTestBase.kt @@ -20,11 +20,11 @@ import androidx.test.espresso.Espresso.closeSoftKeyboard import androidx.test.espresso.Espresso.onView import androidx.test.espresso.matcher.ViewMatchers.isRoot import androidx.test.espresso.matcher.ViewMatchers.withId -import com.schibsted.spain.barista.assertion.BaristaEnabledAssertions.assertDisabled -import com.schibsted.spain.barista.assertion.BaristaEnabledAssertions.assertEnabled -import com.schibsted.spain.barista.assertion.BaristaVisibilityAssertions.assertDisplayed -import com.schibsted.spain.barista.interaction.BaristaClickInteractions.clickOn -import com.schibsted.spain.barista.interaction.BaristaEditTextInteractions.writeTo +import com.adevinta.android.barista.assertion.BaristaEnabledAssertions.assertDisabled +import com.adevinta.android.barista.assertion.BaristaEnabledAssertions.assertEnabled +import com.adevinta.android.barista.assertion.BaristaVisibilityAssertions.assertDisplayed +import com.adevinta.android.barista.interaction.BaristaClickInteractions.clickOn +import com.adevinta.android.barista.interaction.BaristaEditTextInteractions.writeTo import im.vector.app.R import im.vector.app.espresso.tools.waitUntilActivityVisible import im.vector.app.features.home.HomeActivity From 01dae575de7248e453f303706be30caac8802246 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 1 Sep 2021 15:13:28 +0200 Subject: [PATCH 5/8] Fix sanity test with new notification V2 screens --- .../im/vector/app/ui/UiAllScreensSanityTest.kt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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 19cded2948..16d54ab031 100644 --- a/vector/src/androidTest/java/im/vector/app/ui/UiAllScreensSanityTest.kt +++ b/vector/src/androidTest/java/im/vector/app/ui/UiAllScreensSanityTest.kt @@ -42,6 +42,7 @@ import com.adevinta.android.barista.interaction.BaristaListInteractions.clickLis import com.adevinta.android.barista.interaction.BaristaListInteractions.clickListItemChild import com.adevinta.android.barista.interaction.BaristaMenuClickInteractions.clickMenu import com.adevinta.android.barista.interaction.BaristaMenuClickInteractions.openMenu +import im.vector.app.BuildConfig import im.vector.app.EspressoHelper import im.vector.app.R import im.vector.app.SleepViewAction @@ -458,8 +459,18 @@ class UiAllScreensSanityTest { } private fun navigateToSettingsNotifications() { - clickOn(R.string.settings_notification_advanced) - pressBack() + if (BuildConfig.USE_NOTIFICATION_SETTINGS_V2) { + clickOn(R.string.settings_notification_default) + pressBack() + clickOn(R.string.settings_notification_mentions_and_keywords) + // TODO Test adding a keyword? + pressBack() + clickOn(R.string.settings_notification_other) + pressBack() + } else { + clickOn(R.string.settings_notification_advanced) + pressBack() + } /* clickOn(R.string.settings_noisy_notifications_preferences) TODO Cannot go back From 2b1c517f6437e48457c4254f4020983f96dcb345 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 1 Sep 2021 15:40:09 +0200 Subject: [PATCH 6/8] Fix test broken sometimes, and test new bottom sheet about room type --- .../java/im/vector/app/ui/UiAllScreensSanityTest.kt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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 16d54ab031..cb12812e83 100644 --- a/vector/src/androidTest/java/im/vector/app/ui/UiAllScreensSanityTest.kt +++ b/vector/src/androidTest/java/im/vector/app/ui/UiAllScreensSanityTest.kt @@ -37,6 +37,7 @@ import com.adevinta.android.barista.interaction.BaristaClickInteractions.clickOn import com.adevinta.android.barista.interaction.BaristaClickInteractions.longClickOn import com.adevinta.android.barista.interaction.BaristaDialogInteractions.clickDialogNegativeButton import com.adevinta.android.barista.interaction.BaristaDialogInteractions.clickDialogPositiveButton +import com.adevinta.android.barista.interaction.BaristaDrawerInteractions.openDrawer import com.adevinta.android.barista.interaction.BaristaEditTextInteractions.writeTo import com.adevinta.android.barista.interaction.BaristaListInteractions.clickListItem import com.adevinta.android.barista.interaction.BaristaListInteractions.clickListItemChild @@ -170,9 +171,13 @@ class UiAllScreensSanityTest { } clickOn(R.string.create_new_room) + // Room access bottom sheet + clickOn(R.string.room_settings_room_access_private_title) + pressBack() + // Create - assertListItemCount(R.id.createRoomForm, 10) - clickListItemChild(R.id.createRoomForm, 9, R.id.form_submit_button) + assertListItemCount(R.id.createRoomForm, 12) + clickListItemChild(R.id.createRoomForm, 11, R.id.form_submit_button) waitUntilActivityVisible { assertDisplayed(R.id.roomDetailContainer) @@ -356,7 +361,8 @@ class UiAllScreensSanityTest { } private fun navigateToSettings() { - clickOn(R.id.groupToolbarAvatarImageView) + // clickOn(R.id.groupToolbarAvatarImageView) + openDrawer() clickOn(R.id.homeDrawerHeaderSettingsView) clickOn(R.string.settings_general_title) From a76aedbbc730f4d5380ce5685e64e71f1c2c9a74 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 1 Sep 2021 16:03:34 +0200 Subject: [PATCH 7/8] Fix clicking on edited message --- .../androidTest/java/im/vector/app/ui/UiAllScreensSanityTest.kt | 2 ++ 1 file changed, 2 insertions(+) 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 cb12812e83..bad5d29e06 100644 --- a/vector/src/androidTest/java/im/vector/app/ui/UiAllScreensSanityTest.kt +++ b/vector/src/androidTest/java/im/vector/app/ui/UiAllScreensSanityTest.kt @@ -235,6 +235,8 @@ class UiAllScreensSanityTest { // Wait a bit for the keyboard layout to update sleep(30) clickOn(R.id.sendButton) + // Wait for the UI to update + sleep(1000) // Open edit history longClickOnMessage("Hello universe! (edited)") clickOn(R.string.message_view_edit_history) From 75daeb76999f3b6f560e9a7560a44406c47e15a4 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 1 Sep 2021 16:42:08 +0200 Subject: [PATCH 8/8] Add sanity test GitHub action API 28 for now --- .github/workflows/sanity_test.yml | 50 +++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/sanity_test.yml diff --git a/.github/workflows/sanity_test.yml b/.github/workflows/sanity_test.yml new file mode 100644 index 0000000000..632dee8a58 --- /dev/null +++ b/.github/workflows/sanity_test.yml @@ -0,0 +1,50 @@ +name: Sanity Test + +on: + pull_request: { } + push: + branches: [ main, develop ] + +jobs: + integration-tests: + name: Sanity Tests (Synapse) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + api-level: [28] + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Cache pip + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + - uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + - name: Start synapse server + run: | + python3 -m venv .synapse + source .synapse/bin/activate + pip install synapse matrix-synapse + curl -sL https://raw.githubusercontent.com/matrix-org/synapse/develop/demo/start.sh --no-rate-limit \ + | sed s/127.0.0.1/0.0.0.0/g | bash + - name: Run sanity tests on API ${{ matrix.api-level }} + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: ${{ matrix.api-level }} + script: ./gradlew -PallWarningsAsErrors=false connectedGplayDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=im.vector.app.ui.UiAllScreensSanityTest +