appium-webdriveragent 4.15.1 → 5.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 +23 -0
- package/WebDriverAgent.xcodeproj/project.pbxproj +0 -20
- package/WebDriverAgentLib/Categories/XCUIApplication+FBAlert.m +9 -20
- package/WebDriverAgentLib/Categories/XCUIDevice+FBHelpers.m +1 -5
- package/WebDriverAgentLib/Categories/XCUIElement+FBIsVisible.m +0 -12
- package/WebDriverAgentLib/Categories/XCUIElement+FBPickerWheel.m +1 -15
- package/WebDriverAgentLib/Categories/XCUIElement+FBScrolling.m +7 -37
- package/WebDriverAgentLib/Categories/XCUIElement+FBTap.m +7 -36
- package/WebDriverAgentLib/Categories/XCUIElement+FBUtilities.h +0 -7
- package/WebDriverAgentLib/Categories/XCUIElement+FBUtilities.m +0 -49
- package/WebDriverAgentLib/Commands/FBCustomCommands.m +2 -4
- package/WebDriverAgentLib/Commands/FBElementCommands.m +37 -19
- package/WebDriverAgentLib/Utilities/FBAppiumActionsSynthesizer.m +23 -15
- package/WebDriverAgentLib/Utilities/FBBaseActionsSynthesizer.h +4 -13
- package/WebDriverAgentLib/Utilities/FBBaseActionsSynthesizer.m +36 -74
- package/WebDriverAgentLib/Utilities/FBKeyboard.m +1 -2
- package/WebDriverAgentLib/Utilities/FBMathUtils.h +0 -6
- package/WebDriverAgentLib/Utilities/FBMathUtils.m +0 -29
- package/WebDriverAgentLib/Utilities/FBScreen.m +2 -9
- package/WebDriverAgentLib/Utilities/FBScreenshot.m +0 -1
- package/WebDriverAgentLib/Utilities/FBW3CActionsSynthesizer.m +23 -31
- package/WebDriverAgentLib/Utilities/FBXCTestDaemonsProxy.h +0 -4
- package/WebDriverAgentLib/Utilities/FBXCTestDaemonsProxy.m +0 -12
- package/WebDriverAgentTests/IntegrationTests/FBAppiumTouchActionsIntegrationTests.m +0 -16
- package/WebDriverAgentTests/IntegrationTests/FBW3CTouchActionsIntegrationTests.m +0 -19
- package/WebDriverAgentTests/UnitTests/FBMathUtilsTests.m +0 -12
- package/package.json +1 -1
- package/WebDriverAgentLib/Categories/XCUICoordinate+FBFix.h +0 -18
- package/WebDriverAgentLib/Categories/XCUICoordinate+FBFix.m +0 -46
- package/WebDriverAgentTests/IntegrationTests/FBElementScreenshotTests.m +0 -52
- package/WebDriverAgentTests/UnitTests/XCUICoordinateFix.m +0 -63
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
## [5.1.0](https://github.com/appium/WebDriverAgent/compare/v5.0.0...v5.1.0) (2023-05-14)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* Add a possibility to provide a target picker value ([#699](https://github.com/appium/WebDriverAgent/issues/699)) ([fc76aee](https://github.com/appium/WebDriverAgent/commit/fc76aeecb087429974b7b52b725173186e6f0246))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Code Refactoring
|
|
10
|
+
|
|
11
|
+
* Remove obsolete coordinate calculation workarounds needed for older xCode SDKs ([#698](https://github.com/appium/WebDriverAgent/issues/698)) ([025b42c](https://github.com/appium/WebDriverAgent/commit/025b42c8a34ff0beba4379f4cb0c1d79d2b222ed))
|
|
12
|
+
|
|
13
|
+
## [5.0.0](https://github.com/appium/WebDriverAgent/compare/v4.15.1...v5.0.0) (2023-05-14)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### ⚠ BREAKING CHANGES
|
|
17
|
+
|
|
18
|
+
* The minimum supported xCode/iOS version is now 13/15.0
|
|
19
|
+
|
|
20
|
+
### Code Refactoring
|
|
21
|
+
|
|
22
|
+
* Drop workarounds for legacy iOS versions ([#696](https://github.com/appium/WebDriverAgent/issues/696)) ([bb562b9](https://github.com/appium/WebDriverAgent/commit/bb562b96db6aad476970ef7bd352cb8df4f1e6c2))
|
|
23
|
+
|
|
1
24
|
## [4.15.1](https://github.com/appium/WebDriverAgent/compare/v4.15.0...v4.15.1) (2023-05-06)
|
|
2
25
|
|
|
3
26
|
|
|
@@ -86,7 +86,6 @@
|
|
|
86
86
|
641EE6042240C5CA00173FCB /* NSString+FBXMLSafeString.m in Sources */ = {isa = PBXBuildFile; fileRef = 716E0BCD1E917E810087A825 /* NSString+FBXMLSafeString.m */; };
|
|
87
87
|
641EE6052240C5CA00173FCB /* FBUnknownCommands.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB7651CAEDF0C008C271F /* FBUnknownCommands.m */; };
|
|
88
88
|
641EE6062240C5CA00173FCB /* FBOrientationCommands.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB75D1CAEDF0C008C271F /* FBOrientationCommands.m */; };
|
|
89
|
-
641EE6072240C5CA00173FCB /* XCUICoordinate+FBFix.m in Sources */ = {isa = PBXBuildFile; fileRef = EEC9EED520064FAA00BC0D5B /* XCUICoordinate+FBFix.m */; };
|
|
90
89
|
641EE6082240C5CA00173FCB /* FBRuntimeUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9AB7921CAEDF0C008C271F /* FBRuntimeUtils.m */; };
|
|
91
90
|
641EE6092240C5CA00173FCB /* XCUIElement+FBUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = EEE376401D59F81400ED88DD /* XCUIElement+FBUtilities.m */; };
|
|
92
91
|
641EE60A2240C5CA00173FCB /* FBLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = EE9B76A41CF7A43900275851 /* FBLogger.m */; };
|
|
@@ -160,7 +159,6 @@
|
|
|
160
159
|
641EE65B2240C5CA00173FCB /* XCUIElementHitPointCoordinate.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35AD011E3B77D600A02D78 /* XCUIElementHitPointCoordinate.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
161
160
|
641EE65C2240C5CA00173FCB /* XCTDarwinNotificationExpectation.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACCE1E3B77D600A02D78 /* XCTDarwinNotificationExpectation.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
162
161
|
641EE65D2240C5CA00173FCB /* XCTRunnerAutomationSession.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACEE1E3B77D600A02D78 /* XCTRunnerAutomationSession.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
163
|
-
641EE65E2240C5CA00173FCB /* XCUICoordinate+FBFix.h in Headers */ = {isa = PBXBuildFile; fileRef = EEC9EED420064FAA00BC0D5B /* XCUICoordinate+FBFix.h */; };
|
|
164
162
|
641EE65F2240C5CA00173FCB /* XCSourceCodeTreeNodeEnumerator.h in Headers */ = {isa = PBXBuildFile; fileRef = EE35ACC61E3B77D600A02D78 /* XCSourceCodeTreeNodeEnumerator.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
165
163
|
641EE6602240C5CA00173FCB /* XCUIElement+FBIsVisible.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB7471CAEDF0C008C271F /* XCUIElement+FBIsVisible.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
166
164
|
641EE6612240C5CA00173FCB /* XCUIElement+FBTap.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9AB74B1CAEDF0C008C271F /* XCUIElement+FBTap.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
@@ -456,7 +454,6 @@
|
|
|
456
454
|
71A7EAF91E224648001DA4F2 /* FBClassChainQueryParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 71A7EAF71E224648001DA4F2 /* FBClassChainQueryParser.h */; };
|
|
457
455
|
71A7EAFA1E224648001DA4F2 /* FBClassChainQueryParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 71A7EAF81E224648001DA4F2 /* FBClassChainQueryParser.m */; };
|
|
458
456
|
71A7EAFC1E229302001DA4F2 /* FBClassChainTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 71A7EAFB1E229302001DA4F2 /* FBClassChainTests.m */; };
|
|
459
|
-
71AB82B21FDAE8C000D1D7C3 /* FBElementScreenshotTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 71AB82B11FDAE8C000D1D7C3 /* FBElementScreenshotTests.m */; };
|
|
460
457
|
71ACF5B8242F2FDC00F0AAD4 /* FBSafariAlertTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 71ACF5B7242F2FDC00F0AAD4 /* FBSafariAlertTests.m */; };
|
|
461
458
|
71B155DA23070ECF00646AFB /* FBHTTPStatusCodes.h in Headers */ = {isa = PBXBuildFile; fileRef = 71B155D923070ECF00646AFB /* FBHTTPStatusCodes.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
462
459
|
71B155DC230711E900646AFB /* FBCommandStatus.m in Sources */ = {isa = PBXBuildFile; fileRef = 71B155DB230711E900646AFB /* FBCommandStatus.m */; };
|
|
@@ -785,9 +782,6 @@
|
|
|
785
782
|
EE9B76AA1CF7A43900275851 /* FBMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = EE9B76A51CF7A43900275851 /* FBMacros.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
786
783
|
EEBBD48B1D47746D00656A81 /* XCUIElement+FBFind.h in Headers */ = {isa = PBXBuildFile; fileRef = EEBBD4891D47746D00656A81 /* XCUIElement+FBFind.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
787
784
|
EEBBD48C1D47746D00656A81 /* XCUIElement+FBFind.m in Sources */ = {isa = PBXBuildFile; fileRef = EEBBD48A1D47746D00656A81 /* XCUIElement+FBFind.m */; };
|
|
788
|
-
EEC9EED620064FAA00BC0D5B /* XCUICoordinate+FBFix.h in Headers */ = {isa = PBXBuildFile; fileRef = EEC9EED420064FAA00BC0D5B /* XCUICoordinate+FBFix.h */; };
|
|
789
|
-
EEC9EED720064FAA00BC0D5B /* XCUICoordinate+FBFix.m in Sources */ = {isa = PBXBuildFile; fileRef = EEC9EED520064FAA00BC0D5B /* XCUICoordinate+FBFix.m */; };
|
|
790
|
-
EEC9EED920077D8E00BC0D5B /* XCUICoordinateFix.m in Sources */ = {isa = PBXBuildFile; fileRef = EEC9EED820077D8E00BC0D5B /* XCUICoordinateFix.m */; };
|
|
791
785
|
EEDFE1211D9C06F800E6FFE5 /* XCUIDevice+FBHealthCheck.h in Headers */ = {isa = PBXBuildFile; fileRef = EEDFE11F1D9C06F800E6FFE5 /* XCUIDevice+FBHealthCheck.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
|
792
786
|
EEDFE1221D9C06F800E6FFE5 /* XCUIDevice+FBHealthCheck.m in Sources */ = {isa = PBXBuildFile; fileRef = EEDFE1201D9C06F800E6FFE5 /* XCUIDevice+FBHealthCheck.m */; };
|
|
793
787
|
EEE16E971D33A25500172525 /* FBConfigurationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = EEE16E961D33A25500172525 /* FBConfigurationTests.m */; };
|
|
@@ -1043,7 +1037,6 @@
|
|
|
1043
1037
|
71A7EAF71E224648001DA4F2 /* FBClassChainQueryParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBClassChainQueryParser.h; sourceTree = "<group>"; };
|
|
1044
1038
|
71A7EAF81E224648001DA4F2 /* FBClassChainQueryParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBClassChainQueryParser.m; sourceTree = "<group>"; };
|
|
1045
1039
|
71A7EAFB1E229302001DA4F2 /* FBClassChainTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBClassChainTests.m; sourceTree = "<group>"; };
|
|
1046
|
-
71AB82B11FDAE8C000D1D7C3 /* FBElementScreenshotTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBElementScreenshotTests.m; sourceTree = "<group>"; };
|
|
1047
1040
|
71ACF5B7242F2FDC00F0AAD4 /* FBSafariAlertTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBSafariAlertTests.m; sourceTree = "<group>"; };
|
|
1048
1041
|
71B155D923070ECF00646AFB /* FBHTTPStatusCodes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FBHTTPStatusCodes.h; sourceTree = "<group>"; };
|
|
1049
1042
|
71B155DB230711E900646AFB /* FBCommandStatus.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBCommandStatus.m; sourceTree = "<group>"; };
|
|
@@ -1353,9 +1346,6 @@
|
|
|
1353
1346
|
EEC088E41CB56AC000B65968 /* FBElementCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBElementCache.m; sourceTree = "<group>"; };
|
|
1354
1347
|
EEC088E61CB56DA400B65968 /* FBExceptionHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBExceptionHandler.h; sourceTree = "<group>"; };
|
|
1355
1348
|
EEC088E71CB56DA400B65968 /* FBExceptionHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBExceptionHandler.m; sourceTree = "<group>"; };
|
|
1356
|
-
EEC9EED420064FAA00BC0D5B /* XCUICoordinate+FBFix.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "XCUICoordinate+FBFix.h"; sourceTree = "<group>"; };
|
|
1357
|
-
EEC9EED520064FAA00BC0D5B /* XCUICoordinate+FBFix.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "XCUICoordinate+FBFix.m"; sourceTree = "<group>"; };
|
|
1358
|
-
EEC9EED820077D8E00BC0D5B /* XCUICoordinateFix.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XCUICoordinateFix.m; sourceTree = "<group>"; };
|
|
1359
1349
|
EEDBEBBA1CB2681900A790A2 /* WebDriverAgent.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = WebDriverAgent.bundle; sourceTree = "<group>"; };
|
|
1360
1350
|
EEDFE11F1D9C06F800E6FFE5 /* XCUIDevice+FBHealthCheck.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "XCUIDevice+FBHealthCheck.h"; sourceTree = "<group>"; };
|
|
1361
1351
|
EEDFE1201D9C06F800E6FFE5 /* XCUIDevice+FBHealthCheck.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "XCUIDevice+FBHealthCheck.m"; sourceTree = "<group>"; };
|
|
@@ -1737,8 +1727,6 @@
|
|
|
1737
1727
|
716C9DFF27315EFF005AD475 /* XCUIApplication+FBUIInterruptions.m */,
|
|
1738
1728
|
71D475C02538F5A8008D9401 /* XCUIApplicationProcess+FBQuiescence.h */,
|
|
1739
1729
|
71D475C12538F5A8008D9401 /* XCUIApplicationProcess+FBQuiescence.m */,
|
|
1740
|
-
EEC9EED420064FAA00BC0D5B /* XCUICoordinate+FBFix.h */,
|
|
1741
|
-
EEC9EED520064FAA00BC0D5B /* XCUICoordinate+FBFix.m */,
|
|
1742
1730
|
719CD8FA2126C88B00C7D0C2 /* XCUIApplication+FBAlert.h */,
|
|
1743
1731
|
719CD8FB2126C88B00C7D0C2 /* XCUIApplication+FBAlert.m */,
|
|
1744
1732
|
71BD20711F86116100B36EC2 /* XCUIApplication+FBTouchAction.h */,
|
|
@@ -1985,7 +1973,6 @@
|
|
|
1985
1973
|
719A97AB1F88E7370063B4BD /* FBAppiumMultiTouchActionsIntegrationTests.m */,
|
|
1986
1974
|
719CD8FE2126C90200C7D0C2 /* FBAutoAlertsHandlerTests.m */,
|
|
1987
1975
|
EE26409C1D0EBA25009BE6B0 /* FBElementAttributeTests.m */,
|
|
1988
|
-
71AB82B11FDAE8C000D1D7C3 /* FBElementScreenshotTests.m */,
|
|
1989
1976
|
71F5BE33252E5B2200EE9EBA /* FBElementSwipingTests.m */,
|
|
1990
1977
|
EE006EAC1EB99B15006900A4 /* FBElementVisibilityTests.m */,
|
|
1991
1978
|
EE6A89361D0B35920083E92B /* FBFailureProofTestCaseTests.m */,
|
|
@@ -2045,7 +2032,6 @@
|
|
|
2045
2032
|
EE9B76581CF7987300275851 /* Info.plist */,
|
|
2046
2033
|
7139145B1DF01A12005896C2 /* NSExpressionFBFormatTests.m */,
|
|
2047
2034
|
71A224E71DE326C500844D55 /* NSPredicateFBFormatTests.m */,
|
|
2048
|
-
EEC9EED820077D8E00BC0D5B /* XCUICoordinateFix.m */,
|
|
2049
2035
|
713914591DF01989005896C2 /* XCUIElementHelpersTests.m */,
|
|
2050
2036
|
);
|
|
2051
2037
|
path = UnitTests;
|
|
@@ -2311,7 +2297,6 @@
|
|
|
2311
2297
|
641EE65B2240C5CA00173FCB /* XCUIElementHitPointCoordinate.h in Headers */,
|
|
2312
2298
|
641EE65C2240C5CA00173FCB /* XCTDarwinNotificationExpectation.h in Headers */,
|
|
2313
2299
|
641EE65D2240C5CA00173FCB /* XCTRunnerAutomationSession.h in Headers */,
|
|
2314
|
-
641EE65E2240C5CA00173FCB /* XCUICoordinate+FBFix.h in Headers */,
|
|
2315
2300
|
641EE65F2240C5CA00173FCB /* XCSourceCodeTreeNodeEnumerator.h in Headers */,
|
|
2316
2301
|
641EE6602240C5CA00173FCB /* XCUIElement+FBIsVisible.h in Headers */,
|
|
2317
2302
|
641EE6612240C5CA00173FCB /* XCUIElement+FBTap.h in Headers */,
|
|
@@ -2548,7 +2533,6 @@
|
|
|
2548
2533
|
EE35AD3F1E3B77D600A02D78 /* XCTDarwinNotificationExpectation.h in Headers */,
|
|
2549
2534
|
EE35AD5F1E3B77D600A02D78 /* XCTRunnerAutomationSession.h in Headers */,
|
|
2550
2535
|
71C9EAAC25E8415A00470CD8 /* FBScreenshot.h in Headers */,
|
|
2551
|
-
EEC9EED620064FAA00BC0D5B /* XCUICoordinate+FBFix.h in Headers */,
|
|
2552
2536
|
EE35AD371E3B77D600A02D78 /* XCSourceCodeTreeNodeEnumerator.h in Headers */,
|
|
2553
2537
|
EE158AB01CBD456F00A3E3F0 /* XCUIElement+FBIsVisible.h in Headers */,
|
|
2554
2538
|
71414ED42670A1EE003A8C5D /* LRUCache.h in Headers */,
|
|
@@ -3141,7 +3125,6 @@
|
|
|
3141
3125
|
641EE6052240C5CA00173FCB /* FBUnknownCommands.m in Sources */,
|
|
3142
3126
|
641EE6062240C5CA00173FCB /* FBOrientationCommands.m in Sources */,
|
|
3143
3127
|
641EE7092240CDEB00173FCB /* XCUIElement+FBTVFocuse.m in Sources */,
|
|
3144
|
-
641EE6072240C5CA00173FCB /* XCUICoordinate+FBFix.m in Sources */,
|
|
3145
3128
|
641EE6082240C5CA00173FCB /* FBRuntimeUtils.m in Sources */,
|
|
3146
3129
|
641EE6092240C5CA00173FCB /* XCUIElement+FBUtilities.m in Sources */,
|
|
3147
3130
|
641EE60A2240C5CA00173FCB /* FBLogger.m in Sources */,
|
|
@@ -3259,7 +3242,6 @@
|
|
|
3259
3242
|
EE158AC51CBD456F00A3E3F0 /* FBOrientationCommands.m in Sources */,
|
|
3260
3243
|
71D475C42538F5A8008D9401 /* XCUIApplicationProcess+FBQuiescence.m in Sources */,
|
|
3261
3244
|
641EE7082240CDEB00173FCB /* XCUIElement+FBTVFocuse.m in Sources */,
|
|
3262
|
-
EEC9EED720064FAA00BC0D5B /* XCUICoordinate+FBFix.m in Sources */,
|
|
3263
3245
|
71E75E6F254824230099FC87 /* XCUIElementQuery+FBHelpers.m in Sources */,
|
|
3264
3246
|
71D04DCA25356C43008A052C /* XCUIElement+FBCaching.m in Sources */,
|
|
3265
3247
|
EE158AEB1CBD456F00A3E3F0 /* FBRuntimeUtils.m in Sources */,
|
|
@@ -3330,7 +3312,6 @@
|
|
|
3330
3312
|
715AFAC41FFA2AAF0053896D /* FBScreenTests.m in Sources */,
|
|
3331
3313
|
EE22021E1ECC618900A29571 /* FBTapTest.m in Sources */,
|
|
3332
3314
|
71930C472066434000D3AFEC /* FBPasteboardTests.m in Sources */,
|
|
3333
|
-
71AB82B21FDAE8C000D1D7C3 /* FBElementScreenshotTests.m in Sources */,
|
|
3334
3315
|
7150FFF722476B3A00B2EE28 /* FBForceTouchTests.m in Sources */,
|
|
3335
3316
|
);
|
|
3336
3317
|
runOnlyForDeploymentPostprocessing = 0;
|
|
@@ -3382,7 +3363,6 @@
|
|
|
3382
3363
|
ADBC39981D07842800327304 /* XCUIElementDouble.m in Sources */,
|
|
3383
3364
|
7139145A1DF01989005896C2 /* XCUIElementHelpersTests.m in Sources */,
|
|
3384
3365
|
EE6A89261D0B19E60083E92B /* FBSessionTests.m in Sources */,
|
|
3385
|
-
EEC9EED920077D8E00BC0D5B /* XCUICoordinateFix.m in Sources */,
|
|
3386
3366
|
71A7EAFC1E229302001DA4F2 /* FBClassChainTests.m in Sources */,
|
|
3387
3367
|
EE18883D1DA663EB00307AA8 /* FBMathUtilsTests.m in Sources */,
|
|
3388
3368
|
);
|
|
@@ -36,26 +36,15 @@ NSString *const FB_SAFARI_APP_NAME = @"Safari";
|
|
|
36
36
|
}];
|
|
37
37
|
NSPredicate *dstViewContainPredicate1 = [NSPredicate predicateWithFormat:@"elementType == %lu", XCUIElementTypeTextView];
|
|
38
38
|
NSPredicate *dstViewContainPredicate2 = [NSPredicate predicateWithFormat:@"elementType == %lu", XCUIElementTypeButton];
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
containingPredicate:dstViewContainPredicate2].allElementsBoundByIndex.firstObject;
|
|
49
|
-
} else {
|
|
50
|
-
NSPredicate *webViewPredicate = [NSPredicate predicateWithFormat:@"elementType == %lu", XCUIElementTypeWebView];
|
|
51
|
-
// Find the first XCUIElementTypeOther which is the descendant of the scroll view
|
|
52
|
-
// and is horizontally aligned to the center of the screen
|
|
53
|
-
candidate = [[[[[scrollView.fb_query containingPredicate:webViewPredicate]
|
|
54
|
-
descendantsMatchingType:XCUIElementTypeOther]
|
|
55
|
-
matchingPredicate:dstViewMatchPredicate]
|
|
56
|
-
containingPredicate:dstViewContainPredicate1]
|
|
57
|
-
containingPredicate:dstViewContainPredicate2].allElementsBoundByIndex.firstObject;
|
|
58
|
-
}
|
|
39
|
+
// Find the first XCUIElementTypeOther which is the grandchild of the web view
|
|
40
|
+
// and is horizontally aligned to the center of the screen
|
|
41
|
+
XCUIElement *candidate = [[[[[[scrollView descendantsMatchingType:XCUIElementTypeAny]
|
|
42
|
+
matchingIdentifier:@"WebView"]
|
|
43
|
+
descendantsMatchingType:XCUIElementTypeOther]
|
|
44
|
+
matchingPredicate:dstViewMatchPredicate]
|
|
45
|
+
containingPredicate:dstViewContainPredicate1]
|
|
46
|
+
containingPredicate:dstViewContainPredicate2].allElementsBoundByIndex.firstObject;
|
|
47
|
+
|
|
59
48
|
if (nil == candidate) {
|
|
60
49
|
return nil;
|
|
61
50
|
}
|
|
@@ -86,11 +86,7 @@ static bool fb_isLocked;
|
|
|
86
86
|
[self pressButton:XCUIDeviceButtonHome];
|
|
87
87
|
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:FBHomeButtonCoolOffTime]];
|
|
88
88
|
#if !TARGET_OS_TV
|
|
89
|
-
|
|
90
|
-
[[FBApplication fb_activeApplication] swipeRight];
|
|
91
|
-
} else {
|
|
92
|
-
[self pressButton:XCUIDeviceButtonHome];
|
|
93
|
-
}
|
|
89
|
+
[self pressButton:XCUIDeviceButtonHome];
|
|
94
90
|
#else
|
|
95
91
|
[self pressButton:XCUIDeviceButtonHome];
|
|
96
92
|
#endif
|
|
@@ -186,18 +186,6 @@
|
|
|
186
186
|
}
|
|
187
187
|
CGPoint midPoint = CGPointMake(visibleRect.origin.x + visibleRect.size.width / 2,
|
|
188
188
|
visibleRect.origin.y + visibleRect.size.height / 2);
|
|
189
|
-
#if !TARGET_OS_TV // TV has no orientation, so it does not need to coordinate
|
|
190
|
-
id<FBXCElementSnapshot> appElement = ancestors.count > 0 ? [ancestors lastObject] : self;
|
|
191
|
-
CGRect appFrame = appElement.frame;
|
|
192
|
-
CGRect windowFrame = nil == parentWindow ? selfFrame : parentWindow.frame;
|
|
193
|
-
if ((appFrame.size.height > appFrame.size.width && windowFrame.size.height < windowFrame.size.width) ||
|
|
194
|
-
(appFrame.size.height < appFrame.size.width && windowFrame.size.height > windowFrame.size.width)) {
|
|
195
|
-
// This is the indication of the fact that transformation is broken and coordinates should be
|
|
196
|
-
// recalculated manually.
|
|
197
|
-
// However, upside-down case cannot be covered this way, which is not important for Appium
|
|
198
|
-
midPoint = FBInvertPointForApplication(midPoint, appFrame.size, FBApplication.fb_activeApplication.interfaceOrientation);
|
|
199
|
-
}
|
|
200
|
-
#endif
|
|
201
189
|
id<FBXCAccessibilityElement> hitElement = [FBActiveAppDetectionPoint axElementWithPoint:midPoint];
|
|
202
190
|
if (nil != hitElement) {
|
|
203
191
|
if (FBIsAXElementEqualToOther(self.accessibilityElement, hitElement)) {
|
|
@@ -12,9 +12,7 @@
|
|
|
12
12
|
#import "FBRunLoopSpinner.h"
|
|
13
13
|
#import "FBXCElementSnapshot.h"
|
|
14
14
|
#import "FBXCodeCompatibility.h"
|
|
15
|
-
#import "XCUIApplication+FBTouchAction.h"
|
|
16
15
|
#import "XCUICoordinate.h"
|
|
17
|
-
#import "XCUICoordinate+FBFix.h"
|
|
18
16
|
#import "XCUIElement+FBCaching.h"
|
|
19
17
|
#import "XCUIElement+FBResolve.h"
|
|
20
18
|
|
|
@@ -31,16 +29,6 @@ static const NSTimeInterval VALUE_CHANGE_TIMEOUT = 2;
|
|
|
31
29
|
NSString *previousValue = snapshot.value;
|
|
32
30
|
XCUICoordinate *startCoord = [self coordinateWithNormalizedOffset:CGVectorMake(0.5, 0.5)];
|
|
33
31
|
XCUICoordinate *endCoord = [startCoord coordinateWithOffset:CGVectorMake(0.0, relativeHeightOffset * snapshot.frame.size.height)];
|
|
34
|
-
CGPoint tapPoint = endCoord.fb_screenPoint;
|
|
35
|
-
NSArray<NSDictionary<NSString *, id> *> *gesture =
|
|
36
|
-
@[@{
|
|
37
|
-
@"action": @"tap",
|
|
38
|
-
@"options": @{
|
|
39
|
-
@"x": @(tapPoint.x),
|
|
40
|
-
@"y": @(tapPoint.y),
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
];
|
|
44
32
|
// If picker value is reflected in its accessiblity id
|
|
45
33
|
// then fetching of the next snapshot may fail with StaleElementReferenceError
|
|
46
34
|
// because we bound elements by their accessbility ids by default.
|
|
@@ -48,9 +36,7 @@ static const NSTimeInterval VALUE_CHANGE_TIMEOUT = 2;
|
|
|
48
36
|
// unique element identifier (UID), so it could be found next time even if its
|
|
49
37
|
// id is different from the initial one. See https://github.com/appium/appium/issues/17569
|
|
50
38
|
XCUIElement *stableInstance = self.fb_stableInstance;
|
|
51
|
-
|
|
52
|
-
return NO;
|
|
53
|
-
}
|
|
39
|
+
[endCoord tap];
|
|
54
40
|
return [[[[FBRunLoopSpinner new]
|
|
55
41
|
timeout:VALUE_CHANGE_TIMEOUT]
|
|
56
42
|
timeoutErrorMessage:[NSString stringWithFormat:@"Picker wheel value has not been changed after %@ seconds timeout", @(VALUE_CHANGE_TIMEOUT)]]
|
|
@@ -16,11 +16,9 @@
|
|
|
16
16
|
#import "FBXCodeCompatibility.h"
|
|
17
17
|
#import "FBXCElementSnapshotWrapper.h"
|
|
18
18
|
#import "FBXCElementSnapshotWrapper+Helpers.h"
|
|
19
|
-
#import "XCUIApplication+FBTouchAction.h"
|
|
20
19
|
#import "XCUIElement+FBCaching.h"
|
|
21
20
|
#import "XCUIApplication.h"
|
|
22
21
|
#import "XCUICoordinate.h"
|
|
23
|
-
#import "XCUICoordinate+FBFix.h"
|
|
24
22
|
#import "XCUIElement+FBIsVisible.h"
|
|
25
23
|
#import "XCUIElement.h"
|
|
26
24
|
#import "XCUIElement+FBUtilities.h"
|
|
@@ -28,7 +26,8 @@
|
|
|
28
26
|
|
|
29
27
|
const CGFloat FBFuzzyPointThreshold = 20.f; //Smallest determined value that is not interpreted as touch
|
|
30
28
|
const CGFloat FBScrollToVisibleNormalizedDistance = .5f;
|
|
31
|
-
const CGFloat FBTouchEventDelay =
|
|
29
|
+
const CGFloat FBTouchEventDelay = 0.5f;
|
|
30
|
+
const CGFloat FBTouchVelocity = 300; // pixels per sec
|
|
32
31
|
const CGFloat FBScrollTouchProportion = 0.75f;
|
|
33
32
|
|
|
34
33
|
#if !TARGET_OS_TV
|
|
@@ -321,45 +320,16 @@ const CGFloat FBScrollTouchProportion = 0.75f;
|
|
|
321
320
|
|
|
322
321
|
XCUICoordinate *appCoordinate = [[XCUICoordinate alloc] initWithElement:application normalizedOffset:CGVectorMake(0.0, 0.0)];
|
|
323
322
|
XCUICoordinate *startCoordinate = [[XCUICoordinate alloc] initWithCoordinate:appCoordinate pointsOffset:hitpointOffset];
|
|
324
|
-
CGPoint startPoint = startCoordinate.fb_screenPoint;
|
|
325
323
|
XCUICoordinate *endCoordinate = [[XCUICoordinate alloc] initWithCoordinate:startCoordinate pointsOffset:vector];
|
|
326
|
-
CGPoint endPoint = endCoordinate.fb_screenPoint;
|
|
327
324
|
|
|
328
|
-
if (FBPointFuzzyEqualToPoint(
|
|
325
|
+
if (FBPointFuzzyEqualToPoint(startCoordinate.screenPoint, endCoordinate.screenPoint, FBFuzzyPointThreshold)) {
|
|
329
326
|
return YES;
|
|
330
327
|
}
|
|
331
328
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
@"x": @(startPoint.x),
|
|
337
|
-
@"y": @(startPoint.y),
|
|
338
|
-
}
|
|
339
|
-
},
|
|
340
|
-
@{
|
|
341
|
-
@"action": @"wait",
|
|
342
|
-
@"options": @{
|
|
343
|
-
@"ms": @(FBTouchEventDelay * 1000),
|
|
344
|
-
}
|
|
345
|
-
},
|
|
346
|
-
@{
|
|
347
|
-
@"action": @"moveTo",
|
|
348
|
-
@"options": @{
|
|
349
|
-
@"x": @(endPoint.x),
|
|
350
|
-
@"y": @(endPoint.y),
|
|
351
|
-
}
|
|
352
|
-
},
|
|
353
|
-
@{
|
|
354
|
-
@"action": @"release"
|
|
355
|
-
}
|
|
356
|
-
];
|
|
357
|
-
if (![application fb_performAppiumTouchActions:gesture
|
|
358
|
-
elementCache:nil
|
|
359
|
-
error:error]) {
|
|
360
|
-
return NO;
|
|
361
|
-
}
|
|
362
|
-
|
|
329
|
+
[startCoordinate pressForDuration:FBTouchEventDelay
|
|
330
|
+
thenDragToCoordinate:endCoordinate
|
|
331
|
+
withVelocity:FBTouchVelocity
|
|
332
|
+
thenHoldForDuration:FBTouchEventDelay];
|
|
363
333
|
return YES;
|
|
364
334
|
}
|
|
365
335
|
|
|
@@ -9,52 +9,23 @@
|
|
|
9
9
|
|
|
10
10
|
#import "XCUIElement+FBTap.h"
|
|
11
11
|
|
|
12
|
-
#import "FBMacros.h"
|
|
13
|
-
#import "XCUIApplication+FBTouchAction.h"
|
|
14
|
-
#import "XCUIElement+FBUtilities.h"
|
|
15
|
-
|
|
16
12
|
|
|
17
13
|
#if !TARGET_OS_TV
|
|
18
14
|
@implementation XCUIElement (FBTap)
|
|
19
15
|
|
|
20
16
|
- (BOOL)fb_tapWithError:(NSError **)error
|
|
21
17
|
{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return YES;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
NSArray<NSDictionary<NSString *, id> *> *tapGesture =
|
|
28
|
-
@[
|
|
29
|
-
@{@"action": @"tap",
|
|
30
|
-
@"options": @{@"element": self}
|
|
31
|
-
}
|
|
32
|
-
];
|
|
33
|
-
return [self.application fb_performAppiumTouchActions:tapGesture elementCache:nil error:error];
|
|
18
|
+
[self tap];
|
|
19
|
+
return YES;
|
|
34
20
|
}
|
|
35
21
|
|
|
36
22
|
- (BOOL)fb_tapCoordinate:(CGPoint)relativeCoordinate error:(NSError **)error
|
|
37
23
|
{
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
XCUICoordinate *dstCoordinate = [startCoordinate coordinateWithOffset:offset];
|
|
44
|
-
[dstCoordinate tap];
|
|
45
|
-
return YES;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
NSArray<NSDictionary<NSString *, id> *> *tapGesture =
|
|
49
|
-
@[
|
|
50
|
-
@{@"action": @"tap",
|
|
51
|
-
@"options": @{@"element": self,
|
|
52
|
-
@"x": @(relativeCoordinate.x),
|
|
53
|
-
@"y": @(relativeCoordinate.y)
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
];
|
|
57
|
-
return [self.application fb_performAppiumTouchActions:tapGesture elementCache:nil error:error];
|
|
24
|
+
XCUICoordinate *startCoordinate = [self coordinateWithNormalizedOffset:CGVectorMake(0, 0)];
|
|
25
|
+
CGVector offset = CGVectorMake(relativeCoordinate.x, relativeCoordinate.y);
|
|
26
|
+
XCUICoordinate *dstCoordinate = [startCoordinate coordinateWithOffset:offset];
|
|
27
|
+
[dstCoordinate tap];
|
|
28
|
+
return YES;
|
|
58
29
|
}
|
|
59
30
|
|
|
60
31
|
@end
|
|
@@ -98,13 +98,6 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
98
98
|
*/
|
|
99
99
|
- (void)fb_waitUntilStableWithTimeout:(NSTimeInterval)timeout;
|
|
100
100
|
|
|
101
|
-
/**
|
|
102
|
-
Returns screenshot of the particular element
|
|
103
|
-
@param error If there is an error, upon return contains an NSError object that describes the problem.
|
|
104
|
-
@return Element screenshot as PNG-encoded data or nil in case of failure
|
|
105
|
-
*/
|
|
106
|
-
- (nullable NSData *)fb_screenshotWithError:(NSError*__autoreleasing*)error;
|
|
107
|
-
|
|
108
101
|
@end
|
|
109
102
|
|
|
110
103
|
NS_ASSUME_NONNULL_END
|
|
@@ -197,53 +197,4 @@
|
|
|
197
197
|
FBConfiguration.waitForIdleTimeout = previousTimeout;
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
- (NSData *)fb_screenshotWithError:(NSError **)error
|
|
201
|
-
{
|
|
202
|
-
id<FBXCElementSnapshot> selfSnapshot = self.fb_isResolvedFromCache.boolValue
|
|
203
|
-
? self.lastSnapshot
|
|
204
|
-
: self.fb_takeSnapshot;
|
|
205
|
-
if (CGRectIsEmpty(selfSnapshot.frame)) {
|
|
206
|
-
if (error) {
|
|
207
|
-
*error = [[FBErrorBuilder.builder withDescription:@"Cannot get a screenshot of zero-sized element"] build];
|
|
208
|
-
}
|
|
209
|
-
return nil;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
CGRect elementRect = selfSnapshot.frame;
|
|
213
|
-
#if !TARGET_OS_TV
|
|
214
|
-
UIInterfaceOrientation orientation = self.application.interfaceOrientation;
|
|
215
|
-
if (orientation == UIInterfaceOrientationLandscapeLeft || orientation == UIInterfaceOrientationLandscapeRight) {
|
|
216
|
-
// Workaround XCTest bug when element frame is returned as in portrait mode even if the screenshot is rotated
|
|
217
|
-
NSArray<id<FBXCElementSnapshot>> *ancestors = [FBXCElementSnapshotWrapper ensureWrapped:selfSnapshot].fb_ancestors;
|
|
218
|
-
id<FBXCElementSnapshot> parentWindow = nil;
|
|
219
|
-
if (1 == ancestors.count) {
|
|
220
|
-
parentWindow = selfSnapshot;
|
|
221
|
-
} else if (ancestors.count > 1) {
|
|
222
|
-
parentWindow = [ancestors objectAtIndex:ancestors.count - 2];
|
|
223
|
-
}
|
|
224
|
-
if (nil != parentWindow) {
|
|
225
|
-
CGRect appFrame = ancestors.lastObject.frame;
|
|
226
|
-
CGRect parentWindowFrame = parentWindow.frame;
|
|
227
|
-
if (CGRectEqualToRect(appFrame, parentWindowFrame)
|
|
228
|
-
|| (appFrame.size.width > appFrame.size.height && parentWindowFrame.size.width > parentWindowFrame.size.height)
|
|
229
|
-
|| (appFrame.size.width < appFrame.size.height && parentWindowFrame.size.width < parentWindowFrame.size.height)) {
|
|
230
|
-
CGPoint fixedOrigin = orientation == UIInterfaceOrientationLandscapeLeft ?
|
|
231
|
-
CGPointMake(appFrame.size.height - elementRect.origin.y - elementRect.size.height, elementRect.origin.x) :
|
|
232
|
-
CGPointMake(elementRect.origin.y, appFrame.size.width - elementRect.origin.x - elementRect.size.width);
|
|
233
|
-
elementRect = CGRectMake(fixedOrigin.x, fixedOrigin.y, elementRect.size.height, elementRect.size.width);
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
#endif
|
|
238
|
-
|
|
239
|
-
// adjust element rect for the actual screen scale
|
|
240
|
-
XCUIScreen *mainScreen = XCUIScreen.mainScreen;
|
|
241
|
-
elementRect = CGRectMake(elementRect.origin.x * mainScreen.scale, elementRect.origin.y * mainScreen.scale,
|
|
242
|
-
elementRect.size.width * mainScreen.scale, elementRect.size.height * mainScreen.scale);
|
|
243
|
-
|
|
244
|
-
return [FBScreenshot takeInOriginalResolutionWithQuality:FBConfiguration.screenshotQuality
|
|
245
|
-
rect:elementRect
|
|
246
|
-
error:error];
|
|
247
|
-
}
|
|
248
|
-
|
|
249
200
|
@end
|
|
@@ -423,10 +423,8 @@
|
|
|
423
423
|
#endif
|
|
424
424
|
}];
|
|
425
425
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
deviceInfo[@"thermalState"] = @(NSProcessInfo.processInfo.thermalState);
|
|
429
|
-
}
|
|
426
|
+
// https://developer.apple.com/documentation/foundation/nsprocessinfothermalstate
|
|
427
|
+
deviceInfo[@"thermalState"] = @(NSProcessInfo.processInfo.thermalState);
|
|
430
428
|
|
|
431
429
|
return FBResponseWithObject(deviceInfo);
|
|
432
430
|
}
|
|
@@ -594,10 +594,10 @@
|
|
|
594
594
|
{
|
|
595
595
|
FBElementCache *elementCache = request.session.elementCache;
|
|
596
596
|
XCUIElement *element = [elementCache elementForUUID:(NSString *)request.parameters[@"uuid"]];
|
|
597
|
-
|
|
598
|
-
NSData *screenshotData = [element fb_screenshotWithError:&error];
|
|
597
|
+
NSData *screenshotData = [element.screenshot PNGRepresentation];
|
|
599
598
|
if (nil == screenshotData) {
|
|
600
|
-
|
|
599
|
+
NSString *errMsg = [NSString stringWithFormat:@"Cannot take a screenshot of %@", element.description];
|
|
600
|
+
return FBResponseWithStatus([FBCommandStatus unableToCaptureScreenErrorWithMessage:errMsg
|
|
601
601
|
traceback:nil]);
|
|
602
602
|
}
|
|
603
603
|
NSString *screenshot = [screenshotData base64EncodedStringWithOptions:0];
|
|
@@ -606,36 +606,54 @@
|
|
|
606
606
|
|
|
607
607
|
|
|
608
608
|
#if !TARGET_OS_TV
|
|
609
|
-
static const CGFloat
|
|
609
|
+
static const CGFloat DEFAULT_PICKER_OFFSET = (CGFloat)0.2;
|
|
610
|
+
static const NSInteger DEFAULT_MAX_PICKER_ATTEMPTS = 25;
|
|
611
|
+
|
|
610
612
|
|
|
611
613
|
+ (id<FBResponsePayload>)handleWheelSelect:(FBRouteRequest *)request
|
|
612
614
|
{
|
|
613
615
|
FBElementCache *elementCache = request.session.elementCache;
|
|
614
616
|
XCUIElement *element = [elementCache elementForUUID:(NSString *)request.parameters[@"uuid"]];
|
|
615
617
|
if ([element.lastSnapshot elementType] != XCUIElementTypePickerWheel) {
|
|
616
|
-
|
|
618
|
+
NSString *errMsg = [NSString stringWithFormat:@"The element is expected to be a valid Picker Wheel control. '%@' was given instead", element.wdType];
|
|
619
|
+
return FBResponseWithStatus([FBCommandStatus invalidArgumentErrorWithMessage:errMsg
|
|
620
|
+
traceback:[NSString stringWithFormat:@"%@", NSThread.callStackSymbols]]);
|
|
617
621
|
}
|
|
618
622
|
NSString* order = [request.arguments[@"order"] lowercaseString];
|
|
619
|
-
CGFloat offset =
|
|
623
|
+
CGFloat offset = DEFAULT_PICKER_OFFSET;
|
|
620
624
|
if (request.arguments[@"offset"]) {
|
|
621
625
|
offset = (CGFloat)[request.arguments[@"offset"] doubleValue];
|
|
622
626
|
if (offset <= 0.0 || offset > 0.5) {
|
|
623
|
-
|
|
627
|
+
NSString *errMsg = [NSString stringWithFormat:@"'offset' value is expected to be in range (0.0, 0.5]. '%@' was given instead", request.arguments[@"offset"]];
|
|
628
|
+
return FBResponseWithStatus([FBCommandStatus invalidArgumentErrorWithMessage:errMsg
|
|
629
|
+
traceback:[NSString stringWithFormat:@"%@", NSThread.callStackSymbols]]);
|
|
624
630
|
}
|
|
625
631
|
}
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
632
|
+
NSNumber *maxAttempts = request.arguments[@"maxAttempts"] ?: @(DEFAULT_MAX_PICKER_ATTEMPTS);
|
|
633
|
+
NSString *expectedValue = request.arguments[@"value"];
|
|
634
|
+
NSInteger attempt = 0;
|
|
635
|
+
while (attempt < [maxAttempts integerValue]) {
|
|
636
|
+
BOOL isSuccessful = false;
|
|
637
|
+
NSError *error;
|
|
638
|
+
if ([order isEqualToString:@"next"]) {
|
|
639
|
+
isSuccessful = [element fb_selectNextOptionWithOffset:offset error:&error];
|
|
640
|
+
} else if ([order isEqualToString:@"previous"]) {
|
|
641
|
+
isSuccessful = [element fb_selectPreviousOptionWithOffset:offset error:&error];
|
|
642
|
+
} else {
|
|
643
|
+
NSString *errMsg = [NSString stringWithFormat:@"Only 'previous' and 'next' order values are supported. '%@' was given instead", request.arguments[@"order"]];
|
|
644
|
+
return FBResponseWithStatus([FBCommandStatus invalidArgumentErrorWithMessage:errMsg
|
|
645
|
+
traceback:[NSString stringWithFormat:@"%@", NSThread.callStackSymbols]]);
|
|
646
|
+
}
|
|
647
|
+
if (!isSuccessful) {
|
|
648
|
+
return FBResponseWithStatus([FBCommandStatus invalidElementStateErrorWithMessage:error.description traceback:nil]);
|
|
649
|
+
}
|
|
650
|
+
if (nil == expectedValue || [element.wdValue isEqualToString:expectedValue]) {
|
|
651
|
+
return FBResponseWithOK();
|
|
652
|
+
}
|
|
653
|
+
attempt++;
|
|
637
654
|
}
|
|
638
|
-
|
|
655
|
+
NSString *errMsg = [NSString stringWithFormat:@"Cannot select the expected picker wheel value '%@' after %ld attempts", expectedValue, attempt];
|
|
656
|
+
return FBResponseWithStatus([FBCommandStatus invalidElementStateErrorWithMessage:errMsg traceback:nil]);
|
|
639
657
|
}
|
|
640
658
|
|
|
641
659
|
#pragma mark - Helpers
|