From 199a834cfd5a23a7c445ede6573e74d5bcac27a9 Mon Sep 17 00:00:00 2001 From: Dmitry Sotnikov Date: Tue, 26 Oct 2021 16:09:47 +0300 Subject: [PATCH 1/6] covered issue-718 --- .../tests/screenobjects/new-message.screen.ts | 14 +++++++++- .../SelectRecipientByName.spec.ts | 26 +++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 appium/tests/specs/composeEmail/SelectRecipientByName.spec.ts diff --git a/appium/tests/screenobjects/new-message.screen.ts b/appium/tests/screenobjects/new-message.screen.ts index 9cde18d37..c7d3dd7fc 100644 --- a/appium/tests/screenobjects/new-message.screen.ts +++ b/appium/tests/screenobjects/new-message.screen.ts @@ -51,11 +51,23 @@ class NewMessageScreen extends BaseScreen { this.setComposeSecurityMessage(message); } + setComposeEmailByName(name, email, subject, message) { + this.setAddRecipientByName(name, email); + this.setSubject(subject); + this.setComposeSecurityMessage(message); + } + + setAddRecipientByName(name, email) { + this.addRecipientField.setValue(name); + const selector = `~${email}`; + $(selector).waitForDisplayed(); + $(selector).click(); + } + checkFilledComposeEmailInfo(recipient, subject, message) { expect(this.composeSecurityMesage).toHaveText(message); this.filledSubject(subject).waitForDisplayed(); expect(this.addedRecipientEmail).toHaveAttribute('value', ` ${recipient} `); - } } diff --git a/appium/tests/specs/composeEmail/SelectRecipientByName.spec.ts b/appium/tests/specs/composeEmail/SelectRecipientByName.spec.ts new file mode 100644 index 000000000..73d22d748 --- /dev/null +++ b/appium/tests/specs/composeEmail/SelectRecipientByName.spec.ts @@ -0,0 +1,26 @@ +import { + SplashScreen, + CreateKeyScreen, + InboxScreen, + NewMessageScreen +} from '../../screenobjects/all-screens'; + +import {CommonData} from '../../data'; + +describe('COMPOSE EMAIL: ', () => { + + it('user is able to select recipient from contact list using name', () => { + + const senderEmail = CommonData.sender.email; + const emailSubject = 'TestSubject'; + const emailText = 'Test email'; + const recipientName = 'Dima'; + + SplashScreen.login(); + CreateKeyScreen.setPassPhrase(); + + InboxScreen.clickCreateEmail(); + NewMessageScreen.setComposeEmailByName(recipientName, senderEmail, emailSubject, emailText); + NewMessageScreen.checkFilledComposeEmailInfo(senderEmail, emailSubject, emailText); + }); +}); From e83f7b25b70f7d8cfd481058c97e667cb94f2368 Mon Sep 17 00:00:00 2001 From: Dmitry Sotnikov Date: Wed, 27 Oct 2021 11:14:17 +0300 Subject: [PATCH 2/6] [skip ci] fix for 718 --- appium/tests/data/index.ts | 6 +++++- appium/tests/screenobjects/new-message.screen.ts | 11 +++++------ .../CheckComposeEmailAfterReopening.spec.ts | 8 ++++---- .../specs/composeEmail/SelectRecipientByName.spec.ts | 11 +++++------ 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/appium/tests/data/index.ts b/appium/tests/data/index.ts index 6fa8ccc1e..730beef69 100644 --- a/appium/tests/data/index.ts +++ b/appium/tests/data/index.ts @@ -4,8 +4,12 @@ export const CommonData = { password: process.env.ACCOUNT_PASSWORD, passPhrase: process.env.PASS_PHRASE }, + recipient: { + email: process.env.RECIPIENT_EMAIL, + name: process.env.RECIPIENT_NAME + }, sender: { - email: 'dmitry@flowcrypt.com' + email: process.env.SENDER_EMAIL, }, bundleId: { id: process.env.BUNDLE_ID diff --git a/appium/tests/screenobjects/new-message.screen.ts b/appium/tests/screenobjects/new-message.screen.ts index c7d3dd7fc..e1d71b4b1 100644 --- a/appium/tests/screenobjects/new-message.screen.ts +++ b/appium/tests/screenobjects/new-message.screen.ts @@ -45,17 +45,12 @@ class NewMessageScreen extends BaseScreen { return $(`-ios class chain:${selector}`); } - setComposeEmail(recipient, subject, message) { + composeEmail(recipient, subject, message) { this.setAddRecipient(recipient); this.setSubject(subject); this.setComposeSecurityMessage(message); } - setComposeEmailByName(name, email, subject, message) { - this.setAddRecipientByName(name, email); - this.setSubject(subject); - this.setComposeSecurityMessage(message); - } setAddRecipientByName(name, email) { this.addRecipientField.setValue(name); @@ -67,6 +62,10 @@ class NewMessageScreen extends BaseScreen { checkFilledComposeEmailInfo(recipient, subject, message) { expect(this.composeSecurityMesage).toHaveText(message); this.filledSubject(subject).waitForDisplayed(); + this.checkAddedRecipient(recipient); + } + + checkAddedRecipient(recipient) { expect(this.addedRecipientEmail).toHaveAttribute('value', ` ${recipient} `); } } diff --git a/appium/tests/specs/composeEmail/CheckComposeEmailAfterReopening.spec.ts b/appium/tests/specs/composeEmail/CheckComposeEmailAfterReopening.spec.ts index d6f0abd3c..214947869 100644 --- a/appium/tests/specs/composeEmail/CheckComposeEmailAfterReopening.spec.ts +++ b/appium/tests/specs/composeEmail/CheckComposeEmailAfterReopening.spec.ts @@ -11,7 +11,7 @@ describe('COMPOSE EMAIL: ', () => { it('check filled compose email after reopening app', () => { - const senderEmail = CommonData.sender.email; + const recipientEmail = CommonData.recipient.email; const emailSubject = 'TestSubject'; const emailText = 'Test email'; @@ -19,11 +19,11 @@ describe('COMPOSE EMAIL: ', () => { CreateKeyScreen.setPassPhrase(); InboxScreen.clickCreateEmail(); - NewMessageScreen.setComposeEmail(senderEmail, emailSubject, emailText); - NewMessageScreen.checkFilledComposeEmailInfo(senderEmail, emailSubject, emailText); + NewMessageScreen.composeEmail(recipientEmail, emailSubject, emailText); + NewMessageScreen.checkFilledComposeEmailInfo(recipientEmail, emailSubject, emailText); driver.background(3); - NewMessageScreen.checkFilledComposeEmailInfo(senderEmail, emailSubject, emailText); + NewMessageScreen.checkFilledComposeEmailInfo(recipientEmail, emailSubject, emailText); }); }); diff --git a/appium/tests/specs/composeEmail/SelectRecipientByName.spec.ts b/appium/tests/specs/composeEmail/SelectRecipientByName.spec.ts index 73d22d748..271442421 100644 --- a/appium/tests/specs/composeEmail/SelectRecipientByName.spec.ts +++ b/appium/tests/specs/composeEmail/SelectRecipientByName.spec.ts @@ -11,16 +11,15 @@ describe('COMPOSE EMAIL: ', () => { it('user is able to select recipient from contact list using name', () => { - const senderEmail = CommonData.sender.email; - const emailSubject = 'TestSubject'; - const emailText = 'Test email'; - const recipientName = 'Dima'; + const recipientEmail = CommonData.recipient.email; + const recipientName = CommonData.recipient.name; SplashScreen.login(); CreateKeyScreen.setPassPhrase(); InboxScreen.clickCreateEmail(); - NewMessageScreen.setComposeEmailByName(recipientName, senderEmail, emailSubject, emailText); - NewMessageScreen.checkFilledComposeEmailInfo(senderEmail, emailSubject, emailText); + + NewMessageScreen.setAddRecipientByName(recipientName, recipientEmail); + NewMessageScreen.checkAddedRecipient(recipientEmail); }); }); From 058f8b822a8b881ccb0f14dee7ca683beb211a0a Mon Sep 17 00:00:00 2001 From: Dmitry Sotnikov Date: Fri, 29 Oct 2021 11:12:17 +0300 Subject: [PATCH 3/6] added fixes for index file(removed recipient data) --- appium/tests/data/index.ts | 4 ---- appium/tests/screenobjects/new-message.screen.ts | 1 - .../composeEmail/CheckComposeEmailAfterReopening.spec.ts | 2 +- appium/tests/specs/composeEmail/SelectRecipientByName.spec.ts | 4 ++-- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/appium/tests/data/index.ts b/appium/tests/data/index.ts index 730beef69..bd432f7b4 100644 --- a/appium/tests/data/index.ts +++ b/appium/tests/data/index.ts @@ -4,10 +4,6 @@ export const CommonData = { password: process.env.ACCOUNT_PASSWORD, passPhrase: process.env.PASS_PHRASE }, - recipient: { - email: process.env.RECIPIENT_EMAIL, - name: process.env.RECIPIENT_NAME - }, sender: { email: process.env.SENDER_EMAIL, }, diff --git a/appium/tests/screenobjects/new-message.screen.ts b/appium/tests/screenobjects/new-message.screen.ts index 7c3257169..c4aa52d1f 100644 --- a/appium/tests/screenobjects/new-message.screen.ts +++ b/appium/tests/screenobjects/new-message.screen.ts @@ -54,7 +54,6 @@ class NewMessageScreen extends BaseScreen { this.setComposeSecurityMessage(message); } - setAddRecipientByName(name, email) { this.addRecipientField.setValue(name); const selector = `~${email}`; diff --git a/appium/tests/specs/composeEmail/CheckComposeEmailAfterReopening.spec.ts b/appium/tests/specs/composeEmail/CheckComposeEmailAfterReopening.spec.ts index 214947869..cbdc5bd87 100644 --- a/appium/tests/specs/composeEmail/CheckComposeEmailAfterReopening.spec.ts +++ b/appium/tests/specs/composeEmail/CheckComposeEmailAfterReopening.spec.ts @@ -11,7 +11,7 @@ describe('COMPOSE EMAIL: ', () => { it('check filled compose email after reopening app', () => { - const recipientEmail = CommonData.recipient.email; + const recipientEmail = 'dmitry@flowcrypt.com'; const emailSubject = 'TestSubject'; const emailText = 'Test email'; diff --git a/appium/tests/specs/composeEmail/SelectRecipientByName.spec.ts b/appium/tests/specs/composeEmail/SelectRecipientByName.spec.ts index 271442421..292a1e5cd 100644 --- a/appium/tests/specs/composeEmail/SelectRecipientByName.spec.ts +++ b/appium/tests/specs/composeEmail/SelectRecipientByName.spec.ts @@ -11,8 +11,8 @@ describe('COMPOSE EMAIL: ', () => { it('user is able to select recipient from contact list using name', () => { - const recipientEmail = CommonData.recipient.email; - const recipientName = CommonData.recipient.name; + const recipientEmail = 'dmitry@flowcrypt.com'; + const recipientName = 'Dima'; SplashScreen.login(); CreateKeyScreen.setPassPhrase(); From 0dbced374ebfaa1c11ecd0302debdde634ce7524 Mon Sep 17 00:00:00 2001 From: Dmitry Sotnikov Date: Fri, 29 Oct 2021 12:04:16 +0300 Subject: [PATCH 4/6] [skip CI] added contact data to index file, renamed recipientEmail/Name to contactEmail/Name --- appium/tests/data/index.ts | 4 ++++ .../specs/composeEmail/SelectRecipientByName.spec.ts | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/appium/tests/data/index.ts b/appium/tests/data/index.ts index bd432f7b4..46eab739a 100644 --- a/appium/tests/data/index.ts +++ b/appium/tests/data/index.ts @@ -7,6 +7,10 @@ export const CommonData = { sender: { email: process.env.SENDER_EMAIL, }, + contact: { + name: 'dmitry@flowcrypt.com', + email: 'Dima' + }, bundleId: { id: process.env.BUNDLE_ID } diff --git a/appium/tests/specs/composeEmail/SelectRecipientByName.spec.ts b/appium/tests/specs/composeEmail/SelectRecipientByName.spec.ts index 292a1e5cd..d6f3813ba 100644 --- a/appium/tests/specs/composeEmail/SelectRecipientByName.spec.ts +++ b/appium/tests/specs/composeEmail/SelectRecipientByName.spec.ts @@ -11,15 +11,15 @@ describe('COMPOSE EMAIL: ', () => { it('user is able to select recipient from contact list using name', () => { - const recipientEmail = 'dmitry@flowcrypt.com'; - const recipientName = 'Dima'; + const contactEmail = CommonData.contact.email; + const contactName = CommonData.contact.name; SplashScreen.login(); CreateKeyScreen.setPassPhrase(); InboxScreen.clickCreateEmail(); - NewMessageScreen.setAddRecipientByName(recipientName, recipientEmail); - NewMessageScreen.checkAddedRecipient(recipientEmail); + NewMessageScreen.setAddRecipientByName(contactName, contactEmail); + NewMessageScreen.checkAddedRecipient(contactEmail); }); }); From 554d50e91a9e8d8baef94dd6a9f7267f23f757ed Mon Sep 17 00:00:00 2001 From: Dmitry Sotnikov Date: Fri, 29 Oct 2021 12:07:17 +0300 Subject: [PATCH 5/6] [skip ci] typo fix --- appium/tests/data/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appium/tests/data/index.ts b/appium/tests/data/index.ts index 46eab739a..29672a8bf 100644 --- a/appium/tests/data/index.ts +++ b/appium/tests/data/index.ts @@ -8,8 +8,8 @@ export const CommonData = { email: process.env.SENDER_EMAIL, }, contact: { - name: 'dmitry@flowcrypt.com', - email: 'Dima' + email: 'dmitry@flowcrypt.com', + name: 'Dima' }, bundleId: { id: process.env.BUNDLE_ID From c17b91acf230284351eb3a545a1888c89a92927c Mon Sep 17 00:00:00 2001 From: Dmitry Sotnikov Date: Fri, 29 Oct 2021 16:10:33 +0300 Subject: [PATCH 6/6] renamed 1 spec --- appium/tests/specs/composeEmail/SelectRecipientByName.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appium/tests/specs/composeEmail/SelectRecipientByName.spec.ts b/appium/tests/specs/composeEmail/SelectRecipientByName.spec.ts index d6f3813ba..194a0a1ed 100644 --- a/appium/tests/specs/composeEmail/SelectRecipientByName.spec.ts +++ b/appium/tests/specs/composeEmail/SelectRecipientByName.spec.ts @@ -9,7 +9,7 @@ import {CommonData} from '../../data'; describe('COMPOSE EMAIL: ', () => { - it('user is able to select recipient from contact list using name', () => { + it('user is able to select recipient from contact list using contact name', () => { const contactEmail = CommonData.contact.email; const contactName = CommonData.contact.name;