diff --git a/FlowCryptUI/Cell Nodes/ThreadMessageSenderCellNode.swift b/FlowCryptUI/Cell Nodes/ThreadMessageSenderCellNode.swift index 6b8214975..285dba6c0 100644 --- a/FlowCryptUI/Cell Nodes/ThreadMessageSenderCellNode.swift +++ b/FlowCryptUI/Cell Nodes/ThreadMessageSenderCellNode.swift @@ -74,8 +74,10 @@ public final class ThreadMessageSenderCellNode: CellNode { automaticallyManagesSubnodes = true senderNode.attributedText = input.sender + senderNode.accessibilityIdentifier = "senderEmail" dateNode.attributedText = input.date + setupReplyNode() setupExpandNode() } diff --git a/appium/tests/screenobjects/email.screen.ts b/appium/tests/screenobjects/email.screen.ts index 73c6b9b7b..ca9044daa 100644 --- a/appium/tests/screenobjects/email.screen.ts +++ b/appium/tests/screenobjects/email.screen.ts @@ -10,7 +10,8 @@ const SELECTORS = { DOWNLOAD_ATTACHMENT_BUTTON: '~downloadButton', REPLY_BUTTON: '~replyButton', DELETE_BUTTON: '~Delete', - CONFIRM_DELETING: '~OK' + CONFIRM_DELETING: '~OK', + SENDER_EMAIL: '~senderEmail' }; @@ -51,9 +52,13 @@ class EmailScreen extends BaseScreen { return $(SELECTORS.CONFIRM_DELETING) } + get senderEmail() { + return $(SELECTORS.SENDER_EMAIL); + } + checkEmailAddress = async (email: string) => { - const selector = `~${email}`; - await (await $(selector)).waitForDisplayed(); + await (await this.senderEmail).waitForDisplayed(); + await expect(await this.senderEmail).toHaveText(email); } checkEmailSubject = async (subject: string) => { diff --git a/appium/tests/screenobjects/new-message.screen.ts b/appium/tests/screenobjects/new-message.screen.ts index e50874e41..d207e96f8 100644 --- a/appium/tests/screenobjects/new-message.screen.ts +++ b/appium/tests/screenobjects/new-message.screen.ts @@ -11,7 +11,7 @@ const SELECTORS = { '/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeStaticText', //it works only with this selector RETURN_BUTTON: '~Return', BACK_BUTTON: '~arrow left c', - SENT_BUTTON: '~android send', + SEND_BUTTON: '~android send', ERROR_HEADER: '-ios class chain:**/XCUIElementTypeStaticText[`label == "Error"`]', OK_BUTTON: '~OK' }; @@ -41,8 +41,8 @@ class NewMessageScreen extends BaseScreen { return $(SELECTORS.BACK_BUTTON); } - get sentButton() { - return $(SELECTORS.SENT_BUTTON); + get sendButton() { + return $(SELECTORS.SEND_BUTTON); } get errorHeader() { @@ -100,8 +100,8 @@ class NewMessageScreen extends BaseScreen { await ElementHelper.waitAndClick(await this.backButton); } - clickSentButton = async () => { - await ElementHelper.waitAndClick(await this.sentButton); + clickSendButton = async () => { + await ElementHelper.waitAndClick(await this.sendButton); } checkError = async (errorText: string) => { diff --git a/appium/tests/specs/composeEmail/SentEmailToRecipientWithoutPublicKey.spec.ts b/appium/tests/specs/composeEmail/SendEmailToRecipientWithoutPublicKey.spec.ts similarity index 95% rename from appium/tests/specs/composeEmail/SentEmailToRecipientWithoutPublicKey.spec.ts rename to appium/tests/specs/composeEmail/SendEmailToRecipientWithoutPublicKey.spec.ts index 9992a1a12..6aa08f605 100644 --- a/appium/tests/specs/composeEmail/SentEmailToRecipientWithoutPublicKey.spec.ts +++ b/appium/tests/specs/composeEmail/SendEmailToRecipientWithoutPublicKey.spec.ts @@ -23,7 +23,7 @@ describe('COMPOSE EMAIL: ', () => { await InboxScreen.clickCreateEmail(); await NewMessageScreen.composeEmail(noPublicKeyRecipient, emailSubject, emailText); await NewMessageScreen.checkFilledComposeEmailInfo(noPublicKeyRecipient, emailSubject, emailText); - await NewMessageScreen.clickSentButton(); + await NewMessageScreen.clickSendButton(); await NewMessageScreen.checkError(noPublicKeyError); }); diff --git a/appium/tests/specs/composeEmail/SendEncryptedEmailAfterPassPhraseSessionEndedAndTrashIt.spec.ts b/appium/tests/specs/composeEmail/SendEncryptedEmailAfterPassPhraseSessionEndedAndTrashIt.spec.ts index c8d4d8d89..55fa519cd 100644 --- a/appium/tests/specs/composeEmail/SendEncryptedEmailAfterPassPhraseSessionEndedAndTrashIt.spec.ts +++ b/appium/tests/specs/composeEmail/SendEncryptedEmailAfterPassPhraseSessionEndedAndTrashIt.spec.ts @@ -37,13 +37,13 @@ describe('COMPOSE EMAIL: ', () => { await NewMessageScreen.composeEmail(contactEmail, emailSubject, emailText); await NewMessageScreen.checkFilledComposeEmailInfo(contactEmail, emailSubject, emailText); //Set wrong pass phrase and check error - await NewMessageScreen.clickSentButton(); + await NewMessageScreen.clickSendButton(); await EmailScreen.enterPassPhrase(wrongPassPhrase); await EmailScreen.clickOkButton(); await NewMessageScreen.checkError(wrongPassPhraseError); await NewMessageScreen.clickOkButtonOnError(); //Set correct pass phrase - await NewMessageScreen.clickSentButton(); + await NewMessageScreen.clickSendButton(); await EmailScreen.enterPassPhrase(passPhrase); await EmailScreen.clickOkButton(); await InboxScreen.checkInboxScreen();