Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ extension PublicKeyDetailViewController: ASTableDelegate, ASTableDataSource {
SetupTitleNode.Input(
title: (self?.text ?? "").attributed(.regular(16)),
insets: .side(16),
backgroundColor: .backgroundColor
backgroundColor: .backgroundColor,
accessibilityIdentifier: "publicKey"
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ extension InfoCellNode.Input {
self.init(
attributedText: viewModel.name
.attributed(.regular(17), color: .mainTextColor),
image: viewModel.image
image: viewModel.image,
accessibilityIdentifier: "menuBarItem\(viewModel.name.capitalizingFirstLetter())"
)
}
}
4 changes: 4 additions & 0 deletions FlowCrypt/Extensions/String+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ extension String {
let emailPredicate = NSPredicate(format: "SELF MATCHES %@", emailFormat)
return emailPredicate.evaluate(with: self)
}

func capitalizingFirstLetter() -> String {
prefix(1).uppercased() + self.lowercased().dropFirst()
}
}
10 changes: 8 additions & 2 deletions FlowCryptUI/Cell Nodes/InfoCellNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,20 @@ public final class InfoCellNode: CellNode {
let image: UIImage?
let insets: UIEdgeInsets
let backgroundColor: UIColor?
let accessibilityIdentifier: String?

public init(
attributedText: NSAttributedString,
image: UIImage?,
insets: UIEdgeInsets = UIEdgeInsets(top: 8, left: 16, bottom: 8, right: 16),
backgroundColor: UIColor? = nil
backgroundColor: UIColor? = nil,
accessibilityIdentifier: String? = nil
) {
self.attributedText = attributedText
self.image = image
self.insets = insets
self.backgroundColor = backgroundColor
self.accessibilityIdentifier = accessibilityIdentifier
}
}

Expand All @@ -37,9 +40,12 @@ public final class InfoCellNode: CellNode {
self.input = input
super.init()
self.textNode.attributedText = input?.attributedText
self.textNode.isAccessibilityElement = true
self.textNode.accessibilityIdentifier = input?.accessibilityIdentifier

self.imageNode.image = input?.image
self.automaticallyManagesSubnodes = true

if let backgroundColor = input?.backgroundColor {
self.backgroundColor = backgroundColor
}
Expand Down
7 changes: 6 additions & 1 deletion FlowCryptUI/Cell Nodes/SetupTitleNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,20 @@ public final class SetupTitleNode: CellNode {
let insets: UIEdgeInsets
let selectedLineColor: UIColor?
let backgroundColor: UIColor
let accessibilityIdentifier: String?

public init(
title: NSAttributedString,
insets: UIEdgeInsets,
selectedLineColor: UIColor? = nil,
backgroundColor: UIColor
backgroundColor: UIColor,
accessibilityIdentifier: String? = nil
) {
self.title = title
self.insets = insets
self.selectedLineColor = selectedLineColor
self.backgroundColor = backgroundColor
self.accessibilityIdentifier = accessibilityIdentifier
}
}
private let input: Input
Expand All @@ -35,6 +38,8 @@ public final class SetupTitleNode: CellNode {
self.input = input
super.init()
textNode.attributedText = input.title
textNode.isAccessibilityElement = true
textNode.accessibilityIdentifier = input.accessibilityIdentifier
backgroundColor = input.backgroundColor
}

Expand Down
5 changes: 1 addition & 4 deletions FlowCryptUI/Nodes/TableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,9 @@ public extension UINavigationItem {
titleLabel.sizeToFit()
titleView = titleLabel

let accessibilityIdentifier = "navigationItem\((id ?? ""))"
.replacingOccurrences(of: " ", with: "")
.capitalized
titleLabel.isAccessibilityElement = true
titleLabel.accessibilityTraits = .header
titleView?.accessibilityIdentifier = accessibilityIdentifier
titleView?.accessibilityIdentifier = "navigationItem\((id ?? "").capitalized)"
titleView?.isAccessibilityElement = true
titleView?.accessibilityTraits = .header
isAccessibilityElement = true
Expand Down
2 changes: 1 addition & 1 deletion appium/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@
"wdio-video-reporter": "^3.1.3",
"webdriverio": "7.16.10"
}
}
}
6 changes: 3 additions & 3 deletions appium/tests/screenobjects/mail-folder.screen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import TouchHelper from "../helpers/TouchHelper";
import ElementHelper from "../helpers/ElementHelper";

