appium-webdriveragent 5.15.6 → 5.15.7
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 +12 -0
- package/PrivateHeaders/XCTest/XCUIApplication.h +0 -1
- package/WebDriverAgent.xcodeproj/project.pbxproj +6 -18
- package/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.h +38 -0
- package/WebDriverAgentLib/Categories/XCUIApplication+FBHelpers.m +148 -5
- package/WebDriverAgentLib/Categories/XCUIDevice+FBHelpers.m +1 -1
- package/WebDriverAgentLib/Categories/XCUIDevice+FBRotation.h +0 -1
- package/WebDriverAgentLib/Categories/XCUIDevice+FBRotation.m +5 -3
- package/WebDriverAgentLib/Categories/XCUIElement+FBTVFocuse.m +2 -2
- package/WebDriverAgentLib/Commands/FBAlertViewCommands.m +4 -4
- package/WebDriverAgentLib/Commands/FBCustomCommands.m +2 -2
- package/WebDriverAgentLib/Commands/FBDebugCommands.m +2 -3
- package/WebDriverAgentLib/Commands/FBElementCommands.m +2 -4
- package/WebDriverAgentLib/Commands/FBFindElementCommands.m +0 -1
- package/WebDriverAgentLib/Commands/FBOrientationCommands.m +9 -8
- package/WebDriverAgentLib/Commands/FBSessionCommands.m +7 -9
- package/WebDriverAgentLib/Commands/FBTouchActionCommands.m +0 -1
- package/WebDriverAgentLib/FBAlert.m +3 -3
- package/WebDriverAgentLib/Routing/FBSession.h +13 -14
- package/WebDriverAgentLib/Routing/FBSession.m +49 -46
- package/WebDriverAgentLib/Utilities/FBAlertsMonitor.m +3 -3
- package/WebDriverAgentLib/Utilities/FBKeyboard.m +6 -5
- package/WebDriverAgentLib/Utilities/FBMjpegServer.m +0 -1
- package/WebDriverAgentLib/Utilities/FBPasteboard.m +2 -2
- package/WebDriverAgentLib/Utilities/FBScreen.m +1 -2
- package/WebDriverAgentLib/Utilities/FBTVNavigationTracker.m +1 -2
- package/WebDriverAgentLib/Utilities/FBXCodeCompatibility.h +0 -33
- package/WebDriverAgentLib/Utilities/FBXCodeCompatibility.m +2 -40
- package/WebDriverAgentLib/WebDriverAgentLib.h +0 -1
- package/WebDriverAgentTests/IntegrationTests/FBAutoAlertsHandlerTests.m +2 -3
- package/WebDriverAgentTests/IntegrationTests/FBElementVisibilityTests.m +0 -1
- package/WebDriverAgentTests/IntegrationTests/FBIntegrationTestCase.h +1 -3
- package/WebDriverAgentTests/IntegrationTests/FBIntegrationTestCase.m +5 -5
- package/WebDriverAgentTests/IntegrationTests/FBSafariAlertTests.m +1 -2
- package/WebDriverAgentTests/IntegrationTests/FBSessionIntegrationTests.m +11 -10
- package/WebDriverAgentTests/IntegrationTests/FBTapTest.m +0 -1
- package/WebDriverAgentTests/IntegrationTests/FBW3CMultiTouchActionsIntegrationTests.m +0 -1
- package/WebDriverAgentTests/IntegrationTests/XCUIApplicationHelperTests.m +8 -8
- package/WebDriverAgentTests/IntegrationTests/XCUIDeviceHelperTests.m +5 -4
- package/WebDriverAgentTests/IntegrationTests/XCUIElementHelperIntegrationTests.m +0 -1
- package/WebDriverAgentTests/UnitTests/Doubles/{FBApplicationDouble.h → XCUIApplicationDouble.h} +1 -1
- package/WebDriverAgentTests/UnitTests/Doubles/{FBApplicationDouble.m → XCUIApplicationDouble.m} +3 -3
- package/WebDriverAgentTests/UnitTests/FBSessionTests.m +3 -3
- package/package.json +2 -2
- package/WebDriverAgentLib/FBApplication.h +0 -49
- package/WebDriverAgentLib/FBApplication.m +0 -185
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [5.15.7](https://github.com/appium/WebDriverAgent/compare/v5.15.6...v5.15.7) (2024-01-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Miscellaneous Chores
|
|
5
|
+
|
|
6
|
+
* **deps-dev:** bump semantic-release from 22.0.12 to 23.0.0 ([#836](https://github.com/appium/WebDriverAgent/issues/836)) ([a3ac2c5](https://github.com/appium/WebDriverAgent/commit/a3ac2c58786955507a34d0adcc4a53cd30f55014))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Code Refactoring
|
|
10
|
+
|
|
11
|
+
* Ditch FBApplication in favour of XCUIApplication extensions ([#834](https://github.com/appium/WebDriverAgent/issues/834)) ([70a8d98](https://github.com/appium/WebDriverAgent/commit/70a8d98bc15d8fc615455be07fad9c37ff8d430b))
|
|
12
|
+
|
|
1
13
|
## [5.15.6](https://github.com/appium/WebDriverAgent/compare/v5.15.5...v5.15.6) (2024-01-06)
|
|
2
14
|
|
|
3
15
|
|
|
@@ -109,7 +109,6 @@
|
|
|
109
109
|
641EE61E2240C5CA00173FCB /* FBExceptionHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = EEC088E71CB56DA400B65968 /* FBExceptionHandler.m */; };
|
|
110
110
|
641EE61F2240C5CA00173FCB /* FBXCodeCompatibility.m in Sources */ = {isa = PBXBuildFile; fileRef = EE5A24411F136C8D0078B1D9 /* FBXCodeCompatibility.m */; };
|
|
111
111
|
641EE6212240C5CA00173FCB /* FBElementTypeTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB7901CAEDF0C008C271F /* FBElementTypeTransformer.m */; };
|
|
112
|
-
641EE6222240C5CA00173FCB /* FBApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB7671CAEDF0C008C271F /* FBApplication.m */; };
|
|
113
112
|
641EE6232240C5CA00173FCB /* FBScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = 715AFAC01FFA29180053896D /* FBScreen.m */; };
|
|
114
113
|
641EE6242240C5CA00173FCB /* FBXCTestDaemonsProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = EE35AD7A1E3B80C000A02D78 /* FBXCTestDaemonsProxy.m */; };
|
|
115
114
|
641EE6262240C5CA00173FCB /* FBMathUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = EE1888391DA661C400307AA8 /* FBMathUtils.m */; };
|
|
@@ -142,7 +141,6 @@
|
|
|
142
141
|
641EE64B2240C5CA00173FCB /* XCTAsyncActivity.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACCB1E3B77D600A02D78 /* XCTAsyncActivity.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
143
142
|
641EE64C2240C5CA00173FCB /* XCTestMisuseObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACDF1E3B77D600A02D78 /* XCTestMisuseObserver.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
144
143
|
641EE64D2240C5CA00173FCB /* XCTRunnerDaemonSession.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACEF1E3B77D600A02D78 /* XCTRunnerDaemonSession.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
145
|
-
641EE64E2240C5CA00173FCB /* FBApplication.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB7661CAEDF0C008C271F /* FBApplication.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
146
144
|
641EE64F2240C5CA00173FCB /* XCTestExpectationWaiter.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACDA1E3B77D600A02D78 /* XCTestExpectationWaiter.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
147
145
|
641EE6502240C5CA00173FCB /* UIGestureRecognizer-RecordingAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACAD1E3B77D600A02D78 /* UIGestureRecognizer-RecordingAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
148
146
|
641EE6512240C5CA00173FCB /* XCKeyboardKeyMap.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACBF1E3B77D600A02D78 /* XCKeyboardKeyMap.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
@@ -619,8 +617,6 @@
|
|
|
619
617
|
EE158AE91CBD456F00A3E3F0 /* FBElementTypeTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB7901CAEDF0C008C271F /* FBElementTypeTransformer.m */; };
|
|
620
618
|
EE158AEA1CBD456F00A3E3F0 /* FBRuntimeUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB7911CAEDF0C008C271F /* FBRuntimeUtils.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
621
619
|
EE158AEB1CBD456F00A3E3F0 /* FBRuntimeUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB7921CAEDF0C008C271F /* FBRuntimeUtils.m */; };
|
|
622
|
-
EE158AF51CBD456F00A3E3F0 /* FBApplication.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB7661CAEDF0C008C271F /* FBApplication.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
623
|
-
EE158AF61CBD456F00A3E3F0 /* FBApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB7671CAEDF0C008C271F /* FBApplication.m */; };
|
|
624
620
|
EE158B5A1CBD462100A3E3F0 /* WebDriverAgentLib.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EE158A991CBD452B00A3E3F0 /* WebDriverAgentLib.framework */; };
|
|
625
621
|
EE158B5F1CBD47A000A3E3F0 /* WebDriverAgentLib.h in Headers */ = {isa = PBXBuildFile; fileRef = EE158B5E1CBD47A000A3E3F0 /* WebDriverAgentLib.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
626
622
|
EE18883A1DA661C400307AA8 /* FBMathUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = EE1888381DA661C400307AA8 /* FBMathUtils.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
@@ -756,7 +752,7 @@
|
|
|
756
752
|
EE55B3271D1D54CF003AAAEC /* FBScrollingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = EE55B3261D1D54CF003AAAEC /* FBScrollingTests.m */; };
|
|
757
753
|
EE5A24421F136D360078B1D9 /* FBXCodeCompatibility.m in Sources */ = {isa = PBXBuildFile; fileRef = EE5A24411F136C8D0078B1D9 /* FBXCodeCompatibility.m */; };
|
|
758
754
|
EE6A89261D0B19E60083E92B /* FBSessionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = EE6A89251D0B19E60083E92B /* FBSessionTests.m */; };
|
|
759
|
-
EE6A892B1D0B25820083E92B /*
|
|
755
|
+
EE6A892B1D0B25820083E92B /* XCUIApplicationDouble.m in Sources */ = {isa = PBXBuildFile; fileRef = EE6A89281D0B257B0083E92B /* XCUIApplicationDouble.m */; };
|
|
760
756
|
EE6A892D1D0B2AF40083E92B /* FBErrorBuilderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = EE6A892C1D0B2AF40083E92B /* FBErrorBuilderTests.m */; };
|
|
761
757
|
EE6A89371D0B35920083E92B /* FBFailureProofTestCaseTests.m in Sources */ = {isa = PBXBuildFile; fileRef = EE6A89361D0B35920083E92B /* FBFailureProofTestCaseTests.m */; };
|
|
762
758
|
EE6A893A1D0B38640083E92B /* FBFailureProofTestCase.h in Headers */ = {isa = PBXBuildFile; fileRef = EE6A89381D0B38640083E92B /* FBFailureProofTestCase.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
@@ -1254,8 +1250,8 @@
|
|
|
1254
1250
|
EE5A24401F136C8D0078B1D9 /* FBXCodeCompatibility.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FBXCodeCompatibility.h; sourceTree = "<group>"; };
|
|
1255
1251
|
EE5A24411F136C8D0078B1D9 /* FBXCodeCompatibility.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBXCodeCompatibility.m; sourceTree = "<group>"; };
|
|
1256
1252
|
EE6A89251D0B19E60083E92B /* FBSessionTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBSessionTests.m; sourceTree = "<group>"; };
|
|
1257
|
-
EE6A89271D0B257B0083E92B /*
|
|
1258
|
-
EE6A89281D0B257B0083E92B /*
|
|
1253
|
+
EE6A89271D0B257B0083E92B /* XCUIApplicationDouble.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCUIApplicationDouble.h; sourceTree = "<group>"; };
|
|
1254
|
+
EE6A89281D0B257B0083E92B /* XCUIApplicationDouble.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XCUIApplicationDouble.m; sourceTree = "<group>"; };
|
|
1259
1255
|
EE6A892C1D0B2AF40083E92B /* FBErrorBuilderTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBErrorBuilderTests.m; sourceTree = "<group>"; };
|
|
1260
1256
|
EE6A89361D0B35920083E92B /* FBFailureProofTestCaseTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBFailureProofTestCaseTests.m; sourceTree = "<group>"; };
|
|
1261
1257
|
EE6A89381D0B38640083E92B /* FBFailureProofTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBFailureProofTestCase.h; sourceTree = "<group>"; };
|
|
@@ -1296,8 +1292,6 @@
|
|
|
1296
1292
|
EE9AB7631CAEDF0C008C271F /* FBTouchIDCommands.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBTouchIDCommands.m; sourceTree = "<group>"; };
|
|
1297
1293
|
EE9AB7641CAEDF0C008C271F /* FBUnknownCommands.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBUnknownCommands.h; sourceTree = "<group>"; };
|
|
1298
1294
|
EE9AB7651CAEDF0C008C271F /* FBUnknownCommands.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBUnknownCommands.m; sourceTree = "<group>"; };
|
|
1299
|
-
EE9AB7661CAEDF0C008C271F /* FBApplication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FBApplication.h; path = WebDriverAgentLib/FBApplication.h; sourceTree = SOURCE_ROOT; };
|
|
1300
|
-
EE9AB7671CAEDF0C008C271F /* FBApplication.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FBApplication.m; path = WebDriverAgentLib/FBApplication.m; sourceTree = SOURCE_ROOT; };
|
|
1301
1295
|
EE9AB7731CAEDF0C008C271F /* WebDriverAgent.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = WebDriverAgent.bundle; sourceTree = "<group>"; };
|
|
1302
1296
|
EE9AB7751CAEDF0C008C271F /* FBCommandHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBCommandHandler.h; sourceTree = "<group>"; };
|
|
1303
1297
|
EE9AB7761CAEDF0C008C271F /* FBCommandStatus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBCommandStatus.h; sourceTree = "<group>"; };
|
|
@@ -1615,8 +1609,8 @@
|
|
|
1615
1609
|
13FFF2F1287DBEE600E561E4 /* XCElementSnapshotDouble.m */,
|
|
1616
1610
|
ADBC39961D07842800327304 /* XCUIElementDouble.h */,
|
|
1617
1611
|
ADBC39971D07842800327304 /* XCUIElementDouble.m */,
|
|
1618
|
-
EE6A89271D0B257B0083E92B /*
|
|
1619
|
-
EE6A89281D0B257B0083E92B /*
|
|
1612
|
+
EE6A89271D0B257B0083E92B /* XCUIApplicationDouble.h */,
|
|
1613
|
+
EE6A89281D0B257B0083E92B /* XCUIApplicationDouble.m */,
|
|
1620
1614
|
);
|
|
1621
1615
|
path = Doubles;
|
|
1622
1616
|
sourceTree = "<group>";
|
|
@@ -2096,8 +2090,6 @@
|
|
|
2096
2090
|
EE158B5E1CBD47A000A3E3F0 /* WebDriverAgentLib.h */,
|
|
2097
2091
|
AD6C26921CF2379700F8B5FF /* FBAlert.h */,
|
|
2098
2092
|
AD6C26931CF2379700F8B5FF /* FBAlert.m */,
|
|
2099
|
-
EE9AB7661CAEDF0C008C271F /* FBApplication.h */,
|
|
2100
|
-
EE9AB7671CAEDF0C008C271F /* FBApplication.m */,
|
|
2101
2093
|
EE3A18641CDE734B00DE4205 /* FBKeyboard.h */,
|
|
2102
2094
|
EE3A18651CDE734B00DE4205 /* FBKeyboard.m */,
|
|
2103
2095
|
EE158B5D1CBD479000A3E3F0 /* Info.plist */,
|
|
@@ -2283,7 +2275,6 @@
|
|
|
2283
2275
|
641EE64D2240C5CA00173FCB /* XCTRunnerDaemonSession.h in Headers */,
|
|
2284
2276
|
714E14B929805CAE00375DD7 /* XCAXClient_iOS+FBSnapshotReqParams.h in Headers */,
|
|
2285
2277
|
64B2650B228CE4FF002A5025 /* FBTVNavigationTracker-Private.h in Headers */,
|
|
2286
|
-
641EE64E2240C5CA00173FCB /* FBApplication.h in Headers */,
|
|
2287
2278
|
641EE64F2240C5CA00173FCB /* XCTestExpectationWaiter.h in Headers */,
|
|
2288
2279
|
13DE7A5C287CA444003243C6 /* FBXCElementSnapshotWrapper+Helpers.h in Headers */,
|
|
2289
2280
|
641EE6502240C5CA00173FCB /* UIGestureRecognizer-RecordingAdditions.h in Headers */,
|
|
@@ -2515,7 +2506,6 @@
|
|
|
2515
2506
|
EE35AD601E3B77D600A02D78 /* XCTRunnerDaemonSession.h in Headers */,
|
|
2516
2507
|
71414ED62670A1EE003A8C5D /* LRUCacheNode.h in Headers */,
|
|
2517
2508
|
64B2650A228CE4FF002A5025 /* FBTVNavigationTracker-Private.h in Headers */,
|
|
2518
|
-
EE158AF51CBD456F00A3E3F0 /* FBApplication.h in Headers */,
|
|
2519
2509
|
71B155DF23080CA600646AFB /* FBProtocolHelpers.h in Headers */,
|
|
2520
2510
|
EE35AD4B1E3B77D600A02D78 /* XCTestExpectationWaiter.h in Headers */,
|
|
2521
2511
|
EE35AD1E1E3B77D600A02D78 /* UIGestureRecognizer-RecordingAdditions.h in Headers */,
|
|
@@ -3158,7 +3148,6 @@
|
|
|
3158
3148
|
641EE61F2240C5CA00173FCB /* FBXCodeCompatibility.m in Sources */,
|
|
3159
3149
|
71E75E70254824230099FC87 /* XCUIElementQuery+FBHelpers.m in Sources */,
|
|
3160
3150
|
641EE6212240C5CA00173FCB /* FBElementTypeTransformer.m in Sources */,
|
|
3161
|
-
641EE6222240C5CA00173FCB /* FBApplication.m in Sources */,
|
|
3162
3151
|
13DE7A5E287CA444003243C6 /* FBXCElementSnapshotWrapper+Helpers.m in Sources */,
|
|
3163
3152
|
641EE6232240C5CA00173FCB /* FBScreen.m in Sources */,
|
|
3164
3153
|
71D04DCB25356C43008A052C /* XCUIElement+FBCaching.m in Sources */,
|
|
@@ -3292,7 +3281,6 @@
|
|
|
3292
3281
|
E444DC9D249131D40060D7EB /* HTTPMessage.m in Sources */,
|
|
3293
3282
|
E444DCB024913C220060D7EB /* RouteResponse.m in Sources */,
|
|
3294
3283
|
71D3B3D7267FC7260076473D /* XCUIElement+FBResolve.m in Sources */,
|
|
3295
|
-
EE158AF61CBD456F00A3E3F0 /* FBApplication.m in Sources */,
|
|
3296
3284
|
715AFAC21FFA29180053896D /* FBScreen.m in Sources */,
|
|
3297
3285
|
71B155DC230711E900646AFB /* FBCommandStatus.m in Sources */,
|
|
3298
3286
|
EE35AD7C1E3B80C000A02D78 /* FBXCTestDaemonsProxy.m in Sources */,
|
|
@@ -3360,7 +3348,7 @@
|
|
|
3360
3348
|
EE9B76591CF7987800275851 /* FBRouteTests.m in Sources */,
|
|
3361
3349
|
7139145C1DF01A12005896C2 /* NSExpressionFBFormatTests.m in Sources */,
|
|
3362
3350
|
71A224E81DE326C500844D55 /* NSPredicateFBFormatTests.m in Sources */,
|
|
3363
|
-
EE6A892B1D0B25820083E92B /*
|
|
3351
|
+
EE6A892B1D0B25820083E92B /* XCUIApplicationDouble.m in Sources */,
|
|
3364
3352
|
716F0DA62A17323300CDD977 /* NSDictionaryFBUtf8SafeTests.m in Sources */,
|
|
3365
3353
|
EE6A892D1D0B2AF40083E92B /* FBErrorBuilderTests.m in Sources */,
|
|
3366
3354
|
712A0C851DA3E459007D02E5 /* FBXPathTests.m in Sources */,
|
|
@@ -122,6 +122,44 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
122
122
|
*/
|
|
123
123
|
- (nullable NSArray<NSDictionary<NSString *, NSString*> *> *)fb_performAccessibilityAuditWithAuditTypes:(uint64_t)auditTypes
|
|
124
124
|
error:(NSError **)error;
|
|
125
|
+
/**
|
|
126
|
+
Constructor used to get current active application
|
|
127
|
+
*/
|
|
128
|
+
+ (instancetype)fb_activeApplication;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
Constructor used to get current active application
|
|
132
|
+
|
|
133
|
+
@param bundleId The bundle identifier of an app, which should be selected as active by default
|
|
134
|
+
if it is present in the list of active applications
|
|
135
|
+
*/
|
|
136
|
+
+ (instancetype)fb_activeApplicationWithDefaultBundleId:(nullable NSString *)bundleId;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
Constructor used to get the system application (e.g. Springboard on iOS)
|
|
140
|
+
*/
|
|
141
|
+
+ (instancetype)fb_systemApplication;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
Retrieves the list of all currently active applications
|
|
145
|
+
*/
|
|
146
|
+
+ (NSArray<XCUIApplication *> *)fb_activeApplications;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
Switch to system app (called Springboard on iOS)
|
|
150
|
+
|
|
151
|
+
@param error If there is an error, upon return contains an NSError object that describes the problem.
|
|
152
|
+
@return YES if the operation succeeds, otherwise NO.
|
|
153
|
+
*/
|
|
154
|
+
+ (BOOL)fb_switchToSystemApplicationWithError:(NSError **)error;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
Determines whether the other app is the same as the current one
|
|
158
|
+
|
|
159
|
+
@param otherApp Other app instance
|
|
160
|
+
@return YES if the other app has the same identifier
|
|
161
|
+
*/
|
|
162
|
+
- (BOOL)fb_isSameAppAs:(nullable XCUIApplication *)otherApp;
|
|
125
163
|
|
|
126
164
|
@end
|
|
127
165
|
|
|
@@ -9,13 +9,14 @@
|
|
|
9
9
|
|
|
10
10
|
#import "XCUIApplication+FBHelpers.h"
|
|
11
11
|
|
|
12
|
+
#import "FBActiveAppDetectionPoint.h"
|
|
12
13
|
#import "FBElementTypeTransformer.h"
|
|
13
14
|
#import "FBKeyboard.h"
|
|
14
15
|
#import "FBLogger.h"
|
|
15
16
|
#import "FBExceptions.h"
|
|
16
17
|
#import "FBMacros.h"
|
|
17
18
|
#import "FBMathUtils.h"
|
|
18
|
-
#import "
|
|
19
|
+
#import "FBRunLoopSpinner.h"
|
|
19
20
|
#import "FBXCodeCompatibility.h"
|
|
20
21
|
#import "FBXPath.h"
|
|
21
22
|
#import "FBXCAccessibilityElement.h"
|
|
@@ -23,14 +24,19 @@
|
|
|
23
24
|
#import "FBXCElementSnapshotWrapper+Helpers.h"
|
|
24
25
|
#import "FBXCAXClientProxy.h"
|
|
25
26
|
#import "FBXMLGenerationOptions.h"
|
|
27
|
+
#import "XCTestManager_ManagerInterface-Protocol.h"
|
|
28
|
+
#import "XCTestPrivateSymbols.h"
|
|
29
|
+
#import "XCTRunnerDaemonSession.h"
|
|
30
|
+
#import "XCUIApplication.h"
|
|
31
|
+
#import "XCUIApplicationImpl.h"
|
|
32
|
+
#import "XCUIApplicationProcess.h"
|
|
26
33
|
#import "XCUIDevice+FBHelpers.h"
|
|
34
|
+
#import "XCUIElement.h"
|
|
27
35
|
#import "XCUIElement+FBCaching.h"
|
|
28
36
|
#import "XCUIElement+FBIsVisible.h"
|
|
29
37
|
#import "XCUIElement+FBUtilities.h"
|
|
30
38
|
#import "XCUIElement+FBWebDriverAttributes.h"
|
|
31
|
-
#import "
|
|
32
|
-
#import "XCTestPrivateSymbols.h"
|
|
33
|
-
#import "XCTRunnerDaemonSession.h"
|
|
39
|
+
#import "XCUIElementQuery.h"
|
|
34
40
|
|
|
35
41
|
static NSString* const FBUnknownBundleId = @"unknown";
|
|
36
42
|
|
|
@@ -141,7 +147,7 @@ NSDictionary<NSNumber *, NSString *> *auditTypeValuesToNames(void) {
|
|
|
141
147
|
return NO;
|
|
142
148
|
}
|
|
143
149
|
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:MAX(duration, .0)]];
|
|
144
|
-
[self
|
|
150
|
+
[self activate];
|
|
145
151
|
return YES;
|
|
146
152
|
}
|
|
147
153
|
|
|
@@ -393,4 +399,141 @@ NSDictionary<NSNumber *, NSString *> *auditTypeValuesToNames(void) {
|
|
|
393
399
|
return isSuccessful ? resultArray.copy : nil;
|
|
394
400
|
}
|
|
395
401
|
|
|
402
|
+
+ (instancetype)fb_activeApplication
|
|
403
|
+
{
|
|
404
|
+
return [self fb_activeApplicationWithDefaultBundleId:nil];
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
+ (NSArray<XCUIApplication *> *)fb_activeApplications
|
|
408
|
+
{
|
|
409
|
+
NSArray<id<FBXCAccessibilityElement>> *activeApplicationElements = [FBXCAXClientProxy.sharedClient activeApplications];
|
|
410
|
+
NSMutableArray<XCUIApplication *> *result = [NSMutableArray array];
|
|
411
|
+
if (activeApplicationElements.count > 0) {
|
|
412
|
+
for (id<FBXCAccessibilityElement> applicationElement in activeApplicationElements) {
|
|
413
|
+
XCUIApplication *app = [XCUIApplication fb_applicationWithPID:applicationElement.processIdentifier];
|
|
414
|
+
if (nil != app) {
|
|
415
|
+
[result addObject:app];
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
return result.count > 0 ? result.copy : @[self.class.fb_systemApplication];
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
+ (instancetype)fb_activeApplicationWithDefaultBundleId:(nullable NSString *)bundleId
|
|
423
|
+
{
|
|
424
|
+
NSArray<id<FBXCAccessibilityElement>> *activeApplicationElements = [FBXCAXClientProxy.sharedClient activeApplications];
|
|
425
|
+
id<FBXCAccessibilityElement> activeApplicationElement = nil;
|
|
426
|
+
id<FBXCAccessibilityElement> currentElement = nil;
|
|
427
|
+
if (nil != bundleId) {
|
|
428
|
+
currentElement = FBActiveAppDetectionPoint.sharedInstance.axElement;
|
|
429
|
+
if (nil != currentElement) {
|
|
430
|
+
NSArray<NSDictionary *> *appInfos = [self fb_appsInfoWithAxElements:@[currentElement]];
|
|
431
|
+
[FBLogger logFmt:@"Detected on-screen application: %@", appInfos.firstObject[@"bundleId"]];
|
|
432
|
+
if ([[appInfos.firstObject objectForKey:@"bundleId"] isEqualToString:(id)bundleId]) {
|
|
433
|
+
activeApplicationElement = currentElement;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
if (nil == activeApplicationElement && activeApplicationElements.count > 1) {
|
|
438
|
+
if (nil != bundleId) {
|
|
439
|
+
NSArray<NSDictionary *> *appInfos = [self fb_appsInfoWithAxElements:activeApplicationElements];
|
|
440
|
+
NSMutableArray<NSString *> *bundleIds = [NSMutableArray array];
|
|
441
|
+
for (NSDictionary *appInfo in appInfos) {
|
|
442
|
+
[bundleIds addObject:(NSString *)appInfo[@"bundleId"]];
|
|
443
|
+
}
|
|
444
|
+
[FBLogger logFmt:@"Detected system active application(s): %@", bundleIds];
|
|
445
|
+
// Try to select the desired application first
|
|
446
|
+
for (NSUInteger appIdx = 0; appIdx < appInfos.count; appIdx++) {
|
|
447
|
+
if ([[[appInfos objectAtIndex:appIdx] objectForKey:@"bundleId"] isEqualToString:(id)bundleId]) {
|
|
448
|
+
activeApplicationElement = [activeApplicationElements objectAtIndex:appIdx];
|
|
449
|
+
break;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
// Fall back to the "normal" algorithm if the desired application is either
|
|
454
|
+
// not set or is not active
|
|
455
|
+
if (nil == activeApplicationElement) {
|
|
456
|
+
if (nil == currentElement) {
|
|
457
|
+
currentElement = FBActiveAppDetectionPoint.sharedInstance.axElement;
|
|
458
|
+
}
|
|
459
|
+
if (nil == currentElement) {
|
|
460
|
+
[FBLogger log:@"Cannot precisely detect the current application. Will use the system's recently active one"];
|
|
461
|
+
if (nil == bundleId) {
|
|
462
|
+
[FBLogger log:@"Consider changing the 'defaultActiveApplication' setting to the bundle identifier of the desired application under test"];
|
|
463
|
+
}
|
|
464
|
+
} else {
|
|
465
|
+
for (id<FBXCAccessibilityElement> appElement in activeApplicationElements) {
|
|
466
|
+
if (appElement.processIdentifier == currentElement.processIdentifier) {
|
|
467
|
+
activeApplicationElement = appElement;
|
|
468
|
+
break;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
if (nil != activeApplicationElement) {
|
|
476
|
+
XCUIApplication *application = [XCUIApplication fb_applicationWithPID:activeApplicationElement.processIdentifier];
|
|
477
|
+
if (nil != application) {
|
|
478
|
+
return application;
|
|
479
|
+
}
|
|
480
|
+
[FBLogger log:@"Cannot translate the active process identifier into an application object"];
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
if (activeApplicationElements.count > 0) {
|
|
484
|
+
[FBLogger logFmt:@"Getting the most recent active application (out of %@ total items)", @(activeApplicationElements.count)];
|
|
485
|
+
for (id<FBXCAccessibilityElement> appElement in activeApplicationElements) {
|
|
486
|
+
XCUIApplication *application = [XCUIApplication fb_applicationWithPID:appElement.processIdentifier];
|
|
487
|
+
if (nil != application) {
|
|
488
|
+
return application;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
[FBLogger log:@"Cannot retrieve any active applications. Assuming the system application is the active one"];
|
|
494
|
+
return [self fb_systemApplication];
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
+ (instancetype)fb_systemApplication
|
|
498
|
+
{
|
|
499
|
+
return [self fb_applicationWithPID:
|
|
500
|
+
[[FBXCAXClientProxy.sharedClient systemApplication] processIdentifier]];
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
+ (instancetype)fb_applicationWithPID:(pid_t)processID
|
|
504
|
+
{
|
|
505
|
+
return [FBXCAXClientProxy.sharedClient monitoredApplicationWithProcessIdentifier:processID];
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
+ (BOOL)fb_switchToSystemApplicationWithError:(NSError **)error
|
|
509
|
+
{
|
|
510
|
+
XCUIApplication *systemApp = self.fb_systemApplication;
|
|
511
|
+
@try {
|
|
512
|
+
if (!systemApp.running) {
|
|
513
|
+
[systemApp launch];
|
|
514
|
+
} else {
|
|
515
|
+
[systemApp activate];
|
|
516
|
+
}
|
|
517
|
+
} @catch (NSException *e) {
|
|
518
|
+
return [[[FBErrorBuilder alloc]
|
|
519
|
+
withDescription:nil == e ? @"Cannot open the home screen" : e.reason]
|
|
520
|
+
buildError:error];
|
|
521
|
+
}
|
|
522
|
+
return [[[[FBRunLoopSpinner new]
|
|
523
|
+
timeout:5]
|
|
524
|
+
timeoutErrorMessage:@"Timeout waiting until the home screen is visible"]
|
|
525
|
+
spinUntilTrue:^BOOL{
|
|
526
|
+
return [systemApp fb_isSameAppAs:self.fb_activeApplication];
|
|
527
|
+
}
|
|
528
|
+
error:error];
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
- (BOOL)fb_isSameAppAs:(nullable XCUIApplication *)otherApp
|
|
532
|
+
{
|
|
533
|
+
if (nil == otherApp) {
|
|
534
|
+
return NO;
|
|
535
|
+
}
|
|
536
|
+
return [self.bundleID isEqualToString:(NSString *)otherApp.bundleID];
|
|
537
|
+
}
|
|
538
|
+
|
|
396
539
|
@end
|
|
@@ -56,7 +56,7 @@ static bool fb_isLocked;
|
|
|
56
56
|
|
|
57
57
|
- (BOOL)fb_goToHomescreenWithError:(NSError **)error
|
|
58
58
|
{
|
|
59
|
-
return [
|
|
59
|
+
return [XCUIApplication fb_switchToSystemApplicationWithError:error];
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
- (BOOL)fb_lockScreen:(NSError **)error
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
#import "XCUIDevice+FBRotation.h"
|
|
11
11
|
|
|
12
12
|
#import "FBConfiguration.h"
|
|
13
|
+
#import "XCUIApplication.h"
|
|
14
|
+
#import "XCUIApplication+FBHelpers.h"
|
|
13
15
|
#import "XCUIElement+FBUtilities.h"
|
|
14
16
|
|
|
15
17
|
# if !TARGET_OS_TV
|
|
@@ -18,7 +20,7 @@
|
|
|
18
20
|
|
|
19
21
|
- (BOOL)fb_setDeviceInterfaceOrientation:(UIDeviceOrientation)orientation
|
|
20
22
|
{
|
|
21
|
-
|
|
23
|
+
XCUIApplication *application = XCUIApplication.fb_activeApplication;
|
|
22
24
|
[XCUIDevice sharedDevice].orientation = orientation;
|
|
23
25
|
return [self waitUntilInterfaceIsAtOrientation:orientation application:application];
|
|
24
26
|
}
|
|
@@ -30,12 +32,12 @@
|
|
|
30
32
|
return NO;
|
|
31
33
|
}
|
|
32
34
|
NSInteger orientation = keysForRotationObj.firstObject.integerValue;
|
|
33
|
-
|
|
35
|
+
XCUIApplication *application = XCUIApplication.fb_activeApplication;
|
|
34
36
|
[XCUIDevice sharedDevice].orientation = orientation;
|
|
35
37
|
return [self waitUntilInterfaceIsAtOrientation:orientation application:application];
|
|
36
38
|
}
|
|
37
39
|
|
|
38
|
-
- (BOOL)waitUntilInterfaceIsAtOrientation:(NSInteger)orientation application:(
|
|
40
|
+
- (BOOL)waitUntilInterfaceIsAtOrientation:(NSInteger)orientation application:(XCUIApplication *)application
|
|
39
41
|
{
|
|
40
42
|
// Tapping elements immediately after rotation may fail due to way UIKit is handling touches.
|
|
41
43
|
// We should wait till UI cools off, before continuing
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
#import "XCUIElement+FBTVFocuse.h"
|
|
11
11
|
|
|
12
12
|
#import <XCTest/XCUIRemote.h>
|
|
13
|
-
#import "FBApplication.h"
|
|
14
13
|
#import "FBConfiguration.h"
|
|
15
14
|
#import "FBErrorBuilder.h"
|
|
16
15
|
#import <FBTVNavigationTracker.h>
|
|
16
|
+
#import "XCUIApplication+FBHelpers.h"
|
|
17
17
|
#import "XCUIElement+FBUtilities.h"
|
|
18
18
|
#import "XCUIElement+FBWebDriverAttributes.h"
|
|
19
19
|
|
|
@@ -25,7 +25,7 @@ int const MAX_ITERATIONS_COUNT = 100;
|
|
|
25
25
|
|
|
26
26
|
- (BOOL)fb_setFocusWithError:(NSError**) error
|
|
27
27
|
{
|
|
28
|
-
[
|
|
28
|
+
[XCUIApplication.fb_activeApplication fb_waitUntilStableWithTimeout:FBConfiguration.animationCoolOffTimeout];
|
|
29
29
|
|
|
30
30
|
if (!self.wdEnabled) {
|
|
31
31
|
if (error) {
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
#import "FBAlertViewCommands.h"
|
|
11
11
|
|
|
12
12
|
#import "FBAlert.h"
|
|
13
|
-
#import "FBApplication.h"
|
|
14
13
|
#import "FBRouteRequest.h"
|
|
15
14
|
#import "FBSession.h"
|
|
15
|
+
#import "XCUIApplication+FBHelpers.h"
|
|
16
16
|
|
|
17
17
|
@implementation FBAlertViewCommands
|
|
18
18
|
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
|
|
39
39
|
+ (id<FBResponsePayload>)handleAlertGetTextCommand:(FBRouteRequest *)request
|
|
40
40
|
{
|
|
41
|
-
|
|
41
|
+
XCUIApplication *application = request.session.activeApplication ?: XCUIApplication.fb_activeApplication;
|
|
42
42
|
NSString *alertText = [FBAlert alertWithApplication:application].text;
|
|
43
43
|
if (!alertText) {
|
|
44
44
|
return FBResponseWithStatus([FBCommandStatus noAlertOpenErrorWithMessage:nil
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
|
|
74
74
|
+ (id<FBResponsePayload>)handleAlertAcceptCommand:(FBRouteRequest *)request
|
|
75
75
|
{
|
|
76
|
-
|
|
76
|
+
XCUIApplication *application = request.session.activeApplication ?: XCUIApplication.fb_activeApplication;
|
|
77
77
|
NSString *name = request.arguments[@"name"];
|
|
78
78
|
FBAlert *alert = [FBAlert alertWithApplication:application];
|
|
79
79
|
NSError *error;
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
|
|
97
97
|
+ (id<FBResponsePayload>)handleAlertDismissCommand:(FBRouteRequest *)request
|
|
98
98
|
{
|
|
99
|
-
|
|
99
|
+
XCUIApplication *application = request.session.activeApplication ?: XCUIApplication.fb_activeApplication;
|
|
100
100
|
NSString *name = request.arguments[@"name"];
|
|
101
101
|
FBAlert *alert = [FBAlert alertWithApplication:application];
|
|
102
102
|
NSError *error;
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
#import <XCTest/XCUIDevice.h>
|
|
13
13
|
#import <CoreLocation/CoreLocation.h>
|
|
14
14
|
|
|
15
|
-
#import "FBApplication.h"
|
|
16
15
|
#import "FBConfiguration.h"
|
|
17
16
|
#import "FBKeyboard.h"
|
|
18
17
|
#import "FBNotificationsHelper.h"
|
|
@@ -24,6 +23,7 @@
|
|
|
24
23
|
#import "FBScreen.h"
|
|
25
24
|
#import "FBSession.h"
|
|
26
25
|
#import "FBXCodeCompatibility.h"
|
|
26
|
+
#import "XCUIApplication.h"
|
|
27
27
|
#import "XCUIApplication+FBHelpers.h"
|
|
28
28
|
#import "XCUIDevice+FBHelpers.h"
|
|
29
29
|
#import "XCUIElement.h"
|
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
|
|
172
172
|
+ (id<FBResponsePayload>)handleActiveAppInfo:(FBRouteRequest *)request
|
|
173
173
|
{
|
|
174
|
-
XCUIApplication *app = request.session.activeApplication ?:
|
|
174
|
+
XCUIApplication *app = request.session.activeApplication ?: XCUIApplication.fb_activeApplication;
|
|
175
175
|
return FBResponseWithObject(@{
|
|
176
176
|
@"pid": @(app.processID),
|
|
177
177
|
@"bundleId": app.bundleID,
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
|
|
10
10
|
#import "FBDebugCommands.h"
|
|
11
11
|
|
|
12
|
-
#import "FBApplication.h"
|
|
13
12
|
#import "FBRouteRequest.h"
|
|
14
13
|
#import "FBSession.h"
|
|
15
14
|
#import "FBXMLGenerationOptions.h"
|
|
@@ -42,7 +41,7 @@ static NSString *const SOURCE_FORMAT_DESCRIPTION = @"description";
|
|
|
42
41
|
+ (id<FBResponsePayload>)handleGetSourceCommand:(FBRouteRequest *)request
|
|
43
42
|
{
|
|
44
43
|
// This method might be called without session
|
|
45
|
-
|
|
44
|
+
XCUIApplication *application = request.session.activeApplication ?: XCUIApplication.fb_activeApplication;
|
|
46
45
|
NSString *sourceType = request.parameters[@"format"] ?: SOURCE_FORMAT_XML;
|
|
47
46
|
NSString *sourceScope = request.parameters[@"scope"];
|
|
48
47
|
id result;
|
|
@@ -71,7 +70,7 @@ static NSString *const SOURCE_FORMAT_DESCRIPTION = @"description";
|
|
|
71
70
|
+ (id<FBResponsePayload>)handleGetAccessibleSourceCommand:(FBRouteRequest *)request
|
|
72
71
|
{
|
|
73
72
|
// This method might be called without session
|
|
74
|
-
|
|
73
|
+
XCUIApplication *application = request.session.activeApplication ?: XCUIApplication.fb_activeApplication;
|
|
75
74
|
return FBResponseWithObject(application.fb_accessibilityTree ?: @{});
|
|
76
75
|
}
|
|
77
76
|
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
|
|
10
10
|
#import "FBElementCommands.h"
|
|
11
11
|
|
|
12
|
-
#import "FBApplication.h"
|
|
13
12
|
#import "FBConfiguration.h"
|
|
14
13
|
#import "FBKeyboard.h"
|
|
15
14
|
#import "FBRoute.h"
|
|
@@ -18,7 +17,6 @@
|
|
|
18
17
|
#import "FBElementCache.h"
|
|
19
18
|
#import "FBErrorBuilder.h"
|
|
20
19
|
#import "FBSession.h"
|
|
21
|
-
#import "FBApplication.h"
|
|
22
20
|
#import "FBElementUtils.h"
|
|
23
21
|
#import "FBMacros.h"
|
|
24
22
|
#import "FBMathUtils.h"
|
|
@@ -529,7 +527,7 @@
|
|
|
529
527
|
{
|
|
530
528
|
XCUIElement *element = nil;
|
|
531
529
|
if (nil == request.parameters[@"uuid"]) {
|
|
532
|
-
element =
|
|
530
|
+
element = XCUIApplication.fb_activeApplication;
|
|
533
531
|
} else {
|
|
534
532
|
FBElementCache *elementCache = request.session.elementCache;
|
|
535
533
|
element = [elementCache elementForUUID:(NSString *)request.parameters[@"uuid"]];
|
|
@@ -567,7 +565,7 @@
|
|
|
567
565
|
|
|
568
566
|
+ (id<FBResponsePayload>)handleGetWindowSize:(FBRouteRequest *)request
|
|
569
567
|
{
|
|
570
|
-
XCUIApplication *app = request.session.activeApplication ?:
|
|
568
|
+
XCUIApplication *app = request.session.activeApplication ?: XCUIApplication.fb_activeApplication;
|
|
571
569
|
|
|
572
570
|
#if TARGET_OS_TV
|
|
573
571
|
CGSize screenSize = app.frame.size;
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
#import "FBRouteRequest.h"
|
|
13
13
|
#import "FBMacros.h"
|
|
14
14
|
#import "FBSession.h"
|
|
15
|
-
#import "
|
|
15
|
+
#import "XCUIApplication.h"
|
|
16
|
+
#import "XCUIApplication+FBHelpers.h"
|
|
16
17
|
#import "XCUIDevice.h"
|
|
17
18
|
|
|
18
19
|
extern const struct FBWDOrientationValues {
|
|
@@ -55,14 +56,14 @@ const struct FBWDOrientationValues FBWDOrientationValues = {
|
|
|
55
56
|
|
|
56
57
|
+ (id<FBResponsePayload>)handleGetOrientation:(FBRouteRequest *)request
|
|
57
58
|
{
|
|
58
|
-
|
|
59
|
+
XCUIApplication *application = request.session.activeApplication ?: XCUIApplication.fb_activeApplication;
|
|
59
60
|
NSString *orientation = [self.class interfaceOrientationForApplication:application];
|
|
60
61
|
return FBResponseWithObject([[self _wdOrientationsMapping] objectForKey:orientation]);
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
+ (id<FBResponsePayload>)handleSetOrientation:(FBRouteRequest *)request
|
|
64
65
|
{
|
|
65
|
-
|
|
66
|
+
XCUIApplication *application = request.session.activeApplication ?: XCUIApplication.fb_activeApplication;
|
|
66
67
|
if ([self.class setDeviceOrientation:request.arguments[@"orientation"] forApplication:application]) {
|
|
67
68
|
return FBResponseWithOK();
|
|
68
69
|
}
|
|
@@ -73,7 +74,7 @@ const struct FBWDOrientationValues FBWDOrientationValues = {
|
|
|
73
74
|
+ (id<FBResponsePayload>)handleGetRotation:(FBRouteRequest *)request
|
|
74
75
|
{
|
|
75
76
|
XCUIDevice *device = [XCUIDevice sharedDevice];
|
|
76
|
-
|
|
77
|
+
XCUIApplication *application = request.session.activeApplication ?: XCUIApplication.fb_activeApplication;
|
|
77
78
|
UIInterfaceOrientation orientation = application.interfaceOrientation;
|
|
78
79
|
return FBResponseWithObject(device.fb_rotationMapping[@(orientation)]);
|
|
79
80
|
}
|
|
@@ -101,7 +102,7 @@ const struct FBWDOrientationValues FBWDOrientationValues = {
|
|
|
101
102
|
traceback:nil]);
|
|
102
103
|
}
|
|
103
104
|
|
|
104
|
-
|
|
105
|
+
XCUIApplication *application = request.session.activeApplication ?: XCUIApplication.fb_activeApplication;
|
|
105
106
|
if (![self.class setDeviceRotation:request.arguments forApplication:application]) {
|
|
106
107
|
NSString *errMessage = [
|
|
107
108
|
NSString stringWithFormat:@"The current rotation cannot be set to %@. Make sure the %@ application supports it",
|
|
@@ -116,7 +117,7 @@ const struct FBWDOrientationValues FBWDOrientationValues = {
|
|
|
116
117
|
|
|
117
118
|
#pragma mark - Helpers
|
|
118
119
|
|
|
119
|
-
+ (NSString *)interfaceOrientationForApplication:(
|
|
120
|
+
+ (NSString *)interfaceOrientationForApplication:(XCUIApplication *)application
|
|
120
121
|
{
|
|
121
122
|
NSNumber *orientation = @(application.interfaceOrientation);
|
|
122
123
|
NSSet *keys = [[self _orientationsMapping] keysOfEntriesPassingTest:^BOOL(id key, NSNumber *obj, BOOL *stop) {
|
|
@@ -128,12 +129,12 @@ const struct FBWDOrientationValues FBWDOrientationValues = {
|
|
|
128
129
|
return keys.anyObject;
|
|
129
130
|
}
|
|
130
131
|
|
|
131
|
-
+ (BOOL)setDeviceRotation:(NSDictionary *)rotationObj forApplication:(
|
|
132
|
+
+ (BOOL)setDeviceRotation:(NSDictionary *)rotationObj forApplication:(XCUIApplication *)application
|
|
132
133
|
{
|
|
133
134
|
return [[XCUIDevice sharedDevice] fb_setDeviceRotation:rotationObj];
|
|
134
135
|
}
|
|
135
136
|
|
|
136
|
-
+ (BOOL)setDeviceOrientation:(NSString *)orientation forApplication:(
|
|
137
|
+
+ (BOOL)setDeviceOrientation:(NSString *)orientation forApplication:(XCUIApplication *)application
|
|
137
138
|
{
|
|
138
139
|
NSNumber *orientationValue = [[self _orientationsMapping] objectForKey:[orientation uppercaseString]];
|
|
139
140
|
if (orientationValue == nil) {
|