diff --git a/WebDriverAgentLib/Commands/FBElementCommands.m b/WebDriverAgentLib/Commands/FBElementCommands.m index a554c5854..b17a1621c 100644 --- a/WebDriverAgentLib/Commands/FBElementCommands.m +++ b/WebDriverAgentLib/Commands/FBElementCommands.m @@ -73,6 +73,7 @@ + (NSArray *)routes #else [[FBRoute POST:@"/wda/element/:uuid/swipe"] respondWithTarget:self action:@selector(handleSwipe:)], [[FBRoute POST:@"/wda/element/:uuid/pinch"] respondWithTarget:self action:@selector(handlePinch:)], + [[FBRoute POST:@"/wda/element/:uuid/rotate"] respondWithTarget:self action:@selector(handleRotate:)], [[FBRoute POST:@"/wda/element/:uuid/doubleTap"] respondWithTarget:self action:@selector(handleDoubleTap:)], [[FBRoute POST:@"/wda/element/:uuid/twoFingerTap"] respondWithTarget:self action:@selector(handleTwoFingerTap:)], [[FBRoute POST:@"/wda/element/:uuid/touchAndHold"] respondWithTarget:self action:@selector(handleTouchAndHold:)], @@ -488,6 +489,20 @@ + (NSArray *)routes [element pinchWithScale:scale velocity:velocity]; return FBResponseWithOK(); } + ++ (id)handleRotate:(FBRouteRequest *)request +{ + FBElementCache *elementCache = request.session.elementCache; + XCUIElement *element = [elementCache elementForUUID:request.parameters[@"uuid"]]; + if (nil == element) { + return FBResponseWithStatus([FBCommandStatus staleElementReferenceErrorWithMessage:nil + traceback:nil]); + } + CGFloat rotation = (CGFloat)[request.arguments[@"rotation"] doubleValue]; + CGFloat velocity = (CGFloat)[request.arguments[@"velocity"] doubleValue]; + [element rotate:rotation withVelocity:velocity]; + return FBResponseWithOK(); +} #endif + (id)handleForceTouch:(FBRouteRequest *)request