appium-webdriveragent 15.0.0 → 15.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/WebDriverAgentLib/Categories/XCUIDevice+FBRotation.h +8 -0
- package/WebDriverAgentLib/Categories/XCUIDevice+FBRotation.m +21 -0
- package/WebDriverAgentLib/Commands/FBOrientationCommands.m +7 -0
- package/WebDriverAgentLib/Info.plist +2 -2
- package/WebDriverAgentTests/IntegrationTests/XCUIDeviceRotationTests.m +21 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [15.1.0](https://github.com/appium/WebDriverAgent/compare/v15.0.0...v15.1.0) (2026-06-26)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* Expose device orientation via /wda/deviceOrientation ([#1162](https://github.com/appium/WebDriverAgent/issues/1162)) ([deb623c](https://github.com/appium/WebDriverAgent/commit/deb623c71a0598f1932c8018f985b973aa2fb9ff))
|
|
6
|
+
|
|
1
7
|
## [15.0.0](https://github.com/appium/WebDriverAgent/compare/v14.2.1...v15.0.0) (2026-06-22)
|
|
2
8
|
|
|
3
9
|
### ⚠ BREAKING CHANGES
|
|
@@ -32,6 +32,14 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
32
32
|
/*! The UIDeviceOrientation to rotation mappings */
|
|
33
33
|
@property (strong, nonatomic, readonly) NSDictionary *fb_rotationMapping;
|
|
34
34
|
|
|
35
|
+
/**
|
|
36
|
+
The current physical device orientation as the raw UIDeviceOrientation name string,
|
|
37
|
+
e.g. UIDeviceOrientationPortrait, UIDeviceOrientationLandscapeLeft,
|
|
38
|
+
UIDeviceOrientationFaceUp. Returns UIDeviceOrientationUnknown if the orientation
|
|
39
|
+
cannot be determined.
|
|
40
|
+
*/
|
|
41
|
+
@property (copy, nonatomic, readonly) NSString *fb_deviceOrientation;
|
|
42
|
+
|
|
35
43
|
@end
|
|
36
44
|
#endif
|
|
37
45
|
|
|
@@ -64,6 +64,27 @@ static UIInterfaceOrientation FBInterfaceOrientationFromDeviceOrientation(UIDevi
|
|
|
64
64
|
return application.interfaceOrientation == FBInterfaceOrientationFromDeviceOrientation(orientation);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
- (NSString *)fb_deviceOrientation
|
|
68
|
+
{
|
|
69
|
+
switch (self.orientation) {
|
|
70
|
+
case UIDeviceOrientationPortrait:
|
|
71
|
+
return @"UIDeviceOrientationPortrait";
|
|
72
|
+
case UIDeviceOrientationPortraitUpsideDown:
|
|
73
|
+
return @"UIDeviceOrientationPortraitUpsideDown";
|
|
74
|
+
case UIDeviceOrientationLandscapeLeft:
|
|
75
|
+
return @"UIDeviceOrientationLandscapeLeft";
|
|
76
|
+
case UIDeviceOrientationLandscapeRight:
|
|
77
|
+
return @"UIDeviceOrientationLandscapeRight";
|
|
78
|
+
case UIDeviceOrientationFaceUp:
|
|
79
|
+
return @"UIDeviceOrientationFaceUp";
|
|
80
|
+
case UIDeviceOrientationFaceDown:
|
|
81
|
+
return @"UIDeviceOrientationFaceDown";
|
|
82
|
+
case UIDeviceOrientationUnknown:
|
|
83
|
+
default:
|
|
84
|
+
return @"UIDeviceOrientationUnknown";
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
67
88
|
- (NSDictionary *)fb_rotationMapping
|
|
68
89
|
{
|
|
69
90
|
static NSDictionary *rotationMap;
|
|
@@ -47,6 +47,8 @@ const struct FBWDOrientationValues FBWDOrientationValues = {
|
|
|
47
47
|
[[FBRoute GET:@"/rotation"].withoutSession respondWithTarget:self action:@selector(handleGetRotation:)],
|
|
48
48
|
[[FBRoute POST:@"/rotation"] respondWithTarget:self action:@selector(handleSetRotation:)],
|
|
49
49
|
[[FBRoute POST:@"/rotation"].withoutSession respondWithTarget:self action:@selector(handleSetRotation:)],
|
|
50
|
+
[[FBRoute GET:@"/wda/deviceOrientation"] respondWithTarget:self action:@selector(handleGetDeviceOrientation:)],
|
|
51
|
+
[[FBRoute GET:@"/wda/deviceOrientation"].withoutSession respondWithTarget:self action:@selector(handleGetDeviceOrientation:)],
|
|
50
52
|
];
|
|
51
53
|
}
|
|
52
54
|
|
|
@@ -113,6 +115,11 @@ const struct FBWDOrientationValues FBWDOrientationValues = {
|
|
|
113
115
|
return FBResponseWithOK();
|
|
114
116
|
}
|
|
115
117
|
|
|
118
|
+
+ (id<FBResponsePayload>)handleGetDeviceOrientation:(FBRouteRequest *)request
|
|
119
|
+
{
|
|
120
|
+
return FBResponseWithObject(XCUIDevice.sharedDevice.fb_deviceOrientation);
|
|
121
|
+
}
|
|
122
|
+
|
|
116
123
|
|
|
117
124
|
#pragma mark - Helpers
|
|
118
125
|
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
<key>CFBundlePackageType</key>
|
|
16
16
|
<string>FMWK</string>
|
|
17
17
|
<key>CFBundleShortVersionString</key>
|
|
18
|
-
<string>15.
|
|
18
|
+
<string>15.1.0</string>
|
|
19
19
|
<key>CFBundleSignature</key>
|
|
20
20
|
<string>????</string>
|
|
21
21
|
<key>CFBundleVersion</key>
|
|
22
|
-
<string>15.
|
|
22
|
+
<string>15.1.0</string>
|
|
23
23
|
<key>NSPrincipalClass</key>
|
|
24
24
|
<string/>
|
|
25
25
|
</dict>
|
|
@@ -69,6 +69,27 @@
|
|
|
69
69
|
XCTAssertTrue(self.testedApplication.staticTexts[@"LandscapeRight"].exists);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
- (void)testGetDeviceOrientationInPortrait
|
|
73
|
+
{
|
|
74
|
+
BOOL success = [[XCUIDevice sharedDevice] fb_setDeviceInterfaceOrientation:UIDeviceOrientationPortrait];
|
|
75
|
+
XCTAssertTrue(success, @"Device should support Portrait");
|
|
76
|
+
XCTAssertEqualObjects([XCUIDevice sharedDevice].fb_deviceOrientation, @"UIDeviceOrientationPortrait");
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
- (void)testGetDeviceOrientationInLandscapeLeft
|
|
80
|
+
{
|
|
81
|
+
BOOL success = [[XCUIDevice sharedDevice] fb_setDeviceInterfaceOrientation:UIDeviceOrientationLandscapeLeft];
|
|
82
|
+
XCTAssertTrue(success, @"Device should support LandscapeLeft");
|
|
83
|
+
XCTAssertEqualObjects([XCUIDevice sharedDevice].fb_deviceOrientation, @"UIDeviceOrientationLandscapeLeft");
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
- (void)testGetDeviceOrientationInLandscapeRight
|
|
87
|
+
{
|
|
88
|
+
BOOL success = [[XCUIDevice sharedDevice] fb_setDeviceInterfaceOrientation:UIDeviceOrientationLandscapeRight];
|
|
89
|
+
XCTAssertTrue(success, @"Device should support LandscapeRight");
|
|
90
|
+
XCTAssertEqualObjects([XCUIDevice sharedDevice].fb_deviceOrientation, @"UIDeviceOrientationLandscapeRight");
|
|
91
|
+
}
|
|
92
|
+
|
|
72
93
|
- (void)testRotationTiltRotation
|
|
73
94
|
{
|
|
74
95
|
UIDeviceOrientation currentRotation = [XCUIDevice sharedDevice].orientation;
|