const SELECTORS = {
TRASH_HEADER: '~Navigationitemtrash',
SENT_HEADER: '~Navigationitemsent',
TRASH_HEADER: '~navigationItemTrash',
SENT_HEADER: '~navigationItemSent',
CREATE_EMAIL_BUTTON: '-ios class chain:**/XCUIElementTypeButton[`label == "+"`]',
INBOX_HEADER: '~Navigationiteminbox',
INBOX_HEADER: '~navigationItemInbox',
SEARCH_ICON: '~search icn',
HELP_ICON: '~help icn',
SEARCH_FIELD: '~searchAllEmailField'
Expand Down
10 changes: 5 additions & 5 deletions appium/tests/screenobjects/menu-bar.screen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import ElementHelper from "../helpers/ElementHelper";

const SELECTORS = {
MENU_ICON: '~menu icn',
LOGOUT_BTN: '~Log out',
SETTINGS_BTN: '~Settings',
INBOX_BTN: '~INBOX',
SENT_BTN: '~SENT',
TRASH_BTN: '~TRASH',
LOGOUT_BTN: '~menuBarItemLog out',
SETTINGS_BTN: '~menuBarItemSettings',
INBOX_BTN: '~menuBarItemInbox',
SENT_BTN: '~menuBarItemSent',
TRASH_BTN: '~menuBarItemTrash',
};

class MenuBarScreen extends BaseScreen {
Expand Down
13 changes: 3 additions & 10 deletions appium/tests/screenobjects/public-key.screen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import BaseScreen from './base.screen';
const SELECTORS = {
BACK_BTN: '~arrow left c',
PUBLIC_KEY_HEADER: '-ios class chain:**/XCUIElementTypeStaticText[`label == "Public key"`]',
PUBLIC_KEY: '-ios class chain:**/XCUIElementTypeOther/XCUIElementTypeStaticText[1]',
PUBLIC_KEY: '~publicKey',
};

class PublicKeyScreen extends BaseScreen {
Expand All @@ -28,15 +28,8 @@ class PublicKeyScreen extends BaseScreen {
await (await this.publicKeyHeader).waitForDisplayed();
const publicKeyEl = await this.publicKey;
await publicKeyEl.waitForExist();
// const pubkeyValue = await publicKeyEl.getAttribute('value');
// todo - fixme https://github.com/FlowCrypt/flowcrypt-ios/issues/1068
// [0-11] Error in "SETTINGS: user should see public key and should not see private key"
// Error: Expected 'e2e' to contain '-----BEGIN PGP PUBLIC KEY BLOCK-----'.
// at <Jasmine>
// at PublicKeyScreen.checkPublicKey (/Users/tom/git/flowcrypt-ios/appium/tests/screenobjects/public-key.screen.ts:32:31)
// at processTicksAndRejections (node:internal/process/task_queues:96:5)
// at async UserContext.<anonymous> (/Users/tom/git/flowcrypt-ios/appium/tests/specs/settings/CheckSettingsForLoggedUser.spec.ts:34:5)``
// await expect(pubkeyValue).toContain("-----BEGIN PGP PUBLIC KEY BLOCK-----");
const pubkeyValue = await publicKeyEl.getAttribute('value');
await expect(pubkeyValue).toContain("-----BEGIN PGP PUBLIC KEY BLOCK-----");
}
}

Expand Down