Skip to content

Commit bb6dbc0

Browse files
committed
Automated UI tests for authentication flows.
1 parent 416ef5f commit bb6dbc0

File tree

13 files changed

+276
-57
lines changed

13 files changed

+276
-57
lines changed

.semver

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.4.17
1+
1.4.18

Raivo.xcodeproj/project.pbxproj

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@
7979
70684DEF225A1BF70038BDB4 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70684DEE225A1BF70038BDB4 /* main.swift */; };
8080
70684DF1225A2ED90038BDB4 /* MiscellaneousForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70684DF0225A2ED90038BDB4 /* MiscellaneousForm.swift */; };
8181
70684DF4225A37630038BDB4 /* MiscellaneousInactivityLockFormOption.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70684DF3225A37630038BDB4 /* MiscellaneousInactivityLockFormOption.swift */; };
82+
706ED9BD2A4A218E00CE66D6 /* AuthRoboticTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 706ED9BC2A4A218E00CE66D6 /* AuthRoboticTest.swift */; };
83+
706ED9BF2A4A21FB00CE66D6 /* AuthFlowHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 706ED9BE2A4A21FB00CE66D6 /* AuthFlowHelper.swift */; };
8284
706FD81522EB71A500F433F7 /* QuickResponseCodeForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 706FD81422EB71A500F433F7 /* QuickResponseCodeForm.swift */; };
8385
7076C22622E7909000AFBDD9 /* MainQuickResponseCodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7076C22522E7909000AFBDD9 /* MainQuickResponseCodeViewController.swift */; };
8486
7077A337227CC84F00338CA3 /* PasswordAlgorithmFormOption.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7077A336227CC84F00338CA3 /* PasswordAlgorithmFormOption.swift */; };
@@ -290,6 +292,8 @@
290292
70684DEE225A1BF70038BDB4 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
291293
70684DF0225A2ED90038BDB4 /* MiscellaneousForm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MiscellaneousForm.swift; sourceTree = "<group>"; };
292294
70684DF3225A37630038BDB4 /* MiscellaneousInactivityLockFormOption.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MiscellaneousInactivityLockFormOption.swift; sourceTree = "<group>"; };
295+
706ED9BC2A4A218E00CE66D6 /* AuthRoboticTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthRoboticTest.swift; sourceTree = "<group>"; };
296+
706ED9BE2A4A21FB00CE66D6 /* AuthFlowHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthFlowHelper.swift; sourceTree = "<group>"; };
293297
706FD81422EB71A500F433F7 /* QuickResponseCodeForm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuickResponseCodeForm.swift; sourceTree = "<group>"; };
294298
7076C22522E7909000AFBDD9 /* MainQuickResponseCodeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainQuickResponseCodeViewController.swift; sourceTree = "<group>"; };
295299
7077A336227CC84F00338CA3 /* PasswordAlgorithmFormOption.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasswordAlgorithmFormOption.swift; sourceTree = "<group>"; };
@@ -663,6 +667,7 @@
663667
isa = PBXGroup;
664668
children = (
665669
70F2DB80238D9A4C00CFF63F /* SetupFlowHelper.swift */,
670+
706ED9BE2A4A21FB00CE66D6 /* AuthFlowHelper.swift */,
666671
);
667672
path = Flows;
668673
sourceTree = "<group>";
@@ -768,6 +773,14 @@
768773
path = Options;
769774
sourceTree = "<group>";
770775
};
776+
706ED9BB2A4A215100CE66D6 /* Auth */ = {
777+
isa = PBXGroup;
778+
children = (
779+
706ED9BC2A4A218E00CE66D6 /* AuthRoboticTest.swift */,
780+
);
781+
path = Auth;
782+
sourceTree = "<group>";
783+
};
771784
7077A333227CC75E00338CA3 /* Rows */ = {
772785
isa = PBXGroup;
773786
children = (
@@ -1077,6 +1090,7 @@
10771090
70F2DB7C238D4E4700CFF63F /* Flows */ = {
10781091
isa = PBXGroup;
10791092
children = (
1093+
706ED9BB2A4A215100CE66D6 /* Auth */,
10801094
70F64B53238EF3B300A5F56E /* Setup */,
10811095
);
10821096
path = Flows;
@@ -1458,7 +1472,9 @@
14581472
buildActionMask = 2147483647;
14591473
files = (
14601474
701ECE3C23D387700015D12A /* HumanDelayHelper.swift in Sources */,
1475+
706ED9BD2A4A218E00CE66D6 /* AuthRoboticTest.swift in Sources */,
14611476
70F2DB81238D9A4C00CFF63F /* SetupFlowHelper.swift in Sources */,
1477+
706ED9BF2A4A21FB00CE66D6 /* AuthFlowHelper.swift in Sources */,
14621478
70F64B76238F082400A5F56E /* BiometricHelper.swift in Sources */,
14631479
70631CAE230DC2A10040DD71 /* SetupRoboticTest.swift in Sources */,
14641480
);
@@ -1621,7 +1637,7 @@
16211637
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
16221638
CODE_SIGN_ENTITLEMENTS = Raivo/Raivo.entitlements;
16231639
CODE_SIGN_STYLE = Automatic;
1624-
CURRENT_PROJECT_VERSION = 82;
1640+
CURRENT_PROJECT_VERSION = 83;
16251641
DEVELOPMENT_TEAM = 564B4ETY69;
16261642
INFOPLIST_FILE = "$(SRCROOT)/Raivo/Supporting/Info.plist";
16271643
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.productivity";
@@ -1630,7 +1646,7 @@
16301646
"$(inherited)",
16311647
"@executable_path/Frameworks",
16321648
);
1633-
MARKETING_VERSION = 1.4.17;
1649+
MARKETING_VERSION = 1.4.18;
16341650
PRODUCT_BUNDLE_IDENTIFIER = com.finnwea.Raivo.Debug;
16351651
PRODUCT_NAME = "$(TARGET_NAME)";
16361652
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@@ -1648,7 +1664,7 @@
16481664
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
16491665
CODE_SIGN_ENTITLEMENTS = Raivo/Raivo.entitlements;
16501666
CODE_SIGN_STYLE = Automatic;
1651-
CURRENT_PROJECT_VERSION = 82;
1667+
CURRENT_PROJECT_VERSION = 83;
16521668
DEVELOPMENT_TEAM = 564B4ETY69;
16531669
INFOPLIST_FILE = "$(SRCROOT)/Raivo/Supporting/Info.plist";
16541670
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.productivity";
@@ -1657,7 +1673,7 @@
16571673
"$(inherited)",
16581674
"@executable_path/Frameworks",
16591675
);
1660-
MARKETING_VERSION = 1.4.17;
1676+
MARKETING_VERSION = 1.4.18;
16611677
PRODUCT_NAME = "$(TARGET_NAME)";
16621678
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
16631679
SUPPORTS_MACCATALYST = NO;
@@ -1673,13 +1689,17 @@
16731689
CODE_SIGN_STYLE = Automatic;
16741690
DEVELOPMENT_TEAM = 564B4ETY69;
16751691
INFOPLIST_FILE = RaivoUITests/Info.plist;
1692+
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
16761693
LD_RUNPATH_SEARCH_PATHS = (
16771694
"$(inherited)",
16781695
"@executable_path/Frameworks",
16791696
"@loader_path/Frameworks",
16801697
);
16811698
PRODUCT_BUNDLE_IDENTIFIER = com.finnwea.RaivoUITests;
16821699
PRODUCT_NAME = "$(TARGET_NAME)";
1700+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
1701+
SUPPORTS_MACCATALYST = NO;
1702+
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
16831703
SWIFT_VERSION = 5.0;
16841704
TARGETED_DEVICE_FAMILY = "1,2";
16851705
TEST_TARGET_NAME = Raivo;
@@ -1692,13 +1712,17 @@
16921712
CODE_SIGN_STYLE = Automatic;
16931713
DEVELOPMENT_TEAM = 564B4ETY69;
16941714
INFOPLIST_FILE = RaivoUITests/Info.plist;
1715+
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
16951716
LD_RUNPATH_SEARCH_PATHS = (
16961717
"$(inherited)",
16971718
"@executable_path/Frameworks",
16981719
"@loader_path/Frameworks",
16991720
);
17001721
PRODUCT_BUNDLE_IDENTIFIER = com.finnwea.RaivoUITests;
17011722
PRODUCT_NAME = "$(TARGET_NAME)";
1723+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
1724+
SUPPORTS_MACCATALYST = NO;
1725+
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
17021726
SWIFT_VERSION = 5.0;
17031727
TARGETED_DEVICE_FAMILY = "1,2";
17041728
TEST_TARGET_NAME = Raivo;

Raivo/Controllers/Auth/AuthEntryViewController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class AuthEntryViewController: UIViewController, UIPasscodeFieldDelegate {
3030

3131
biometricButton.isHidden = !StorageHelper.shared.getBiometricUnlockEnabled()
3232

33+
passcodeField.shadowAccessibilityIdentifier = "passcode"
3334
passcodeField.delegate = self
3435
passcodeField.layoutIfNeeded()
3536

Raivo/Forms/MiscellaneousForm.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ class MiscellaneousForm {
458458

459459
<<< ButtonRow("sign_out", { row in
460460
row.title = "Sign out of Raivo"
461+
row.cell.accessibilityIdentifier = "miscSignOut"
461462
}).cellUpdate({ cell, row in
462463
cell.textLabel?.textAlignment = .left
463464
cell.imageView?.image = UIImage(named: "form-logout")

Raivo/Helpers/AppHelper.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,7 @@ class AppHelper {
7777
/// If the current runtime should reset the app state before startup
7878
public static let argumentResetState = CommandLine.arguments.contains("--ResetState")
7979

80+
/// If the current runtime should disable biometric unlock
81+
public static let argumentDisableBiometrics = CommandLine.arguments.contains("--DisableBiometrics")
82+
8083
}

Raivo/Helpers/StorageHelper.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,10 @@ class StorageHelper {
315315
///
316316
/// - Returns: Positive if biometric unlock is enabled
317317
public func getBiometricUnlockEnabled() -> Bool {
318+
guard !AppHelper.argumentDisableBiometrics else {
319+
return false
320+
}
321+
318322
guard let enabled = try? globals().string(forKey: Key.BIOMETRIC_AUTHENTICATION_ENABLED) else {
319323
return false
320324
}

Raivo/Storyboards/Auth.storyboard

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
33
<device id="retina6_1" orientation="portrait" appearance="light"/>
44
<dependencies>
55
<deployment identifier="iOS"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
77
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
88
<capability name="System colors in document resources" minToolsVersion="11.0"/>
99
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
@@ -30,7 +30,7 @@
3030
<objects>
3131
<navigationController restorationIdentifier="AuthRootController" storyboardIdentifier="AuthRootController" id="gmH-zH-eht" customClass="AuthRootViewController" customModule="Raivo" customModuleProvider="target" sceneMemberID="viewController">
3232
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="NvE-Ep-Hsc">
33-
<rect key="frame" x="0.0" y="44" width="414" height="44"/>
33+
<rect key="frame" x="0.0" y="48" width="414" height="44"/>
3434
<autoresizingMask key="autoresizingMask"/>
3535
</navigationBar>
3636
<connections>
@@ -53,13 +53,13 @@
5353
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
5454
</imageView>
5555
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="oRd-ny-Rp6" userLabel="Wrapper">
56-
<rect key="frame" x="0.0" y="88" width="414" height="774"/>
56+
<rect key="frame" x="0.0" y="92" width="414" height="770"/>
5757
<subviews>
5858
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="PVE-R8-zi7" userLabel="Content">
59-
<rect key="frame" x="0.0" y="0.0" width="414" height="774"/>
59+
<rect key="frame" x="0.0" y="0.0" width="414" height="770"/>
6060
<subviews>
6161
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" alignment="center" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="5nT-3F-W59">
62-
<rect key="frame" x="0.0" y="236" width="414" height="302"/>
62+
<rect key="frame" x="0.0" y="234" width="414" height="302"/>
6363
<subviews>
6464
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="app-icon" translatesAutoresizingMaskIntoConstraints="NO" id="GWG-jo-ayS" userLabel="Logo">
6565
<rect key="frame" x="127" y="0.0" width="160" height="160"/>
@@ -127,6 +127,7 @@
127127
</subviews>
128128
<viewLayoutGuide key="safeArea" id="q9X-y2-Q3g"/>
129129
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
130+
<accessibility key="accessibilityConfiguration" identifier="authEntry"/>
130131
<constraints>
131132
<constraint firstItem="q9X-y2-Q3g" firstAttribute="trailing" secondItem="oRd-ny-Rp6" secondAttribute="trailing" id="23Z-bq-p2y"/>
132133
<constraint firstAttribute="bottom" secondItem="Vz1-KG-knS" secondAttribute="bottom" id="K1l-BU-u1v"/>

0 commit comments

Comments
 (0)