Skip to content

Commit 278fb60

Browse files
Merge pull request #59 from appium/master
Fork Sync: Update from parent repository
2 parents 95bfcb9 + 77aeef7 commit 278fb60

10 files changed

+14
-1270
lines changed

CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
## [7.0.0](https://github.com/appium/WebDriverAgent/compare/v6.1.1...v7.0.0) (2024-02-12)
2+
3+
4+
### ⚠ BREAKING CHANGES
5+
6+
* The following REST endpoints have been removed, use W3C actions instead:
7+
- /wda/touch/perform
8+
- /wda/touch/multi/perform
9+
10+
### Features
11+
12+
* Remove obsolete MJSONWP touch actions ([#847](https://github.com/appium/WebDriverAgent/issues/847)) ([d77f640](https://github.com/appium/WebDriverAgent/commit/d77f640867155fddbbbc9575f0a77802602865e7))
13+
114
## [6.1.1](https://github.com/appium/WebDriverAgent/compare/v6.1.0...v6.1.1) (2024-02-11)
215

316

WebDriverAgent.xcodeproj/project.pbxproj

-20
Large diffs are not rendered by default.

WebDriverAgentLib/Categories/XCUIApplication+FBTouchAction.h

-37
Original file line numberDiff line numberDiff line change
@@ -15,43 +15,6 @@ NS_ASSUME_NONNULL_BEGIN
1515

1616
@interface XCUIApplication (FBTouchAction)
1717

18-
/**
19-
Perform complex touch action in scope of the current application.
20-
Touch actions are represented as lists of dictionaries with predefined sets of values and keys.
21-
Each dictionary must contain 'action' key, which is one of the following:
22-
- 'tap' to perform a single tap
23-
- 'longPress' to perform long tap
24-
- 'press' to perform press
25-
- 'release' to release the finger
26-
- 'moveTo' to move the virtual finger
27-
- 'wait' to modify the duration of the preceeding action
28-
- 'cancel' to cancel the preceeding action in the chain
29-
Each dictionary can also contain 'options' key with additional parameters dictionary related to the appropriate action.
30-
31-
The following options are mandatory for 'tap', 'longPress', 'press' and 'moveTo' actions:
32-
- 'x' the X coordinate of the action
33-
- 'y' the Y coordinate of the action
34-
- 'element' the corresponding element instance, for which the action is going to be performed
35-
If only 'element' is set then hit point coordinates of this element will be used.
36-
If only 'x' and 'y' are set then these will be considered as absolute coordinates.
37-
If both 'element' and 'x'/'y' are set then these will act as relative element coordinates.
38-
39-
It is also mandatory, that 'release' and 'wait' actions are preceeded with at least one chain item, which contains absolute coordinates, like 'tap', 'press' or 'longPress'. Empty chains are not allowed.
40-
41-
The following additional options are available for different actions:
42-
- 'tap': 'count' (defines count of taps to be performed in a row; 1 by default)
43-
- 'longPress': 'duration' (number of milliseconds to hold/move the virtual finger; 500.0 ms by default)
44-
- 'wait': 'ms' (number of milliseconds to wait for the preceeding action; 0.0 ms by default)
45-
46-
List of lists can be passed there is order to perform multi-finger touch action. Each single actions chain is going to be executed by a separate virtual finger in such case.
47-
48-
@param actions Either array of dictionaries, whose format is described above to peform single-finger touch action or array of array to perform multi-finger touch action.
49-
@param elementCache Cached elements mapping for the currrent application. The method assumes all elements are already represented by their actual instances if nil value is set
50-
@param error If there is an error, upon return contains an NSError object that describes the problem
51-
@return YES If the touch action has been successfully performed without errors
52-
*/
53-
- (BOOL)fb_performAppiumTouchActions:(NSArray *)actions elementCache:(nullable FBElementCache *)elementCache error:(NSError * _Nullable*)error;
54-
5518
/**
5619
Perform complex touch action in scope of the current application.
5720

WebDriverAgentLib/Categories/XCUIApplication+FBTouchAction.m

-15
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
#import "XCUIApplication+FBTouchAction.h"
1212

13-
#import "FBAppiumActionsSynthesizer.h"
1413
#import "FBBaseActionsSynthesizer.h"
1514
#import "FBConfiguration.h"
1615
#import "FBExceptions.h"
@@ -54,20 +53,6 @@ - (BOOL)fb_performActionsWithSynthesizerType:(Class)synthesizerType
5453
return [self fb_synthesizeEvent:eventRecord error:error];
5554
}
5655

57-
- (BOOL)fb_performAppiumTouchActions:(NSArray *)actions
58-
elementCache:(FBElementCache *)elementCache
59-
error:(NSError **)error
60-
{
61-
if (![self fb_performActionsWithSynthesizerType:FBAppiumActionsSynthesizer.class
62-
actions:actions
63-
elementCache:elementCache
64-
error:error]) {
65-
return NO;
66-
}
67-
[self fb_waitUntilStableWithTimeout:FBConfiguration.animationCoolOffTimeout];
68-
return YES;
69-
}
70-
7156
- (BOOL)fb_performW3CActions:(NSArray *)actions
7257
elementCache:(FBElementCache *)elementCache
7358
error:(NSError **)error

WebDriverAgentLib/Commands/FBTouchActionCommands.m

-13
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,12 @@ + (NSArray *)routes
2222
{
2323
return
2424
@[
25-
[[FBRoute POST:@"/wda/touch/perform"] respondWithTarget:self action:@selector(handlePerformAppiumTouchActions:)],
26-
[[FBRoute POST:@"/wda/touch/multi/perform"] respondWithTarget:self action:@selector(handlePerformAppiumTouchActions:)],
2725
[[FBRoute POST:@"/actions"] respondWithTarget:self action:@selector(handlePerformW3CTouchActions:)],
2826
];
2927
}
3028

3129
#pragma mark - Commands
3230

33-
+ (id<FBResponsePayload>)handlePerformAppiumTouchActions:(FBRouteRequest *)request
34-
{
35-
XCUIApplication *application = request.session.activeApplication;
36-
NSArray *actions = (NSArray *)request.arguments[@"actions"];
37-
NSError *error;
38-
if (![application fb_performAppiumTouchActions:actions elementCache:request.session.elementCache error:&error]) {
39-
return FBResponseWithUnknownError(error);
40-
}
41-
return FBResponseWithOK();
42-
}
43-
4431
+ (id<FBResponsePayload>)handlePerformW3CTouchActions:(FBRouteRequest *)request
4532
{
4633
XCUIApplication *application = request.session.activeApplication;

WebDriverAgentLib/Utilities/FBAppiumActionsSynthesizer.h

-20
This file was deleted.

0 commit comments

Comments
 (0)