Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added tests for view message processing errors #1154

Merged
merged 1 commit into from
Dec 3, 2021
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
25 changes: 25 additions & 0 deletions appium/tests/data/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,28 @@ export const CommonData = {
subject: 'Encrypted message with key mismatch',
message: 'Could not decrypt:',
},
encryptedMDCHashMismatchEmail: {
senderEmail: '[email protected]',
subject: 'encrypted - MDC hash mismatch - modification detected - should fail',
message: 'bad_mdc: Security threat - opening this message is dangerous because it was modified in transit.',
},
encryptedForAnotherPublicKeyEmail: {
subject: 'message encrypted for another public key (only one pubkey used)',
message: 'key_mismatch: Missing appropriate key',
senderEmail: '[email protected]',
},
wrongChecksumEmail: {
subject: 'wrong checksum',
message: 'format: Error: Ascii armor integrity check on message failed: \'FdCC\' should be \'FddK\'',
senderEmail: '[email protected]',
},
notIntegrityProtected: {
subject: 'not integrity protected - should show a warning and not decrypt automatically',
message: '',
senderEmail: '[email protected]',
encryptionBadgeText: 'not encrypted',
signatureBadgeText: 'not signed'
},
recipientWithoutPublicKey: {
email: '[email protected]'
},
Expand All @@ -55,5 +77,8 @@ export const CommonData = {
' Please ask them to send you updated public key. If this is an enterprise installation, please ask your systems admin.',
revokedPublicKey: 'Could not compose message One or more of your recipients have revoked public keys (marked in red).' +
' Please ask them to send you a new public key. If this is an enterprise installation, please ask your systems admin.'
},
decryptErrorBadge: {
badgeText: 'decrypt error'
}
};
83 changes: 83 additions & 0 deletions appium/tests/specs/inbox/CheckMessageProcessingErrors.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import {
SplashScreen,
SetupKeyScreen,
MailFolderScreen,
EmailScreen,
SearchScreen
} from '../../screenobjects/all-screens';

import { CommonData } from '../../data';

describe('INBOX: ', () => {

it('user is able to view message processing errors', async () => {

const decryptErrorBadgeText = CommonData.decryptErrorBadge.badgeText;

// Const for MDC hash mismatch message
const encryptedMDCEmail = CommonData.encryptedMDCHashMismatchEmail.senderEmail;
const encryptedMDCSubject = CommonData.encryptedMDCHashMismatchEmail.subject;
const encryptedMDCText = CommonData.encryptedMDCHashMismatchEmail.message;

// Const for message encrypted for another public key
const encryptedForAnotherPublicKeySubject = CommonData.encryptedForAnotherPublicKeyEmail.subject;
const encryptedForAnotherPublicKeyEmail = CommonData.encryptedForAnotherPublicKeyEmail.senderEmail;
const encryptedForAnotherPublicKeyText = CommonData.encryptedForAnotherPublicKeyEmail.message;

// Const for encrypted for a wrong checksum message
const wrongChecksumSubject = CommonData.wrongChecksumEmail.subject;
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;

await SplashScreen.login();
await SetupKeyScreen.setPassPhrase();
await MailFolderScreen.checkInboxScreen();

// Checking MDC hash mismatch message
await MailFolderScreen.searchEmailBySubject(encryptedMDCSubject);
await MailFolderScreen.clickOnEmailBySubject(encryptedMDCSubject);
await EmailScreen.enterPassPhrase();
await EmailScreen.clickOkButton();
await EmailScreen.checkOpenedEmail(encryptedMDCEmail, encryptedMDCSubject, encryptedMDCText);
await EmailScreen.checkEncryptionBadge(decryptErrorBadgeText);

await EmailScreen.clickBackButton();
await SearchScreen.clickBackButton();
await MailFolderScreen.checkInboxScreen();

// Checking message encrypted for another public key
await MailFolderScreen.searchEmailBySubject(encryptedForAnotherPublicKeySubject);
await MailFolderScreen.clickOnEmailBySubject(encryptedForAnotherPublicKeySubject);
await EmailScreen.checkOpenedEmail(encryptedForAnotherPublicKeyEmail, encryptedForAnotherPublicKeySubject, encryptedForAnotherPublicKeyText);
await EmailScreen.checkEncryptionBadge(decryptErrorBadgeText);

await EmailScreen.clickBackButton();
await SearchScreen.clickBackButton();
await MailFolderScreen.checkInboxScreen();

// Checking wrong checksum message
await MailFolderScreen.searchEmailBySubject(wrongChecksumSubject);
await MailFolderScreen.clickOnEmailBySubject(wrongChecksumSubject);
await EmailScreen.checkOpenedEmail(wrongChecksumEmail, wrongChecksumSubject, wrongChecksumText);
await EmailScreen.checkEncryptionBadge(decryptErrorBadgeText);

// Checking integrity protected message BUG:https://github.com/FlowCrypt/flowcrypt-ios/issues/1144

// await EmailScreen.clickBackButton();
// await SearchScreen.clickBackButton();
// await MailFolderScreen.checkInboxScreen();

// await MailFolderScreen.searchEmailBySubject(notIntegrityProtectedSubject);
// await MailFolderScreen.clickOnEmailBySubject(notIntegrityProtectedSubject);
// // await EmailScreen.checkOpenedEmail(notIntegrityProtectedEmail, notIntegrityProtectedSubject, notIntegrityProtectedText);
// await EmailScreen.checkEncryptionBadge(notIntegrityProtectedEncryptionBadge);
// await EmailScreen.checkSignatureBadge(notIntegrityProtectedSignatureBadge);
});
});