Skip to content

Commit ad6edc2

Browse files
committed
Adding ids
1 parent 007ff1d commit ad6edc2

File tree

2 files changed

+51
-5
lines changed

2 files changed

+51
-5
lines changed

MSAL/test/app/ios/MSALTestAppAcquireTokenViewController.m

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ - (void)viewDidLoad
152152
CFNotificationCenterRef center = CFNotificationCenterGetDarwinNotifyCenter();
153153
CFNotificationCenterAddObserver(center, nil, sharedModeAccountChangedCallback, (CFStringRef)MSID_SHARED_MODE_CURRENT_ACCOUNT_CHANGED_NOTIFICATION_KEY,
154154
nil, CFNotificationSuspensionBehaviorDeliverImmediately);
155+
[self addAccessibilityIdentifiers];
155156
}
156157

157158
- (void)viewWillAppear:(BOOL)animated
@@ -794,4 +795,43 @@ - (void) receivedGlobalSignoutDarwinNotification:(NSNotification *)notification
794795
self.resultTextView.text = @"Darwin notification received from the broker SDK indicating the device is in shared mode and the current account changed.";
795796
}
796797

798+
- (void)addAccessibilityIdentifiers
799+
{
800+
for (UIView *view in self.validateAuthoritySegmentControl.subviews)
801+
{
802+
if ([@"Yes" isEqualToString:view.accessibilityLabel])
803+
{
804+
view.accessibilityIdentifier = @"validateAuthorityYes";
805+
}
806+
else if ([@"No" isEqualToString:view.accessibilityLabel])
807+
{
808+
view.accessibilityIdentifier = @"validateAuthorityNo";
809+
}
810+
}
811+
812+
for (UIView *view in self.instanceAwareSegmentControl.subviews)
813+
{
814+
if ([@"Yes" isEqualToString:view.accessibilityLabel])
815+
{
816+
view.accessibilityIdentifier = @"instanceAwareYes";
817+
}
818+
else if ([@"No" isEqualToString:view.accessibilityLabel])
819+
{
820+
view.accessibilityIdentifier = @"instanceAwareNo";
821+
}
822+
}
823+
824+
for (UIView *view in self.systemWebviewSSOSegmentControl.subviews)
825+
{
826+
if ([@"Yes" isEqualToString:view.accessibilityLabel])
827+
{
828+
view.accessibilityIdentifier = @"systemWebViewYes";
829+
}
830+
else if ([@"No" isEqualToString:view.accessibilityLabel])
831+
{
832+
view.accessibilityIdentifier = @"systemWebViewNo";
833+
}
834+
}
835+
}
836+
797837
@end

MSAL/test/app/ios/MSALTestAppAcquireTokenViewController.storyboard

Lines changed: 11 additions & 5 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="19150" 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="32700.99.1234" 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="19134"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
77
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
88
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
99
</dependencies>
@@ -63,10 +63,10 @@
6363
</constraints>
6464
</view>
6565
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dqB-h4-utQ">
66-
<rect key="frame" x="0.0" y="44" width="414" height="818"/>
66+
<rect key="frame" x="0.0" y="48" width="414" height="814"/>
6767
<subviews>
6868
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" translatesAutoresizingMaskIntoConstraints="NO" id="nD8-Re-oHc">
69-
<rect key="frame" x="0.0" y="0.0" width="414" height="788"/>
69+
<rect key="frame" x="0.0" y="0.0" width="414" height="784"/>
7070
<subviews>
7171
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="vM0-VN-Vm6">
7272
<rect key="frame" x="0.0" y="0.0" width="414" height="868"/>
@@ -88,6 +88,7 @@
8888
</label>
8989
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="WcD-VP-hFc">
9090
<rect key="frame" x="124" y="0.0" width="250" height="34"/>
91+
<accessibility key="accessibilityConfiguration" identifier="select-profile" label="select-profile"/>
9192
<state key="normal" title="Test App"/>
9293
<connections>
9394
<action selector="onSelectProfileButtonTapped:" destination="7Mt-tc-cPe" eventType="touchUpInside" id="zjn-Y2-237"/>
@@ -109,6 +110,7 @@
109110
</label>
110111
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="VO4-Cz-Zs9">
111112
<rect key="frame" x="124" y="0.0" width="250" height="34"/>
113+
<accessibility key="accessibilityConfiguration" identifier="select-authority" label="select-authority"/>
112114
<state key="normal" title="Default"/>
113115
<connections>
114116
<action selector="onSelectAuthorityButtonTapped:" destination="7Mt-tc-cPe" eventType="touchUpInside" id="bPE-mX-bao"/>
@@ -172,6 +174,7 @@
172174
</label>
173175
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="lkS-vB-ubC">
174176
<rect key="frame" x="124" y="0.0" width="250" height="34"/>
177+
<accessibility key="accessibilityConfiguration" identifier="select-loginhint" label="select-loginhint"/>
175178
<fontDescription key="fontDescription" type="system" pointSize="14"/>
176179
<textInputTraits key="textInputTraits"/>
177180
<connections>
@@ -194,6 +197,7 @@
194197
</label>
195198
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="lVb-Iy-zgo">
196199
<rect key="frame" x="124" y="0.0" width="250" height="34"/>
200+
<accessibility key="accessibilityConfiguration" identifier="select-user" label="select-user"/>
197201
<state key="normal" title="User"/>
198202
<connections>
199203
<action selector="onSelectUserButtonTapped:" destination="7Mt-tc-cPe" eventType="touchUpInside" id="CYC-40-mrB"/>
@@ -215,6 +219,7 @@
215219
</label>
216220
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="2YX-cm-swG">
217221
<rect key="frame" x="124" y="0.0" width="250" height="34"/>
222+
<accessibility key="accessibilityConfiguration" identifier="select-scopes" label="select-scopes"/>
218223
<state key="normal" title="Select Scopes"/>
219224
<connections>
220225
<action selector="onSelectScopeButtonTapped:" destination="7Mt-tc-cPe" eventType="touchUpInside" id="YVc-tV-tFS"/>
@@ -326,6 +331,7 @@
326331
</label>
327332
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="N35-g1-oxz">
328333
<rect key="frame" x="124" y="0.0" width="250" height="34"/>
334+
<accessibility key="accessibilityConfiguration" identifier="select-eqp" label="select-eqp"/>
329335
<fontDescription key="fontDescription" type="system" pointSize="14"/>
330336
<textInputTraits key="textInputTraits"/>
331337
<connections>
@@ -441,7 +447,7 @@
441447
</constraints>
442448
</scrollView>
443449
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="T9E-F1-l3O">
444-
<rect key="frame" x="0.0" y="788" width="414" height="30"/>
450+
<rect key="frame" x="0.0" y="784" width="414" height="30"/>
445451
<subviews>
446452
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="tWi-d4-WNB">
447453
<rect key="frame" x="13.5" y="0.0" width="387" height="30"/>

0 commit comments

Comments
 (0)