@@ -29,8 +29,8 @@ final class AttachmentCameraControllerTests: XCTestCase {
29
29
let app = XCUIApplication ( )
30
30
let cameraModeController = app. otherElements [ " CameraMode " ]
31
31
let cameraModeLabel = app. staticTexts [ " Camera Capture Mode " ]
32
- let deviceOrientation = XCUIDevice . shared . orientation
33
- let deviceType = UIDevice . current . userInterfaceIdiom
32
+ let device = UIDevice . current . userInterfaceIdiom
33
+ let orientation = app . staticTexts [ " Device Orientation " ]
34
34
35
35
app. launch ( )
36
36
@@ -55,21 +55,21 @@ final class AttachmentCameraControllerTests: XCTestCase {
55
55
cameraModeController. waitForExistence ( timeout: 5 )
56
56
)
57
57
58
- if deviceType == . pad {
58
+ if device == . pad || ( device == . phone && orientation . label == " Landscape Right " ) {
59
59
cameraModeController. swipeDown ( )
60
- } else if deviceOrientation . isLandscape && deviceType == . phone {
60
+ } else if orientation . label == " Landscape Left " {
61
61
cameraModeController. swipeUp ( )
62
- } else {
62
+ } else /* iPhone - portrait */ {
63
63
cameraModeController. swipeRight ( )
64
64
}
65
65
66
66
XCTAssertEqual ( cameraModeLabel. label, " Video " )
67
67
68
- if deviceType == . pad {
68
+ if device == . pad || ( device == . phone && orientation . label == " Landscape Right " ) {
69
69
cameraModeController. swipeUp ( )
70
- } else if deviceOrientation . isLandscape && deviceType == . phone {
70
+ } else if orientation . label == " Landscape Left " {
71
71
cameraModeController. swipeDown ( )
72
- } else {
72
+ } else /* iPhone - portrait */ {
73
73
cameraModeController. swipeLeft ( )
74
74
}
75
75
0 commit comments