Skip to content

Commit

Permalink
Merge pull request #59 from appium/master
Browse files Browse the repository at this point in the history
Fork Sync: Update from parent repository
  • Loading branch information
github-actions[bot] authored Feb 13, 2024
2 parents 95bfcb9 + 77aeef7 commit 278fb60
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 1,270 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## [7.0.0](https://github.com/appium/WebDriverAgent/compare/v6.1.1...v7.0.0) (2024-02-12)


### ⚠ BREAKING CHANGES

* The following REST endpoints have been removed, use W3C actions instead:
- /wda/touch/perform
- /wda/touch/multi/perform

### Features

* Remove obsolete MJSONWP touch actions ([#847](https://github.com/appium/WebDriverAgent/issues/847)) ([d77f640](https://github.com/appium/WebDriverAgent/commit/d77f640867155fddbbbc9575f0a77802602865e7))

## [6.1.1](https://github.com/appium/WebDriverAgent/compare/v6.1.0...v6.1.1) (2024-02-11)


Expand Down
20 changes: 0 additions & 20 deletions WebDriverAgent.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

37 changes: 0 additions & 37 deletions WebDriverAgentLib/Categories/XCUIApplication+FBTouchAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,43 +15,6 @@ NS_ASSUME_NONNULL_BEGIN

@interface XCUIApplication (FBTouchAction)

/**
Perform complex touch action in scope of the current application.
Touch actions are represented as lists of dictionaries with predefined sets of values and keys.
Each dictionary must contain 'action' key, which is one of the following:
- 'tap' to perform a single tap
- 'longPress' to perform long tap
- 'press' to perform press
- 'release' to release the finger
- 'moveTo' to move the virtual finger
- 'wait' to modify the duration of the preceeding action
- 'cancel' to cancel the preceeding action in the chain
Each dictionary can also contain 'options' key with additional parameters dictionary related to the appropriate action.
The following options are mandatory for 'tap', 'longPress', 'press' and 'moveTo' actions:
- 'x' the X coordinate of the action
- 'y' the Y coordinate of the action
- 'element' the corresponding element instance, for which the action is going to be performed
If only 'element' is set then hit point coordinates of this element will be used.
If only 'x' and 'y' are set then these will be considered as absolute coordinates.
If both 'element' and 'x'/'y' are set then these will act as relative element coordinates.
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.
The following additional options are available for different actions:
- 'tap': 'count' (defines count of taps to be performed in a row; 1 by default)
- 'longPress': 'duration' (number of milliseconds to hold/move the virtual finger; 500.0 ms by default)
- 'wait': 'ms' (number of milliseconds to wait for the preceeding action; 0.0 ms by default)
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.
@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.
@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
@param error If there is an error, upon return contains an NSError object that describes the problem
@return YES If the touch action has been successfully performed without errors
*/
- (BOOL)fb_performAppiumTouchActions:(NSArray *)actions elementCache:(nullable FBElementCache *)elementCache error:(NSError * _Nullable*)error;

/**
Perform complex touch action in scope of the current application.
Expand Down
15 changes: 0 additions & 15 deletions WebDriverAgentLib/Categories/XCUIApplication+FBTouchAction.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#import "XCUIApplication+FBTouchAction.h"

#import "FBAppiumActionsSynthesizer.h"
#import "FBBaseActionsSynthesizer.h"
#import "FBConfiguration.h"
#import "FBExceptions.h"
Expand Down Expand Up @@ -54,20 +53,6 @@ - (BOOL)fb_performActionsWithSynthesizerType:(Class)synthesizerType
return [self fb_synthesizeEvent:eventRecord error:error];
}

- (BOOL)fb_performAppiumTouchActions:(NSArray *)actions
elementCache:(FBElementCache *)elementCache
error:(NSError **)error
{
if (![self fb_performActionsWithSynthesizerType:FBAppiumActionsSynthesizer.class
actions:actions
elementCache:elementCache
error:error]) {
return NO;
}
[self fb_waitUntilStableWithTimeout:FBConfiguration.animationCoolOffTimeout];
return YES;
}

- (BOOL)fb_performW3CActions:(NSArray *)actions
elementCache:(FBElementCache *)elementCache
error:(NSError **)error
Expand Down
13 changes: 0 additions & 13 deletions WebDriverAgentLib/Commands/FBTouchActionCommands.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,12 @@ + (NSArray *)routes
{
return
@[
[[FBRoute POST:@"/wda/touch/perform"] respondWithTarget:self action:@selector(handlePerformAppiumTouchActions:)],
[[FBRoute POST:@"/wda/touch/multi/perform"] respondWithTarget:self action:@selector(handlePerformAppiumTouchActions:)],
[[FBRoute POST:@"/actions"] respondWithTarget:self action:@selector(handlePerformW3CTouchActions:)],
];
}

#pragma mark - Commands

+ (id<FBResponsePayload>)handlePerformAppiumTouchActions:(FBRouteRequest *)request
{
XCUIApplication *application = request.session.activeApplication;
NSArray *actions = (NSArray *)request.arguments[@"actions"];
NSError *error;
if (![application fb_performAppiumTouchActions:actions elementCache:request.session.elementCache error:&error]) {
return FBResponseWithUnknownError(error);
}
return FBResponseWithOK();
}

+ (id<FBResponsePayload>)handlePerformW3CTouchActions:(FBRouteRequest *)request
{
XCUIApplication *application = request.session.activeApplication;
Expand Down
20 changes: 0 additions & 20 deletions WebDriverAgentLib/Utilities/FBAppiumActionsSynthesizer.h

This file was deleted.

Loading

0 comments on commit 278fb60

Please sign in to comment.