File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ - (void)beforeAll
1919 [tester waitForTimeInterval: 0.5 ];
2020
2121 // only scroll if we are on iphone
22- if (UIDevice.currentDevice .userInterfaceIdiom == UIUserInterfaceIdiomPhone) {
22+ if (UIDevice.currentDevice .userInterfaceIdiom == UIUserInterfaceIdiomPhone) {
2323 [tester scrollViewWithAccessibilityIdentifier: @" Test Suite TableView" byFractionOfSizeHorizontal: 0 vertical: -0.2 ];
2424 }
2525}
@@ -33,7 +33,14 @@ - (void)afterAll
3333- (void )testThatAlertViewsCanBeTappedInLandscape
3434{
3535 [tester tapViewWithAccessibilityLabel: @" UIAlertController" ];
36- [tester tapViewWithAccessibilityLabel: @" Cancel" ];
36+ if (UIDevice.currentDevice .userInterfaceIdiom == UIUserInterfaceIdiomPhone) {
37+ [tester tapViewWithAccessibilityLabel: @" Cancel" ];
38+ } else {
39+ /* On iPadOS the UIAlertController is displayed as a popup over table view cell, there's no "Cancel" button.
40+ It can be dismissed by tapping anywhere on the screen.
41+ */
42+ [tester tapScreenAtPoint: CGPointMake (1 , 1 )];
43+ }
3744 [tester tapViewWithAccessibilityLabel: @" Continue" ];
3845 [tester waitForAbsenceOfViewWithAccessibilityLabel: @" Alert View" ];
3946}
Original file line number Diff line number Diff line change @@ -33,7 +33,15 @@ - (void)beforeEach
3333- (void )testThatAlertViewsCanBeTappedInLandscape
3434{
3535 [viewTester tapRowInTableViewAtIndexPath: [NSIndexPath indexPathForRow: 1 inSection: 1 ]];
36- [[viewTester usingLabel: @" Cancel" ] tap ];
36+
37+ if (UIDevice.currentDevice .userInterfaceIdiom == UIUserInterfaceIdiomPhone) {
38+ [[viewTester usingLabel: @" Cancel" ] tap ];
39+ } else {
40+ /* On iPadOS the UIAlertController is displayed as a popup over table view cell, there's no "Cancel" button.
41+ It can be dismissed by tapping anywhere on the screen.
42+ */
43+ [viewTester tapRowInTableViewAtIndexPath: [NSIndexPath indexPathForRow: 1 inSection: 1 ]];
44+ }
3745 [[viewTester usingLabel: @" Continue" ] tap ];
3846 [[viewTester usingLabel: @" Message" ] waitForAbsenceOfView ];
3947}
You can’t perform that action at this time.
0 commit comments