diff --git a/appium/config/wdio.live.conf.js b/appium/config/wdio.live.conf.js index 6dd25e3fc..3075d83a9 100644 --- a/appium/config/wdio.live.conf.js +++ b/appium/config/wdio.live.conf.js @@ -19,7 +19,9 @@ config.suites = { login: [ './tests/specs/live/login/*.spec.ts' ], - update: ['./tests/specs/live/update/*.spec.ts'] + update: [ + './tests/specs/live/update/*.spec.ts' + ] }; config.capabilities = [ diff --git a/appium/tests/data/index.ts b/appium/tests/data/index.ts index 7671308b4..7dbcfbd6f 100644 --- a/appium/tests/data/index.ts +++ b/appium/tests/data/index.ts @@ -69,10 +69,16 @@ export const CommonData = { }, notIntegrityProtected: { subject: 'not integrity protected - should show a warning and not decrypt automatically', - message: '', + message: 'Message is missing integrity checks (MDC). The sender should update their outdated software and resend.', senderEmail: 'flowcrypt.compatibility@gmail.com', - encryptionBadgeText: 'not encrypted', - signatureBadgeText: 'not signed' + }, + keyMismatch: { + subject: 'key mismatch unexpectedly produces a modal', + message: 'Here are the images for testing compatibility.', + senderEmail: 'sunitnandi834@gmail.com', + encryptedBadgeText: 'encrypted', + signatureBadgeText: 'not signed', + firstAttachmentName: 'Screenshot_20180422_125217.png.asc' }, recipientWithoutPublicKey: { email: 'no.publickey@flowcrypt.com' diff --git a/appium/tests/specs/live/inbox/CheckMessageProcessingErrors.spec.ts b/appium/tests/specs/live/inbox/CheckMessageProcessingErrors.spec.ts index e6177070e..2c922e413 100644 --- a/appium/tests/specs/live/inbox/CheckMessageProcessingErrors.spec.ts +++ b/appium/tests/specs/live/inbox/CheckMessageProcessingErrors.spec.ts @@ -29,18 +29,22 @@ describe('INBOX: ', () => { const wrongChecksumEmail = CommonData.wrongChecksumEmail.senderEmail; const wrongChecksumText = CommonData.wrongChecksumEmail.message; - // Const for not integrity protected message BUG:https://github.com/FlowCrypt/flowcrypt-ios/issues/1144 - // const notIntegrityProtectedSubject = CommonData.notIntegrityProtected.subject; - // // const notIntegrityProtectedEmail = CommonData.notIntegrityProtected.senderEmail; - // // const notIntegrityProtectedText = CommonData.notIntegrityProtected.message; - // const notIntegrityProtectedEncryptionBadge = CommonData.notIntegrityProtected.encryptionBadgeText; - // const notIntegrityProtectedSignatureBadge = CommonData.notIntegrityProtected.signatureBadgeText; + const notIntegrityProtectedSubject = CommonData.notIntegrityProtected.subject; + const notIntegrityProtectedEmail = CommonData.notIntegrityProtected.senderEmail; + const notIntegrityProtectedText = CommonData.notIntegrityProtected.message; + + const keyMismatchSubject = CommonData.keyMismatch.subject; + const keyMismatchEmail = CommonData.keyMismatch.senderEmail; + const keyMismatchText = CommonData.keyMismatch.message; + const keyMismatchEncryptedBadge = CommonData.keyMismatch.encryptedBadgeText; + const keyMismatchSignatureBadge= CommonData.keyMismatch.signatureBadgeText; + const firstAttachmentName = CommonData.keyMismatch.firstAttachmentName; await SplashScreen.login(); await SetupKeyScreen.setPassPhrase(); await MailFolderScreen.checkInboxScreen(); - // Checking MDC hash mismatch message + // Checking error for MDC hash mismatch message await MailFolderScreen.clickSearchButton(); await SearchScreen.searchAndClickEmailBySubject(encryptedMDCSubject); await EmailScreen.checkOpenedEmail(encryptedMDCEmail, encryptedMDCSubject, encryptedMDCText); @@ -50,7 +54,7 @@ describe('INBOX: ', () => { await SearchScreen.clickBackButton(); await MailFolderScreen.checkInboxScreen(); - // Checking message encrypted for another public key + // Checking error message encrypted for another public key await MailFolderScreen.clickSearchButton(); await SearchScreen.searchAndClickEmailBySubject(encryptedForAnotherPublicKeySubject); await EmailScreen.checkOpenedEmail(encryptedForAnotherPublicKeyEmail, encryptedForAnotherPublicKeySubject, encryptedForAnotherPublicKeyText); @@ -60,22 +64,34 @@ describe('INBOX: ', () => { await SearchScreen.clickBackButton(); await MailFolderScreen.checkInboxScreen(); - // Checking wrong checksum message + // Checking error for wrong checksum message await MailFolderScreen.clickSearchButton(); await SearchScreen.searchAndClickEmailBySubject(wrongChecksumSubject); await EmailScreen.checkOpenedEmail(wrongChecksumEmail, wrongChecksumSubject, wrongChecksumText); await EmailScreen.checkEncryptionBadge(decryptErrorBadgeText); - // Checking integrity protected message BUG:https://github.com/FlowCrypt/flowcrypt-ios/issues/1144 + // Checking error for integrity protected message + await EmailScreen.clickBackButton(); + await SearchScreen.clickBackButton(); + await MailFolderScreen.checkInboxScreen(); + await MailFolderScreen.clickSearchButton(); - // await EmailScreen.clickBackButton(); - // await SearchScreen.clickBackButton(); - // await MailFolderScreen.checkInboxScreen(); + await SearchScreen.searchAndClickEmailBySubject(notIntegrityProtectedSubject); + await MailFolderScreen.clickOnEmailBySubject(notIntegrityProtectedSubject); + await EmailScreen.checkOpenedEmail(notIntegrityProtectedEmail, notIntegrityProtectedSubject, notIntegrityProtectedText); + await EmailScreen.checkEncryptionBadge(decryptErrorBadgeText); + + // Checking if message body is rendered with key mismatch + await EmailScreen.clickBackButton(); + await SearchScreen.clickBackButton(); + await MailFolderScreen.checkInboxScreen(); + await MailFolderScreen.clickSearchButton(); - // await MailFolderScreen.searchEmailBySubject(notIntegrityProtectedSubject); - // await MailFolderScreen.clickOnEmailBySubject(notIntegrityProtectedSubject); - // // await EmailScreen.checkOpenedEmail(notIntegrityProtectedEmail, notIntegrityProtectedSubject, notIntegrityProtectedText); - // await EmailScreen.checkEncryptionBadge(notIntegrityProtectedEncryptionBadge); - // await EmailScreen.checkSignatureBadge(notIntegrityProtectedSignatureBadge); + await SearchScreen.searchAndClickEmailBySubject(keyMismatchSubject); + await MailFolderScreen.clickOnEmailBySubject(keyMismatchSubject); + await EmailScreen.checkOpenedEmail(keyMismatchEmail, keyMismatchSubject, keyMismatchText); + await EmailScreen.checkEncryptionBadge(keyMismatchEncryptedBadge); + await EmailScreen.checkSignatureBadge(keyMismatchSignatureBadge); + await EmailScreen.checkAttachment(firstAttachmentName); }); });