Skip to content

Commit

Permalink
emulator 0.| #2914
Browse files Browse the repository at this point in the history
  • Loading branch information
DenBond7 committed Feb 7, 2025
1 parent 6d59379 commit 44fed53
Show file tree
Hide file tree
Showing 15 changed files with 78 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com
* Contributors: DenBond7
* Contributors: denbond7
*/

package com.flowcrypt.email.ui
Expand Down Expand Up @@ -31,6 +31,7 @@ import com.flowcrypt.email.util.AuthCredentialsManager
import com.flowcrypt.email.util.TestGeneralUtil
import org.hamcrest.CoreMatchers.anyOf
import org.hamcrest.CoreMatchers.startsWith
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.junit.rules.RuleChain
Expand Down Expand Up @@ -59,6 +60,7 @@ class AddOtherAccountFlowTest : AddOtherAccountBaseTest() {
.around(ScreenshotTestRule())

@Test
@Ignore("flaky 8")
fun testShowWarningIfAuthFail() {
enableAdvancedMode()
val credentials = AuthCredentialsManager.getAuthCredentials("user_with_not_existed_server.json")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com
* Contributors: DenBond7
* Contributors: denbond7
*/

package com.flowcrypt.email.ui
Expand Down Expand Up @@ -42,6 +42,7 @@ import okhttp3.mockwebserver.Dispatcher
import okhttp3.mockwebserver.MockResponse
import okhttp3.mockwebserver.RecordedRequest
import org.junit.Assert.assertTrue
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.junit.rules.RuleChain
Expand Down Expand Up @@ -181,6 +182,7 @@ class ComposeScreenDraftGmailAPIFlowTest : BaseComposeScreenTest() {
.around(ScreenshotTestRule())

@Test
@Ignore("flaky 8")
fun testSavingDraftViaGmailAPI() {
activeActivityRule?.launch(intent)
registerAllIdlingResources()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.BeforeClass
import org.junit.ClassRule
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.junit.rules.RuleChain
Expand Down Expand Up @@ -163,6 +164,7 @@ class ComposeScreenFlowTest : BaseComposeScreenTest() {
}

@Test
@Ignore("flaky 5")
fun testEmptyEmailMsg() {
activeActivityRule?.launch(intent)
registerAllIdlingResources()
Expand Down Expand Up @@ -327,6 +329,7 @@ class ComposeScreenFlowTest : BaseComposeScreenTest() {
}

@Test
@Ignore("flaky 4")
fun testDeletingAtts() {
activeActivityRule?.launch(intent)
waitForObjectWithText(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com
* Contributors: DenBond7
* Contributors: denbond7
*/

package com.flowcrypt.email.ui
Expand Down Expand Up @@ -32,6 +32,7 @@ import com.flowcrypt.email.ui.adapter.RecipientChipRecyclerViewAdapter
import com.flowcrypt.email.ui.base.BaseComposeScreenTest
import com.flowcrypt.email.util.TestGeneralUtil
import org.hamcrest.Matchers.allOf
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.junit.rules.RuleChain
Expand Down Expand Up @@ -90,6 +91,7 @@ class ComposeScreenImportRecipientPubKeyFlowTest : BaseComposeScreenTest() {
}

@Test
@Ignore("flaky 7")
fun testImportRecipientPubKeyFromClipboard() {
fillDataAndMoveToImportPublicKeyScreen()
addTextToClipboard("public key", publicKey)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com
* Contributors: DenBond7
* Contributors: denbond7
*/

package com.flowcrypt.email.ui
Expand All @@ -26,6 +26,7 @@ import com.flowcrypt.email.rules.GrantPermissionRuleChooser
import com.flowcrypt.email.rules.RetryRule
import com.flowcrypt.email.rules.ScreenshotTestRule
import com.flowcrypt.email.ui.base.BaseComposeScreenNoKeyAvailableTest
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.junit.rules.RuleChain
Expand Down Expand Up @@ -62,6 +63,7 @@ class ComposeScreenNoKeyAvailableMultipleKeysWithPassphraseInRamFlowTest :
.around(ScreenshotTestRule())

@Test
@Ignore("flaky")
fun testAddEmailToExistingKey() {
doTestAddEmailToExistingKey {
waitForObjectWithText(getResString(android.R.string.ok), 2000)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com
* Contributors: DenBond7
* Contributors: denbond7
*/

package com.flowcrypt.email.ui
Expand Down Expand Up @@ -86,6 +86,7 @@ class ComposeScreenNoKeyAvailableSingleKeyWithPassphraseInDatabaseFlowTest : Bas
}

@Test
@Ignore("flaky")
fun testAddEmailToExistingSingleKeyPassphraseInDatabase() {
doTestAddEmailToExistingKey {
//no more additional actions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com
* Contributors: DenBond7
* Contributors: denbond7
*/

package com.flowcrypt.email.ui
Expand Down Expand Up @@ -36,6 +36,7 @@ import okhttp3.mockwebserver.RecordedRequest
import org.hamcrest.CoreMatchers.containsString
import org.junit.After
import org.junit.Before
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.junit.rules.RuleChain
Expand Down Expand Up @@ -134,6 +135,7 @@ class ImportRecipientsFromSourceFragmentFlowTest : BaseTest() {
}

@Test
@Ignore("flaky 4")
fun testFetchKeyFromAttesterForExistedUserImeAction() {
onView(withId(R.id.eTKeyIdOrEmail))
.perform(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com
* Contributors: DenBond7
* Contributors: denbond7
*/

package com.flowcrypt.email.ui
Expand Down Expand Up @@ -50,6 +50,7 @@ import okhttp3.mockwebserver.Dispatcher
import okhttp3.mockwebserver.MockResponse
import okhttp3.mockwebserver.RecordedRequest
import org.hamcrest.Matchers.not
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.junit.rules.RuleChain
Expand Down Expand Up @@ -209,6 +210,7 @@ class MainSignInFragmentFlowTest : BaseSignTest() {
}

@Test
@Ignore("flaky 8")
fun testClientConfigurationCombinationNotSupportedForForbidCreatingPrivateKeyMissing() {
setupAndClickSignInButton(
genMockGoogleSignInAccountJson(
Expand All @@ -226,6 +228,7 @@ class MainSignInFragmentFlowTest : BaseSignTest() {
}

@Test
@Ignore("flaky 8")
fun testErrorGetPrvKeysViaEkm() {
setupAndClickSignInButton(genMockGoogleSignInAccountJson(EMAIL_GET_KEYS_VIA_EKM_ERROR))
isDialogWithTextDisplayed(decorView, EKM_ERROR)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import okhttp3.mockwebserver.RecordedRequest
import okio.GzipSource
import okio.buffer
import org.junit.Assert.assertEquals
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.junit.rules.RuleChain
Expand Down Expand Up @@ -98,6 +99,7 @@ class MessageDetailsChangeGmailLabelsFlowTest : BaseGmailLabelsFlowTest() {
.around(ScreenshotTestRule())

@Test
@Ignore("flaky 1")
fun testLabelsManagement() {
val allLabels = initLabelIds()
lastLabelIds = (allLabels.take(4) + allLabels.takeLast(1)).toMutableList()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ import org.junit.Assert.assertArrayEquals
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
import org.junit.Before
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.junit.rules.RuleChain
Expand Down Expand Up @@ -139,6 +140,7 @@ class MessageDetailsFlowTest : BaseMessageDetailsFlowTest() {
}

@Test
@Ignore("flaky")
fun testTopReplyButton() {
val incomingMessageInfo = testTopReplyAction(getResString(R.string.reply))
checkQuotesFunctionality(incomingMessageInfo)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com
* Contributors: DenBond7
* Contributors: denbond7
*/

package com.flowcrypt.email.ui.fragment.isolation.incontainer
Expand Down Expand Up @@ -28,6 +28,7 @@ import com.flowcrypt.email.rules.ScreenshotTestRule
import com.flowcrypt.email.ui.activity.fragment.LegalSettingsFragment
import org.hamcrest.Matchers.allOf
import org.junit.Before
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.junit.rules.RuleChain
Expand Down Expand Up @@ -74,6 +75,7 @@ class LegalSettingsFragmentInIsolationTest : BaseTest() {
}

@Test
@Ignore("flaky")
fun testSwipeInViewPager() {
onView(
allOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import okhttp3.mockwebserver.Dispatcher
import okhttp3.mockwebserver.MockResponse
import okhttp3.mockwebserver.RecordedRequest
import org.hamcrest.CoreMatchers.startsWith
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.junit.rules.RuleChain
Expand Down Expand Up @@ -72,6 +73,7 @@ class ComposeScreenForwardWithGmailApiSignatureFlowTest :
.around(ScreenshotTestRule())

@Test
@Ignore("flaky")
fun testAddingSignatureAfterStart() {
//need to wait while the app loads the messages list
Thread.sleep(2000)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import okhttp3.mockwebserver.Dispatcher
import okhttp3.mockwebserver.MockResponse
import okhttp3.mockwebserver.RecordedRequest
import org.hamcrest.Matchers.allOf
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.junit.rules.RuleChain
Expand Down Expand Up @@ -84,6 +85,7 @@ class ThreadsListGmailApiFlowTest : BaseGmailApiTest(
.around(ScreenshotTestRule())

@Test
@Ignore("flaky")
fun testShowCorrectThreadsDetailsInList() {
//need to wait while the app loads the thread list
waitForObjectWithText(SUBJECT_EXISTING_STANDARD, TimeUnit.SECONDS.toMillis(10))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import com.flowcrypt.email.rules.GrantPermissionRuleChooser
import com.flowcrypt.email.rules.RetryRule
import com.flowcrypt.email.rules.ScreenshotTestRule
import org.hamcrest.Matchers.allOf
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.junit.rules.RuleChain
Expand Down Expand Up @@ -70,6 +71,7 @@ class ComposeScreenPasswordProtectedDisallowedTermsFlowTest :
.around(ScreenshotTestRule())

@Test
@Ignore("flaky")
fun testDialogWithErrorText() {
intentsRelease()

Expand Down
41 changes: 41 additions & 0 deletions script/run_tests_in_loop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env bash
#
# © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com
# Contributors: denbond7
#

set -o xtrace

attempts=$1

if [[ -z attempts ]]; then
echo "Please specify attempts count"
exit 1
else
if [[ $attempts =~ ^[\-0-9]+$ ]] && ((attempts > 0)); then
echo "We are going to run tests for $attempts iterations"
echo "------------------------------------------------------"
else
echo "Please specify attempts count as a number > 0"
exit 1
fi
fi

for ((i=1;i<=attempts;i++)); do
echo "Run attempt $i"
./script/adb_kill_all_emualtor.sh
sleep 60
"$ANDROID_HOME/emulator/emulator" -avd ci-emulator -no-snapshot -no-window -no-boot-anim -no-audio -gpu auto -read-only -no-metrics &
./script/ci-wait-for-emulator.sh
./script/ci-instrumentation-tests-without-mailserver.sh 4 2
testResults=$?
if [[ $testResults -ne 0 ]]; then
echo "Attempt $i failed"
echo "Stopping..."
exit 1
else
echo "------------------------------------------------------"
fi
done

echo "Tests completed for $attempts iterations"

0 comments on commit 44fed53

Please sign in to comment.