Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .idea/dictionaries/luke.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ blocks:
jobs:
- name: 'Build Project'
commands:
# Android Gradle plugin requires Java 11
# - sem-version java 11
# print debug info
- cat /proc/cpuinfo
# print Java version
Expand Down Expand Up @@ -101,8 +99,6 @@ blocks:
execution_time_limit:
minutes: 15
commands:
# switched to use java 11 to be able to run parametrized Robolectric tests
# - sem-version java 11
# run JUnit tests
- ./script/ci-junit-tests.sh

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import com.flowcrypt.email.api.email.model.AttachmentInfo
import com.flowcrypt.email.api.email.model.IncomingMessageInfo
import com.flowcrypt.email.database.FlowCryptRoomDatabase
import com.flowcrypt.email.database.entity.AttachmentEntity
import com.flowcrypt.email.matchers.CustomMatchers.Companion.isToast
import com.flowcrypt.email.ui.activity.base.BaseActivity
import com.flowcrypt.email.util.TestGeneralUtil
import com.google.android.material.snackbar.Snackbar
Expand Down Expand Up @@ -122,12 +121,14 @@ abstract class BaseTest : BaseActivityTestImplementation {
* @param delay If we have to check a few toasts one by one
* we need to have some timeout between checking.
*/
//todo-denbond7 https://github.com/android/android-test/issues/803
@Deprecated("Toast message assertions not working with android 11 and target sdk 30")
protected fun isToastDisplayed(message: String, delay: Long? = null) {
onView(withText(message))
/*onView(withText(message))
.inRoot(isToast())
.check(matches(isDisplayed()))

delay?.let { Thread.sleep(it) }
delay?.let { Thread.sleep(it) }*/
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import org.hamcrest.TypeSafeMatcher
* See details here
* https://stackoverflow.com/questions/28390574/checking-toast-message-in-android-espresso
*/
//todo-denbond7 https://github.com/android/android-test/issues/803
class ToastMatcher @RemoteMsgConstructor constructor() : TypeSafeMatcher<Root?>() {
override fun describeTo(description: Description) {
description.appendText("is toast")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import org.junit.Test
import org.junit.rules.RuleChain
import org.junit.rules.TestRule
import org.junit.runner.RunWith
import java.net.HttpURLConnection

/**
* @author Denis Bondarenko
Expand Down Expand Up @@ -78,12 +79,12 @@ class AttesterSettingsFragmentTest : BaseTest() {
if (request.path?.startsWith("/pub", ignoreCase = true) == true) {
val lastSegment = request.requestUrl?.pathSegments?.lastOrNull()
if (AccountDaoManager.getDefaultAccountDao().email.equals(lastSegment, true)) {
return MockResponse().setResponseCode(200)
return MockResponse().setResponseCode(HttpURLConnection.HTTP_OK)
.setBody(TestGeneralUtil.readResourceAsString("1.txt"))
}
}

return MockResponse().setResponseCode(404)
return MockResponse().setResponseCode(HttpURLConnection.HTTP_NOT_FOUND)
}
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import com.flowcrypt.email.rules.ScreenshotTestRule
import com.flowcrypt.email.ui.activity.base.BaseBackupKeysFragmentTest
import com.flowcrypt.email.util.GeneralUtil
import com.flowcrypt.email.util.TestGeneralUtil
import org.hamcrest.CoreMatchers.not
import org.junit.Rule
import org.junit.Test
import org.junit.rules.RuleChain
Expand Down Expand Up @@ -71,10 +72,14 @@ class BackupKeysFragmentSingleKeyPassphraseInRamTest : BaseBackupKeysFragmentTes
.check(matches(isDisplayed()))
.perform(click())

onView(withId(R.id.btBackup))
.check(matches(not(isDisplayed())))

isToastDisplayed(getResString(R.string.backed_up_successfully))
}

@Test
@NotReadyForCI
fun testNeedPassphraseDownloadOptionSingleFingerprint() {
onView(withId(R.id.rBDownloadOption))
.check(matches(isDisplayed()))
Expand All @@ -95,6 +100,9 @@ class BackupKeysFragmentSingleKeyPassphraseInRamTest : BaseBackupKeysFragmentTes

TestGeneralUtil.deleteFiles(listOf(file))

onView(withId(R.id.btBackup))
.check(matches(not(isDisplayed())))

isToastDisplayed(getResString(R.string.backed_up_successfully))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import com.flowcrypt.email.rules.RetryRule
import com.flowcrypt.email.rules.ScreenshotTestRule
import com.flowcrypt.email.ui.activity.base.BaseBackupKeysFragmentTest
import com.flowcrypt.email.util.TestGeneralUtil
import org.hamcrest.CoreMatchers.not
import org.junit.Rule
import org.junit.Test
import org.junit.rules.RuleChain
Expand Down Expand Up @@ -70,6 +71,9 @@ class BackupKeysFragmentTest : BaseBackupKeysFragmentTest() {
onView(withId(R.id.btBackup))
.check(matches(isDisplayed()))
.perform(click())

onView(withId(R.id.btBackup))
.check(matches(not(isDisplayed())))
isToastDisplayed(getResString(R.string.backed_up_successfully))
}

Expand All @@ -87,6 +91,9 @@ class BackupKeysFragmentTest : BaseBackupKeysFragmentTest() {
.perform(click())

TestGeneralUtil.deleteFiles(listOf(file))

onView(withId(R.id.btBackup))
.check(matches(not(isDisplayed())))
isToastDisplayed(getResString(R.string.backed_up_successfully))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import com.flowcrypt.email.rules.RetryRule
import com.flowcrypt.email.rules.ScreenshotTestRule
import com.flowcrypt.email.ui.activity.base.BaseBackupKeysFragmentTest
import com.flowcrypt.email.util.TestGeneralUtil
import org.hamcrest.CoreMatchers.not
import org.junit.Rule
import org.junit.Test
import org.junit.rules.RuleChain
Expand Down Expand Up @@ -62,6 +63,10 @@ class BackupKeysFragmentTwoKeysSamePassphraseTest : BaseBackupKeysFragmentTest()
onView(withId(R.id.btBackup))
.check(matches(isDisplayed()))
.perform(click())

onView(withId(R.id.btBackup))
.check(matches(not(isDisplayed())))

isToastDisplayed(getResString(R.string.backed_up_successfully))
}

Expand All @@ -79,6 +84,10 @@ class BackupKeysFragmentTwoKeysSamePassphraseTest : BaseBackupKeysFragmentTest()
.perform(click())

TestGeneralUtil.deleteFiles(listOf(file))

onView(withId(R.id.btBackup))
.check(matches(not(isDisplayed())))

isToastDisplayed(getResString(R.string.backed_up_successfully))
}
}
Loading