diff --git a/FlowCrypt/Controllers/Attachment/AttachmentViewController.swift b/FlowCrypt/Controllers/Attachment/AttachmentViewController.swift index a3ec3d07a..f4ecd625e 100644 --- a/FlowCrypt/Controllers/Attachment/AttachmentViewController.swift +++ b/FlowCrypt/Controllers/Attachment/AttachmentViewController.swift @@ -75,6 +75,7 @@ final class AttachmentViewController: UIViewController { NavigationBarItemsView.Input( image: UIImage(named: "download")?.tinted(.gray), title: "save".localized, + accessibilityId: "aid-save-attachment-to-device", onTap: { [weak self] in self?.downloadAttachment() } ) ] diff --git a/FlowCrypt/Controllers/Compose/ComposeViewController.swift b/FlowCrypt/Controllers/Compose/ComposeViewController.swift index 3b32618df..73b65e1bd 100644 --- a/FlowCrypt/Controllers/Compose/ComposeViewController.swift +++ b/FlowCrypt/Controllers/Compose/ComposeViewController.swift @@ -280,18 +280,21 @@ extension ComposeViewController { navigationItem.rightBarButtonItem = NavigationBarItemsView( with: [ NavigationBarItemsView.Input( - image: UIImage(named: "help_icn"), - action: (self, #selector(handleInfoTap)) - ), + image: UIImage(named: "help_icn") + ) { [weak self] in + self?.handleInfoTap() + }, NavigationBarItemsView.Input( - image: UIImage(named: "paperclip"), - action: (self, #selector(handleAttachTap)) - ), + image: UIImage(named: "paperclip") + ) { [weak self] in + self?.handleAttachTap() + }, NavigationBarItemsView.Input( image: UIImage(named: "android-send"), - action: (self, #selector(handleSendTap)), - accessibilityLabel: "send" - ) + accessibilityId: "aid-compose-send" + ) { [weak self] in + self?.handleSendTap() + } ] ) } @@ -386,15 +389,15 @@ extension ComposeViewController { // MARK: - Handle actions extension ComposeViewController { - @objc private func handleInfoTap() { + private func handleInfoTap() { showToast("Please email us at human@flowcrypt.com for help") } - @objc private func handleAttachTap() { + private func handleAttachTap() { openAttachmentsInputSourcesSheet() } - @objc private func handleSendTap() { + private func handleSendTap() { Task { do { let key = try await prepareSigningKey() diff --git a/FlowCrypt/Controllers/Inbox/InboxViewController.swift b/FlowCrypt/Controllers/Inbox/InboxViewController.swift index 13bb55325..84b84cd88 100644 --- a/FlowCrypt/Controllers/Inbox/InboxViewController.swift +++ b/FlowCrypt/Controllers/Inbox/InboxViewController.swift @@ -116,8 +116,8 @@ extension InboxViewController { private func setupNavigationBar() { navigationItem.rightBarButtonItem = NavigationBarItemsView( with: [ - NavigationBarItemsView.Input(image: UIImage(named: "help_icn"), action: (self, #selector(handleInfoTap))), - NavigationBarItemsView.Input(image: UIImage(named: "search_icn"), action: (self, #selector(handleSearchTap))) + NavigationBarItemsView.Input(image: UIImage(named: "help_icn")) { [weak self] in self?.handleInfoTap() }, + NavigationBarItemsView.Input(image: UIImage(named: "search_icn")) { [weak self] in self?.handleSearchTap() } ] ) } @@ -317,12 +317,12 @@ extension InboxViewController { // MARK: - Action handlers extension InboxViewController { - @objc private func handleInfoTap() { + private func handleInfoTap() { #warning("ToDo") showToast("Email us at human@flowcrypt.com") } - @objc private func handleSearchTap() { + private func handleSearchTap() { let viewController = SearchViewController(appContext: appContext, folderPath: viewModel.path) navigationController?.pushViewController(viewController, animated: false) } diff --git a/FlowCrypt/Controllers/Settings/Contacts/Contacts List/ContactDetailViewController.swift b/FlowCrypt/Controllers/Settings/Contacts/Contacts List/ContactDetailViewController.swift index 2ca435464..53daa8deb 100644 --- a/FlowCrypt/Controllers/Settings/Contacts/Contacts List/ContactDetailViewController.swift +++ b/FlowCrypt/Controllers/Settings/Contacts/Contacts List/ContactDetailViewController.swift @@ -59,7 +59,7 @@ final class ContactDetailViewController: TableNodeViewController { private func setupNavigationBarItems() { navigationItem.rightBarButtonItem = NavigationBarItemsView( with: [ - .init(image: UIImage(systemName: "trash"), action: (self, #selector(handleRemoveAction))) + .init(image: UIImage(systemName: "trash")) { [weak self] in self?.handleRemoveAction() } ] ) } diff --git a/FlowCrypt/Controllers/Settings/Contacts/Contacts List/ContactKeyDetailViewController.swift b/FlowCrypt/Controllers/Settings/Contacts/Contacts List/ContactKeyDetailViewController.swift index cb7c88caf..249dbf996 100644 --- a/FlowCrypt/Controllers/Settings/Contacts/Contacts List/ContactKeyDetailViewController.swift +++ b/FlowCrypt/Controllers/Settings/Contacts/Contacts List/ContactKeyDetailViewController.swift @@ -56,16 +56,16 @@ final class ContactKeyDetailViewController: TableNodeViewController { private func setupNavigationBarItems() { navigationItem.rightBarButtonItem = NavigationBarItemsView( with: [ - .init(image: UIImage(named: "share"), action: (self, #selector(handleSaveAction))), - .init(image: UIImage(named: "copy"), action: (self, #selector(handleCopyAction))), - .init(image: UIImage(systemName: "trash"), action: (self, #selector(handleRemoveAction))) + .init(image: UIImage(named: "share")) { [weak self] in self?.handleSaveAction() }, + .init(image: UIImage(named: "copy")) { [weak self] in self?.handleCopyAction() }, + .init(image: UIImage(systemName: "trash")) { [weak self] in self?.handleRemoveAction() } ] ) } } extension ContactKeyDetailViewController { - @objc private final func handleSaveAction() { + private final func handleSaveAction() { let vc = UIActivityViewController( activityItems: [pubKey.armored], applicationActivities: nil @@ -73,12 +73,12 @@ extension ContactKeyDetailViewController { present(vc, animated: true, completion: nil) } - @objc private final func handleCopyAction() { + private final func handleCopyAction() { UIPasteboard.general.string = pubKey.armored showToast("contact_detail_copy".localized) } - @objc private final func handleRemoveAction() { + private final func handleRemoveAction() { navigationController?.popViewController(animated: true) { [weak self] in guard let self = self else { return } self.action?(.delete(self.pubKey)) diff --git a/FlowCrypt/Controllers/SideMenu/Main/SideMenuNavigationController.swift b/FlowCrypt/Controllers/SideMenu/Main/SideMenuNavigationController.swift index 856d3947a..1b214c372 100644 --- a/FlowCrypt/Controllers/SideMenu/Main/SideMenuNavigationController.swift +++ b/FlowCrypt/Controllers/SideMenu/Main/SideMenuNavigationController.swift @@ -161,7 +161,7 @@ extension SideMenuNavigationController: UINavigationControllerDelegate { case 0: navigationButton = NavigationBarActionButton(UIImage(named: "menu_icn"), action: nil, accessibilityIdentifier: "menu") default: - navigationButton = NavigationBarActionButton(UIImage(named: "arrow-left-c"), action: nil) + navigationButton = .defaultBackButton() } navigationItem.hidesBackButton = true @@ -182,7 +182,7 @@ extension SideMenuNavigationController: UINavigationControllerDelegate { sideMenu?.allowPanGesture = false sideMenu?.allowLeftSwipe = false interactivePopGestureRecognizer?.isEnabled = true - navigationButton = NavigationBarActionButton(UIImage(named: "arrow-left-c")) { [weak self] in + navigationButton = .defaultBackButton { [weak self] in guard let self = self else { return } if let viewController = self.viewControllers.compactMap({ $0 as? NavigationChildController }).last { viewController.handleBackButtonTap() diff --git a/FlowCrypt/Controllers/SideMenu/NavigationController/MainNavigationController.swift b/FlowCrypt/Controllers/SideMenu/NavigationController/MainNavigationController.swift index 1f8d052c6..596d7e8e9 100644 --- a/FlowCrypt/Controllers/SideMenu/NavigationController/MainNavigationController.swift +++ b/FlowCrypt/Controllers/SideMenu/NavigationController/MainNavigationController.swift @@ -30,13 +30,12 @@ extension MainNavigationController: UINavigationControllerDelegate { return } - viewController.navigationItem.leftBarButtonItem = NavigationBarActionButton(UIImage(named: "arrow-left-c"), action: nil) + viewController.navigationItem.leftBarButtonItem = .defaultBackButton() } func navigationController(_: UINavigationController, didShow viewController: UIViewController, animated _: Bool) { guard shouldShowBackButton(for: viewController) else { return } - - let navigationButton = NavigationBarActionButton(UIImage(named: "arrow-left-c")) { [weak self] in + viewController.navigationItem.leftBarButtonItem = .defaultBackButton { [weak self] in guard let self = self else { return } if let viewController = self.viewControllers.compactMap({ $0 as? NavigationChildController }).last { viewController.handleBackButtonTap() @@ -44,8 +43,6 @@ extension MainNavigationController: UINavigationControllerDelegate { self.popViewController(animated: true) } } - - viewController.navigationItem.leftBarButtonItem = navigationButton } private func shouldShowBackButton(for viewController: UIViewController) -> Bool { @@ -82,3 +79,13 @@ extension UINavigationController { } } } + +extension UIBarButtonItem { + static func defaultBackButton(with action: (() -> Void)? = nil) -> NavigationBarActionButton { + NavigationBarActionButton( + UIImage(named: "arrow-left-c"), + action: action, + accessibilityIdentifier: "aid-back-button" + ) + } +} diff --git a/FlowCrypt/Controllers/Threads/ThreadDetailsDecorator.swift b/FlowCrypt/Controllers/Threads/ThreadDetailsDecorator.swift index 7a16a2335..4be15a445 100644 --- a/FlowCrypt/Controllers/Threads/ThreadDetailsDecorator.swift +++ b/FlowCrypt/Controllers/Threads/ThreadDetailsDecorator.swift @@ -102,7 +102,7 @@ private func makeEncryptionBadge(_ input: ThreadDetailsViewController.Input) -> icon: icon, text: NSAttributedString.text(from: text, style: .regular(12), color: .white), color: color, - textAccessibilityIdentifier: "encryptionBadge" + textAccessibilityIdentifier: "aid-encryption-badge" ) } @@ -115,6 +115,6 @@ private func makeSignatureBadge(_ input: ThreadDetailsViewController.Input) -> B icon: signature.icon, text: NSAttributedString.text(from: signature.message, style: .regular(12), color: .white), color: signature.color, - textAccessibilityIdentifier: "signatureBadge" + textAccessibilityIdentifier: "aid-signature-badge" ) } diff --git a/FlowCryptUI/Cell Nodes/ThreadMessageInfoCellNode.swift b/FlowCryptUI/Cell Nodes/ThreadMessageInfoCellNode.swift index 77bb48f25..c2841e626 100644 --- a/FlowCryptUI/Cell Nodes/ThreadMessageInfoCellNode.swift +++ b/FlowCryptUI/Cell Nodes/ThreadMessageInfoCellNode.swift @@ -184,7 +184,7 @@ public final class ThreadMessageInfoCellNode: CellNode { automaticallyManagesSubnodes = true senderNode.attributedText = input.sender - senderNode.accessibilityIdentifier = "messageSenderLabel" + senderNode.accessibilityIdentifier = "aid-message-sender-label" dateNode.attributedText = input.date @@ -206,27 +206,33 @@ public final class ThreadMessageInfoCellNode: CellNode { recipientButtonNode.contentSpacing = 4 recipientButtonNode.addTarget(self, action: #selector(onRecipientsNodeTap), forControlEvents: .touchUpInside) - recipientButtonNode.accessibilityIdentifier = "messageRecipientButton" + recipientButtonNode.accessibilityIdentifier = "aid-message-recipients-tappable-area" } private func setupReplyNode() { - setup(buttonNode: replyNode, - with: input.replyImage, - action: #selector(onReplyNodeTap), - accessibilityIdentifier: "replyButton") + setup( + buttonNode: replyNode, + with: input.replyImage, + action: #selector(onReplyNodeTap), + accessibilityIdentifier: "aid-reply-button" + ) } private func setupMenuNode() { - setup(buttonNode: menuNode, - with: input.menuImage, - action: #selector(onMenuNodeTap), - accessibilityIdentifier: "messageMenuButton") + setup( + buttonNode: menuNode, + with: input.menuImage, + action: #selector(onMenuNodeTap), + accessibilityIdentifier: "aid-message-menu-button" + ) } - private func setup(buttonNode node: ASButtonNode, - with image: UIImage?, - action: Selector, - accessibilityIdentifier: String) { + private func setup( + buttonNode node: ASButtonNode, + with image: UIImage?, + action: Selector, + accessibilityIdentifier: String + ) { node.setImage(image, for: .normal) node.imageNode.imageModificationBlock = ASImageNodeTintColorModificationBlock(input.buttonColor) node.addTarget(self, action: action, forControlEvents: .touchUpInside) diff --git a/FlowCryptUI/Nodes/AttachmentNode.swift b/FlowCryptUI/Nodes/AttachmentNode.swift index 831eb4932..a8b50514b 100644 --- a/FlowCryptUI/Nodes/AttachmentNode.swift +++ b/FlowCryptUI/Nodes/AttachmentNode.swift @@ -17,9 +17,9 @@ public final class AttachmentNode: CellNode { self.index = index } - var cellIdentifier: String { "attachmentCell\(index)" } - var titleLabelIdentifier: String { "attachmentTitleLabel\(index)" } - var deleteButtonIdentifier: String { "attachmentDeleteButton\(index)" } + var cellIdentifier: String { "aid-attachment-cell-\(index)" } + var titleLabelIdentifier: String { "aid-attachment-title-label-\(index)" } + var deleteButtonIdentifier: String { "aid-attachment-delete-button-\(index)" } } private let titleNode = ASTextNode() diff --git a/FlowCryptUI/Views/NavigationBarActionButton.swift b/FlowCryptUI/Views/NavigationBarActionButton.swift index c7883be18..c4d479be5 100644 --- a/FlowCryptUI/Views/NavigationBarActionButton.swift +++ b/FlowCryptUI/Views/NavigationBarActionButton.swift @@ -23,6 +23,7 @@ public final class NavigationBarActionButton: UIBarButtonItem { $0.frame.size = Constants.buttonSize $0.addTarget(self, action: #selector(tap), for: .touchUpInside) $0.accessibilityIdentifier = accessibilityIdentifier + $0.isAccessibilityElement = true } } diff --git a/FlowCryptUI/Views/NavigationBarItemsView.swift b/FlowCryptUI/Views/NavigationBarItemsView.swift index 4cbd38bea..e981ba3aa 100644 --- a/FlowCryptUI/Views/NavigationBarItemsView.swift +++ b/FlowCryptUI/Views/NavigationBarItemsView.swift @@ -18,23 +18,19 @@ public final class NavigationBarItemsView: UIBarButtonItem { public struct Input { let image: UIImage? - @available(*, deprecated, message: "Use onTap closure instead") - let action: TargetAction? let title: String? - let accessibilityLabel: String? + let accessibilityId: String? let onTap: (() -> Void)? public init( image: UIImage?, - action: (target: Any?, selector: Selector)? = nil, title: String? = nil, - accessibilityLabel: String? = nil, + accessibilityId: String? = nil, onTap: (() -> Void)? = nil ) { self.image = image - self.action = action self.title = title - self.accessibilityLabel = accessibilityLabel + self.accessibilityId = accessibilityId self.onTap = onTap } } @@ -53,12 +49,9 @@ public final class NavigationBarItemsView: UIBarButtonItem { $0.imageView?.frame.size = Constants.buttonSize $0.setImage(value.element.image, for: .normal) $0.setTitle(value.element.title, for: .normal) - $0.accessibilityLabel = self.accessibilityLabel - if let action = value.element.action { - $0.addTarget(action.target, action: action.selector, for: .touchUpInside) - } else if value.element.onTap != nil { - $0.addTarget(self, action: #selector(self.handleTap(with:)), for: .touchUpInside) - } + $0.accessibilityIdentifier = value.element.accessibilityId + $0.isAccessibilityElement = true + $0.addTarget(self, action: #selector(self.handleTap(with:)), for: .touchUpInside) } } diff --git a/appium/README.md b/appium/README.md index 5dd8a984b..c9a5f5f06 100644 --- a/appium/README.md +++ b/appium/README.md @@ -9,10 +9,14 @@ 5. restart terminal 6. `nvm install 16` - installs NodeJS 16 and sets it as default 7. `cd ~/git/flowcrypt-ios/appium && npm install` +8. use Visual Studio Code IDE for editting appium tests - be sure to open it using `File` -> `Open Workspace from File` -> `Core/flowcrypt-mobile-core.code-workspace` (don't simply open the project as a folder, because advanced IDE functionality will be missing) ## Building app for testing - -Run this in `flowcrypt-ios` folder: `bundle exec fastlane build`. This will produce folder `appium/FlowCrypt.app` that contains the built app. +1. Manually compile build from the current code: +- run `bundle exec fastlane build` in `flowcrypt-ios` folder +- it will produce `appium/FlowCrypt.app` for testing +2. Use the latest simulator build: +- copy `FlowCrypt.app` from `/DerivedData/FlowCrypt-.../Build/Products/Debug-iphonesimulator` (In Xcode open Products folder -> FlowCrypt -> Show in Finder). ## Run tests @@ -24,10 +28,18 @@ To run a particular test: To run all tests: `npm run-script test.live.all` or `npm run-script test.mock.all` +## Write and debug tests +Tips for debugging: +- Remove contents of `appium/tmp` before test execution. +- Execute tests and check `appium/tmp` for troubleshooting. +- You can change log level to debug/error inside `appium/config/wdio.shared.conf.js`. `logLevel: 'debug'`. +- You can inspect accessibility identifiers of ui elements with `appium-inspector`. +- if appium doesn't even start simulator where it used to work, try deleting node_modules folder and running `npm install`. Also check your nodejs version is 16 with `node --version` + ## Inspect accessibility identifiers 1. Install `https://github.com/appium/appium-inspector`. Releases `https://github.com/appium/appium-inspector/releases` 2. Download `appium-inspector.dmg`. - 3. Before openning package run `xattr -cr appium-inspector.dmg` on downloaded file. + 3. Before opening package run `xattr -cr appium-inspector.dmg` on downloaded file. 4. Allow access in `System Prefferences -> Privacy Tab -> Accessibility` 5. Use next capabilities for `Appium Inspector` ` @@ -46,4 +58,4 @@ To run all tests: `npm run-script test.live.all` or `npm run-script test.mock.al } ` 6. Remote host - `127.0.0.1`, Port - `4723`, Path - `/wd/hub` - 7. Run `Start Session` \ No newline at end of file + 7. Run `Start Session` diff --git a/appium/config/wdio.shared.conf.js b/appium/config/wdio.shared.conf.js index e47be4a1d..edcede9ba 100644 --- a/appium/config/wdio.shared.conf.js +++ b/appium/config/wdio.shared.conf.js @@ -16,7 +16,7 @@ exports.config = { requires: ['tsconfig-paths/register'] }, sync: true, - logLevel: 'silent', + logLevel: 'info', deprecationWarnings: true, bail: 0, waitforTimeout: 15000, diff --git a/appium/tests/screenobjects/attachment.screen.ts b/appium/tests/screenobjects/attachment.screen.ts index a324f957d..3f8089cac 100644 --- a/appium/tests/screenobjects/attachment.screen.ts +++ b/appium/tests/screenobjects/attachment.screen.ts @@ -2,9 +2,9 @@ import BaseScreen from './base.screen'; import ElementHelper from "../helpers/ElementHelper"; const SELECTORS = { - BACK_BTN: '~arrow left c', - SAVE_BTN: '-ios class chain:**/XCUIElementTypeButton[`label == "Save"`]', - CANCEL_BTN: '~Cancel', + BACK_BTN: '~aid-back-button', + SAVE_BTN: '~aid-save-attachment-to-device', + CANCEL_BTN: '~Cancel', // can't change aid for UIDocumentPickerViewController }; class AttachmentScreen extends BaseScreen { diff --git a/appium/tests/screenobjects/contact-public-key.screen.ts b/appium/tests/screenobjects/contact-public-key.screen.ts index 41eeb776e..ddb6ada14 100644 --- a/appium/tests/screenobjects/contact-public-key.screen.ts +++ b/appium/tests/screenobjects/contact-public-key.screen.ts @@ -2,7 +2,7 @@ import BaseScreen from './base.screen'; import ElementHelper from "../helpers/ElementHelper"; const SELECTORS = { - BACK_BTN: '~arrow left c', + BACK_BTN: '~aid-back-button', KEY: '~Key', PUBLIC_KEY: '-ios class chain:**/XCUIElementTypeOther/XCUIElementTypeStaticText[2]', FINGERPRINT_VALUE: '~fingerprintValue', diff --git a/appium/tests/screenobjects/contacts.screen.ts b/appium/tests/screenobjects/contacts.screen.ts index 9c1be6962..f7f5d0210 100644 --- a/appium/tests/screenobjects/contacts.screen.ts +++ b/appium/tests/screenobjects/contacts.screen.ts @@ -3,7 +3,7 @@ import ElementHelper from "../helpers/ElementHelper"; const SELECTORS = { CONTACTS_HEADER: '-ios class chain:**/XCUIElementTypeStaticText[`label == "Contacts"`]', - BACK_BUTTON: '~arrow left c', + BACK_BUTTON: '~aid-back-button', EMPTY_CONTACTS_LIST: '~Empty list', }; diff --git a/appium/tests/screenobjects/email.screen.ts b/appium/tests/screenobjects/email.screen.ts index 032b0bc8b..5c1636034 100644 --- a/appium/tests/screenobjects/email.screen.ts +++ b/appium/tests/screenobjects/email.screen.ts @@ -3,24 +3,24 @@ import { CommonData } from "../data"; import ElementHelper from "../helpers/ElementHelper"; const SELECTORS = { - BACK_BTN: '~arrow left c', + BACK_BTN: '~aid-back-button', ENTER_PASS_PHRASE_FIELD: '-ios class chain:**/XCUIElementTypeSecureTextField', OK_BUTTON: '~Ok', WRONG_PASS_PHRASE_MESSAGE: '-ios class chain:**/XCUIElementTypeStaticText[`label == "Wrong pass phrase, please try again"`]', - ATTACHMENT_CELL: '~attachmentCell0', - ATTACHMENT_TITLE: '~attachmentTitleLabel0', - REPLY_BUTTON: '~replyButton', - RECIPIENTS_BUTTON: '~messageRecipientButton', + ATTACHMENT_CELL: '~aid-attachment-cell-0', + ATTACHMENT_TITLE: '~aid-attachment-title-label-0', + REPLY_BUTTON: '~aid-reply-button', + RECIPIENTS_BUTTON: '~aid-message-recipients-tappable-area', RECIPIENTS_TO_LABEL: '~toLabel0', RECIPIENTS_CC_LABEL: '~ccLabel0', RECIPIENTS_BCC_LABEL: '~bccLabel0', - MENU_BUTTON: '~messageMenuButton', + MENU_BUTTON: '~aid-message-menu-button', FORWARD_BUTTON: '~Forward', DELETE_BUTTON: '~Delete', CONFIRM_DELETING: '~OK', - SENDER_EMAIL: '~messageSenderLabel', - ENCRYPTION_BADGE: '~encryptionBadge', - SIGNATURE_BADGE: '~signatureBadge' + SENDER_EMAIL: '~aid-message-sender-label', + ENCRYPTION_BADGE: '~aid-encryption-badge', + SIGNATURE_BADGE: '~aid-signature-badge' }; diff --git a/appium/tests/screenobjects/new-message.screen.ts b/appium/tests/screenobjects/new-message.screen.ts index f2f569ac5..f1046883a 100644 --- a/appium/tests/screenobjects/new-message.screen.ts +++ b/appium/tests/screenobjects/new-message.screen.ts @@ -10,12 +10,12 @@ const SELECTORS = { '/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther/XCUIElementTypeTable' + '/XCUIElementTypeCell[1]/XCUIElementTypeOther/XCUIElementTypeCollectionView/XCUIElementTypeCell' + '/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeStaticText', //it works only with this selector - ATTACHMENT_CELL: '~attachmentCell0', - ATTACHMENT_NAME_LABEL: '~attachmentTitleLabel0', - DELETE_ATTACHMENT_BUTTON: '~attachmentDeleteButton0', + ATTACHMENT_CELL: '~aid-attachment-cell-0', + ATTACHMENT_NAME_LABEL: '~aid-attachment-title-label-0', + DELETE_ATTACHMENT_BUTTON: '~aid-attachment-delete-button-0', RETURN_BUTTON: '~Return', - BACK_BUTTON: '~arrow left c', - SEND_BUTTON: '~android send', + BACK_BUTTON: '~aid-back-button', + SEND_BUTTON: '~aid-compose-send', }; class NewMessageScreen extends BaseScreen { diff --git a/appium/tests/screenobjects/public-key.screen.ts b/appium/tests/screenobjects/public-key.screen.ts index b37ca1eeb..55fdabdfd 100644 --- a/appium/tests/screenobjects/public-key.screen.ts +++ b/appium/tests/screenobjects/public-key.screen.ts @@ -1,7 +1,7 @@ import BaseScreen from './base.screen'; const SELECTORS = { - BACK_BTN: '~arrow left c', + BACK_BTN: '~aid-back-button', PUBLIC_KEY_HEADER: '-ios class chain:**/XCUIElementTypeStaticText[`label == "Public key"`]', PUBLIC_KEY: '~publicKey', }; diff --git a/appium/tests/screenobjects/search.screen.ts b/appium/tests/screenobjects/search.screen.ts index 685631457..653b6cfa7 100644 --- a/appium/tests/screenobjects/search.screen.ts +++ b/appium/tests/screenobjects/search.screen.ts @@ -2,7 +2,7 @@ import BaseScreen from './base.screen'; import ElementHelper from "../helpers/ElementHelper"; const SELECTORS = { - BACK_BUTTON: '~arrow left c', + BACK_BUTTON: '~aid-back-button', SCREEN: '~searchViewController', SEARCH_FIELD: '~searchAllEmailField' };