Skip to content

Commit 931aa8c

Browse files
dispatchMainkhandpur
authored andcommittedSep 20, 2017
ScrollView without content, scroll to content edge issue simulation. Added disable unit test.
1 parent 25e2a34 commit 931aa8c

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed
 

‎Tests/FunctionalTests/Sources/FTRScrollViewTest.m

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ - (void)setUp {
2828
[self openTestViewNamed:@"Scroll Views"];
2929
}
3030

31+
- (void)DISABLED_testFreezingScrollView {
32+
[[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"Freezing Scroll View")] performAction:grey_scrollToContentEdge(kGREYContentEdgeTop)];
33+
}
34+
3135
- (void)testScrollToTopEdge {
3236
id<GREYMatcher> matcher = grey_allOf(grey_accessibilityLabel(@"Label 2"),
3337
grey_interactable(),

‎Tests/FunctionalTests/TestRig/Sources/FTRScrollViewController.h

+1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@
2727
@property(retain, nonatomic) IBOutlet UIView *blockView;
2828
@property(retain, nonatomic) IBOutlet UITextField *topTextbox;
2929
@property(retain, nonatomic) UIAccessibilityElement *accessibilityElement;
30+
@property (weak, nonatomic) IBOutlet UIScrollView *freezingScrollView;
3031

3132
@end

‎Tests/FunctionalTests/TestRig/Sources/FTRScrollViewController.m

+3
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ - (void)viewDidLoad {
132132
[self.scrollview addSubview:_squareView];
133133
self.scrollview.delegate = self;
134134
self.topTextbox.delegate = self;
135+
136+
self.freezingScrollView.isAccessibilityElement = YES;
137+
self.freezingScrollView.accessibilityLabel = @"Freezing Scroll View";
135138

136139
// Required to disable the swipe from edge to go back gesture as it can interfere with tests.
137140
[self.navigationItem setHidesBackButton:YES animated:NO];

‎Tests/FunctionalTests/TestRig/Sources/FTRScrollViewController.xib

+10
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<connections>
1212
<outlet property="blockView" destination="nuR-Jb-FaD" id="qSh-fP-zy4"/>
1313
<outlet property="bottomScrollView" destination="V9g-g7-db5" id="FeH-5p-YD4"/>
14+
<outlet property="freezingScrollView" destination="ocp-2V-YZR" id="scv-CJ-J4f"/>
1415
<outlet property="infiniteScrollView" destination="td9-NB-ySB" id="1hm-gw-wSx"/>
1516
<outlet property="scrollview" destination="5d8-Eo-Ig8" id="uuc-2e-jvK"/>
1617
<outlet property="topTextbox" destination="P3e-SN-PxX" id="sYS-qn-3Bw"/>
@@ -428,6 +429,12 @@
428429
<rect key="frame" x="0.0" y="488" width="1024" height="123"/>
429430
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
430431
</view>
432+
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ocp-2V-YZR">
433+
<rect key="frame" x="16" y="439" width="343" height="128"/>
434+
<constraints>
435+
<constraint firstAttribute="height" constant="128" id="Hzo-CS-qZL"/>
436+
</constraints>
437+
</scrollView>
431438
</subviews>
432439
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
433440
<constraints>
@@ -440,10 +447,13 @@
440447
<constraint firstItem="nuR-Jb-FaD" firstAttribute="top" secondItem="V9g-g7-db5" secondAttribute="top" constant="82" id="Dqt-W9-oIC"/>
441448
<constraint firstAttribute="trailing" secondItem="td9-NB-ySB" secondAttribute="trailing" id="Ekc-nI-mMv"/>
442449
<constraint firstItem="nuR-Jb-FaD" firstAttribute="bottom" secondItem="V9g-g7-db5" secondAttribute="bottom" constant="5" id="JRf-4g-S0e"/>
450+
<constraint firstItem="ocp-2V-YZR" firstAttribute="top" secondItem="nuR-Jb-FaD" secondAttribute="bottom" constant="31" id="MFu-Qw-cHz"/>
451+
<constraint firstAttribute="trailing" secondItem="ocp-2V-YZR" secondAttribute="trailing" constant="16" id="Nvb-pq-Q0d"/>
443452
<constraint firstItem="5d8-Eo-Ig8" firstAttribute="leading" secondItem="1" secondAttribute="leading" id="PGh-w8-S6v"/>
444453
<constraint firstAttribute="trailing" secondItem="td9-NB-ySB" secondAttribute="trailing" id="QIa-ig-FOJ"/>
445454
<constraint firstAttribute="trailing" secondItem="V9g-g7-db5" secondAttribute="trailing" id="WyT-xF-GKs"/>
446455
<constraint firstItem="Wff-P0-8YW" firstAttribute="leading" secondItem="P3e-SN-PxX" secondAttribute="trailing" constant="4" id="eIg-VY-OEN"/>
456+
<constraint firstItem="ocp-2V-YZR" firstAttribute="leading" secondItem="1" secondAttribute="leading" constant="16" id="ebm-99-Amq"/>
447457
<constraint firstAttribute="trailing" secondItem="5d8-Eo-Ig8" secondAttribute="trailing" id="hDZ-Ut-Hvi"/>
448458
<constraint firstItem="V9g-g7-db5" firstAttribute="leading" secondItem="1" secondAttribute="leading" id="iCv-II-YGu"/>
449459
<constraint firstItem="5d8-Eo-Ig8" firstAttribute="top" secondItem="P3e-SN-PxX" secondAttribute="bottom" constant="8" symbolic="YES" id="kZZ-PF-dfv"/>

0 commit comments

Comments
 (0)
Please sign in to comment.