From 64051bc1ea866274d7623d43154132714fc1ef49 Mon Sep 17 00:00:00 2001 From: Dmitry Sotnikov Date: Thu, 23 Dec 2021 16:17:24 +0200 Subject: [PATCH 1/2] update for checkMessageProcessingErrors Added new verification for "key mismatch unexpectedly produces a modal", updated "not integrity protected - should show a warning and not decrypt automatically" message check --- appium/config/wdio.live.conf.js | 4 +- appium/tests/data/index.ts | 12 +++-- .../CheckMessageProcessingErrors.spec.ts | 46 +++++++++++++------ 3 files changed, 43 insertions(+), 19 deletions(-) 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..de58b0f59 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' + }, + keyMismatchUnexpectedly: { + 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..85f64036e 100644 --- a/appium/tests/specs/live/inbox/CheckMessageProcessingErrors.spec.ts +++ b/appium/tests/specs/live/inbox/CheckMessageProcessingErrors.spec.ts @@ -29,12 +29,16 @@ 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 keyMismatchUnexpectedlySugject = CommonData.keyMismatchUnexpectedly.subject; + const keyMismatchUnexpectedlyEmail = CommonData.keyMismatchUnexpectedly.senderEmail; + const keyMismatchUnexpectedlyText = CommonData.keyMismatchUnexpectedly.message; + const keyMismatchUnexpectedlyEncryptedBadge = CommonData.keyMismatchUnexpectedly.encryptedBadgeText; + const keyMismatchUnexpectedlySignatureBadge= CommonData.keyMismatchUnexpectedly.signatureBadgeText; + const firstAttachmentName = CommonData.keyMismatchUnexpectedly.firstAttachmentName; await SplashScreen.login(); await SetupKeyScreen.setPassPhrase(); @@ -66,16 +70,28 @@ describe('INBOX: ', () => { await EmailScreen.checkOpenedEmail(wrongChecksumEmail, wrongChecksumSubject, wrongChecksumText); await EmailScreen.checkEncryptionBadge(decryptErrorBadgeText); - // Checking integrity protected message BUG:https://github.com/FlowCrypt/flowcrypt-ios/issues/1144 + // Checking 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 key mismatch unexpectedly produces a modal message + 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(keyMismatchUnexpectedlySugject); + await MailFolderScreen.clickOnEmailBySubject(keyMismatchUnexpectedlySugject); + await EmailScreen.checkOpenedEmail(keyMismatchUnexpectedlyEmail, keyMismatchUnexpectedlySugject, keyMismatchUnexpectedlyText); + await EmailScreen.checkEncryptionBadge(keyMismatchUnexpectedlyEncryptedBadge); + await EmailScreen.checkSignatureBadge(keyMismatchUnexpectedlySignatureBadge); + await EmailScreen.checkAttachment(firstAttachmentName); }); }); From 0071d77c38c9191a8d820dc4e3053855c9513def Mon Sep 17 00:00:00 2001 From: Dmitry Sotnikov Date: Fri, 24 Dec 2021 08:40:52 +0200 Subject: [PATCH 2/2] fixes after review --- appium/tests/data/index.ts | 2 +- .../CheckMessageProcessingErrors.spec.ts | 32 +++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/appium/tests/data/index.ts b/appium/tests/data/index.ts index de58b0f59..7dbcfbd6f 100644 --- a/appium/tests/data/index.ts +++ b/appium/tests/data/index.ts @@ -72,7 +72,7 @@ export const CommonData = { message: 'Message is missing integrity checks (MDC). The sender should update their outdated software and resend.', senderEmail: 'flowcrypt.compatibility@gmail.com', }, - keyMismatchUnexpectedly: { + keyMismatch: { subject: 'key mismatch unexpectedly produces a modal', message: 'Here are the images for testing compatibility.', senderEmail: 'sunitnandi834@gmail.com', diff --git a/appium/tests/specs/live/inbox/CheckMessageProcessingErrors.spec.ts b/appium/tests/specs/live/inbox/CheckMessageProcessingErrors.spec.ts index 85f64036e..2c922e413 100644 --- a/appium/tests/specs/live/inbox/CheckMessageProcessingErrors.spec.ts +++ b/appium/tests/specs/live/inbox/CheckMessageProcessingErrors.spec.ts @@ -33,18 +33,18 @@ describe('INBOX: ', () => { const notIntegrityProtectedEmail = CommonData.notIntegrityProtected.senderEmail; const notIntegrityProtectedText = CommonData.notIntegrityProtected.message; - const keyMismatchUnexpectedlySugject = CommonData.keyMismatchUnexpectedly.subject; - const keyMismatchUnexpectedlyEmail = CommonData.keyMismatchUnexpectedly.senderEmail; - const keyMismatchUnexpectedlyText = CommonData.keyMismatchUnexpectedly.message; - const keyMismatchUnexpectedlyEncryptedBadge = CommonData.keyMismatchUnexpectedly.encryptedBadgeText; - const keyMismatchUnexpectedlySignatureBadge= CommonData.keyMismatchUnexpectedly.signatureBadgeText; - const firstAttachmentName = CommonData.keyMismatchUnexpectedly.firstAttachmentName; + 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); @@ -54,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); @@ -64,13 +64,13 @@ 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 + // Checking error for integrity protected message await EmailScreen.clickBackButton(); await SearchScreen.clickBackButton(); await MailFolderScreen.checkInboxScreen(); @@ -81,17 +81,17 @@ describe('INBOX: ', () => { await EmailScreen.checkOpenedEmail(notIntegrityProtectedEmail, notIntegrityProtectedSubject, notIntegrityProtectedText); await EmailScreen.checkEncryptionBadge(decryptErrorBadgeText); - // Checking key mismatch unexpectedly produces a modal message + // Checking if message body is rendered with key mismatch await EmailScreen.clickBackButton(); await SearchScreen.clickBackButton(); await MailFolderScreen.checkInboxScreen(); await MailFolderScreen.clickSearchButton(); - await SearchScreen.searchAndClickEmailBySubject(keyMismatchUnexpectedlySugject); - await MailFolderScreen.clickOnEmailBySubject(keyMismatchUnexpectedlySugject); - await EmailScreen.checkOpenedEmail(keyMismatchUnexpectedlyEmail, keyMismatchUnexpectedlySugject, keyMismatchUnexpectedlyText); - await EmailScreen.checkEncryptionBadge(keyMismatchUnexpectedlyEncryptedBadge); - await EmailScreen.checkSignatureBadge(keyMismatchUnexpectedlySignatureBadge); + 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); }); });