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
1 change: 1 addition & 0 deletions FlowCrypt/Controllers/Inbox/InboxViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ final class InboxViewController: ASDKViewController<ASDisplayNode> {
extension InboxViewController {
private func setupUI() {
title = inboxTitle
navigationItem.setAccessibility(id: inboxTitle)

tableNode.do {
$0.delegate = self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ enum BackupOption: Int, CaseIterable, Equatable {
}

@MainActor
final class BackupOptionsViewController: ASDKViewController<TableNode> {
final class BackupOptionsViewController: TableNodeViewController {
enum Parts: Int, CaseIterable {
case email, download, action, info
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
import AsyncDisplayKit
import FlowCryptUI

@MainActor
final class BackupViewController: ASDKViewController<TableNode> {
final class BackupViewController: TableNodeViewController {
private enum Parts: Int, CaseIterable {
case info, action
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import AsyncDisplayKit
import FlowCryptUI
import Foundation

@MainActor
final class BackupSelectKeyViewController: ASDKViewController<TableNode> {
final class BackupSelectKeyViewController: TableNodeViewController {

private let appContext: AppContext
private let service: ServiceActor
Expand Down
28 changes: 28 additions & 0 deletions FlowCryptUI/Nodes/TableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,37 @@ import AsyncDisplayKit

@MainActor
open class TableNodeViewController: ASDKViewController<TableNode> {
public override var title: String? {
didSet {
navigationItem.setAccessibility(id: title)
}
}

public override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection)
node.reloadData()
}
}

public extension UINavigationItem {
func setAccessibility(id: String?) {
let titleLabel = UILabel()
titleLabel.attributedText = id?.attributed(
.medium(16),
color: .white,
alignment: .center
)
titleLabel.sizeToFit()
titleView = titleLabel

let accessibilityIdentifier = "navigationItem\((id ?? ""))"
.replacingOccurrences(of: " ", with: "")
.capitalized
titleLabel.isAccessibilityElement = true
titleLabel.accessibilityTraits = .header
titleView?.accessibilityIdentifier = accessibilityIdentifier
titleView?.isAccessibilityElement = true
titleView?.accessibilityTraits = .header
isAccessibilityElement = true
}
}
26 changes: 25 additions & 1 deletion appium/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,28 @@ To run a particular test:
- `npm run-script test.live "user is able to view text email"`
- `npm run-script test.mock "app setup fails with bad EKM URL"`

To run all tests: `npm run-script test.live.all` or `npm run-script test.mock.all`
To run all tests: `npm run-script test.live.all` or `npm run-script test.mock.all`

## 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.
4. Allow access in `System Prefferences -> Privacy Tab -> Accessibility`
5. Use next capabilities for `Appium Inspector`
`
{
"platformName": "iOS",
"iosInstallPause": 5000,
"deviceName": "iPhone 13",
"app": "*path to already buil app/FlowCrypt.app*",
"platformVersion": "15.0",
"automationName": "XCUITest",
"newCommandTimeout": 10000,
"wdaLaunchTimeout": 300000,
"wdaConnectionTimeout": 600000,
"wdaStartupRetries": 4,
"wdaStartupRetryInterval": 120000
}
`
6. Remote host - `127.0.0.1`, Port - `4723`, Path - `/wd/hub`
7. Run `Start Session`