1
- #if IOS
1
+ #if TEST_FAILS_ON_CATALYST && TEST_FAILS_ON_WINDOWS //The test fails on Windows and MacCatalyst because the SetOrientation method, which is intended to change the device orientation, is only supported on mobile platforms Android and iOS.
2
2
using NUnit . Framework ;
3
3
using UITest . Appium ;
4
4
using UITest . Core ;
@@ -7,51 +7,37 @@ namespace Microsoft.Maui.TestCases.Tests.Issues;
7
7
8
8
public class Issue1614 : _IssuesUITest
9
9
{
10
+ #if ANDROID
11
+ const string Done = "Cancel" ;
12
+ #else
13
+ const string Done = "Done" ;
14
+ #endif
15
+
10
16
public Issue1614 ( TestDevice testDevice ) : base ( testDevice )
11
17
{
12
18
}
13
19
14
20
public override string Issue => "iOS 11 prevents InputAccessoryView from showing in landscape mode" ;
15
21
16
- // [Test]
17
- // [FailsOnIOS]
18
- // public void Issue1614Test()
19
- // {
20
- // App.SetOrientationPortrait();
21
-
22
- // App.WaitForElement(x => x.Class("UITextField"));
23
- // App.Tap(x => x.Class("UITextField").Index(0));
24
- // CheckPickerAccessory("UIPickerView");
25
- // App.SetOrientationLandscape();
26
- // CheckPickerAccessory("UIPickerView");
27
- // App.SetOrientationPortrait();
28
- // App.DismissKeyboard();
29
-
30
- // App.Tap(x => x.Class("UITextField").Index(1));
31
- // CheckPickerAccessory("UIDatePicker");
32
- // App.SetOrientationLandscape();
33
- // CheckPickerAccessory("UIDatePicker");
34
- // App.SetOrientationPortrait();
35
- // App.DismissKeyboard();
36
-
37
- // App.Tap(x => x.Class("UITextField").Index(2));
38
- // CheckPickerAccessory("UIDatePicker");
39
- // App.SetOrientationLandscape();
40
- // CheckPickerAccessory("UIDatePicker");
41
- // App.SetOrientationPortrait();
42
- // App.DismissKeyboard();
43
- // }
44
-
45
- // private void CheckPickerAccessory(string className)
46
- // {
47
- // App.WaitForElement(x => x.Class("UIButtonLabel"));
48
- // var buttonRect = App.Query(x => x.Class("UIButtonLabel"))[0].Rect;
49
- // var pickerRect = App.Query(x => x.Class(className))[0].Rect;
50
-
51
- // var buttonBottom = buttonRect.Y + buttonRect.Height;
52
- // var pickerTop = pickerRect.Y;
22
+ [ Test ]
23
+ [ Category ( UITestCategories . Picker ) ]
24
+ public void Issue1614Test ( )
25
+ {
26
+ TapPicker ( "Picker" ) ;
27
+ TapPicker ( "DatePicker" ) ;
28
+ TapPicker ( "TimePicker" ) ;
29
+ }
53
30
54
- // Assert.IsTrue(buttonBottom <= pickerTop);
55
- // }
31
+ void TapPicker ( string picker )
32
+ {
33
+ App . WaitForElement ( picker ) ;
34
+ App . Tap ( picker ) ;
35
+ App . WaitForElement ( Done ) ;
36
+ App . SetOrientationLandscape ( ) ;
37
+ App . WaitForElement ( Done ) ;
38
+ App . SetOrientationPortrait ( ) ;
39
+ App . WaitForElement ( Done ) ;
40
+ App . Tap ( Done ) ;
41
+ }
56
42
}
57
43
#endif
0 commit comments