Skip to content

Commit

Permalink
For mozilla-mobile#26087 re-enable collections UI tests (Part 2)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndiAJ committed Dec 22, 2022
1 parent 3b865fb commit 9a1da0e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,10 @@ class CollectionTest {
}
}

@SmokeTest
@Test
// Test running on beta/release builds in CI:
// caution when making changes to it, so they don't block the builds
@Ignore("Failing after compose migration. See: https://github.com/mozilla-mobile/fenix/issues/26087")
@SmokeTest
@Test
fun deleteCollectionTest() {
val webPage = getGenericAsset(mockWebServer, 1)

Expand Down Expand Up @@ -257,7 +256,6 @@ class CollectionTest {
}

@Test
@Ignore("Failing after compose migration. See: https://github.com/mozilla-mobile/fenix/issues/26087")
fun verifyAddTabButtonOfCollectionMenu() {
val firstWebPage = getGenericAsset(mockWebServer, 1)
val secondWebPage = getGenericAsset(mockWebServer, 2)
Expand All @@ -284,7 +282,6 @@ class CollectionTest {
}

@Test
@Ignore("Failing after compose migration. See: https://github.com/mozilla-mobile/fenix/issues/26087")
fun renameCollectionTest() {
val webPage = getGenericAsset(mockWebServer, 1)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import androidx.test.uiautomator.Until
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.mozilla.fenix.R
import org.mozilla.fenix.helpers.MatcherHelper.itemWithResId
import org.mozilla.fenix.helpers.TestAssetHelper.waitingTime
import org.mozilla.fenix.helpers.TestHelper.mDevice
import org.mozilla.fenix.helpers.TestHelper.packageName
Expand Down Expand Up @@ -57,7 +58,11 @@ class CollectionRobot {
// names a collection saved from tab drawer
fun typeCollectionNameAndSave(collectionName: String) {
collectionNameTextField().text = collectionName
mDevice.findObject(UiSelector().textContains("OK")).click()
addCollectionButtonPanel.waitForExists(waitingTime)
addCollectionOkButton.also {
it.waitForExists(waitingTime)
it.click()
}
}

fun verifyTabsSelectedCounterText(numOfTabs: Int) {
Expand Down Expand Up @@ -289,3 +294,8 @@ private fun backButton() =
mDevice.findObject(
UiSelector().resourceId("$packageName:id/back_button"),
)
private val addCollectionButtonPanel =
itemWithResId("$packageName:id/buttonPanel")

private val addCollectionOkButton =
itemWithResId("android:id/button1")

0 comments on commit 9a1da0e

Please sign in to comment.