diff --git a/appium/tests/data/index.ts b/appium/tests/data/index.ts index 9a76cc20e..f74f1ea07 100644 --- a/appium/tests/data/index.ts +++ b/appium/tests/data/index.ts @@ -41,9 +41,19 @@ export const CommonData = { recipientWithoutPublicKey: { email: 'no.publickey@flowcrypt.com' }, + recipientWithExpiredPublicKey: { + email: 'expired@flowcrypt.com' + }, + recipientWithRevokedPublicKey: { + email: 'revoked@flowcrypt.com' + }, errors: { noPublicKey: 'Could not compose message One or more of your recipients are missing a public key (marked in gray). ' + 'Please ask them to share it with you, or ask them to also set up FlowCrypt.', - wrongPassPhrase: 'Could not compose message This pass phrase did not match your signing private key' + wrongPassPhrase: 'Could not compose message This pass phrase did not match your signing private key', + expiredPublicKey: 'Could not compose message One or more of your recipients have expired public keys (marked in orange).' + + ' 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.' } }; diff --git a/appium/tests/specs/composeEmail/SendEmailToRecipientWithExpiredAndRevokedPublicKeys.spec.ts b/appium/tests/specs/composeEmail/SendEmailToRecipientWithExpiredAndRevokedPublicKeys.spec.ts new file mode 100644 index 000000000..83bf1662c --- /dev/null +++ b/appium/tests/specs/composeEmail/SendEmailToRecipientWithExpiredAndRevokedPublicKeys.spec.ts @@ -0,0 +1,44 @@ +import { + SplashScreen, + SetupKeyScreen, + MailFolderScreen, + NewMessageScreen +} from '../../screenobjects/all-screens'; + +import { CommonData } from '../../data'; + +describe('COMPOSE EMAIL: ', () => { + + it('sending message to user with expired/revoked public key produces modal', async () => { + + const expiredPublicKey = CommonData.recipientWithExpiredPublicKey.email; + const revokedpublicKey = CommonData.recipientWithRevokedPublicKey.email; + const emailSubject = CommonData.simpleEmail.subject; + const emailText = CommonData.simpleEmail.message; + const expiredPublicKeyError = CommonData.errors.expiredPublicKey; + const revokedPublicKeyError = CommonData.errors.revokedPublicKey; + + + await SplashScreen.login(); + await SetupKeyScreen.setPassPhrase(); + await MailFolderScreen.checkInboxScreen(); + + await MailFolderScreen.clickCreateEmail(); + await NewMessageScreen.composeEmail(expiredPublicKey, emailSubject, emailText); + await NewMessageScreen.checkFilledComposeEmailInfo(expiredPublicKey, emailSubject, emailText); + await NewMessageScreen.clickSendButton(); + + await NewMessageScreen.checkError(expiredPublicKeyError); + + await NewMessageScreen.clickOkButtonOnError(); + await NewMessageScreen.clickBackButton(); + await MailFolderScreen.checkInboxScreen(); + + await MailFolderScreen.clickCreateEmail(); + await NewMessageScreen.composeEmail(revokedpublicKey, emailSubject, emailText); + await NewMessageScreen.checkFilledComposeEmailInfo(revokedpublicKey, emailSubject, emailText); + await NewMessageScreen.clickSendButton(); + + await NewMessageScreen.checkError(revokedPublicKeyError); + }); +});