Best EarlGrey code snippet using performAction.grey_swipeSlowInDirection
GestureTest.m
Source:GestureTest.m  
...182      performAction:grey_swipeFastInDirection(kGREYDirectionUp)];183  [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"gesture")]184      assertWithMatcher:grey_text(@"swipe up")];185  [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"Grey Box")]186      performAction:grey_swipeSlowInDirection(kGREYDirectionDown)];187  [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"gesture")]188      assertWithMatcher:grey_text(@"swipe down")];189  [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"Grey Box")]190      performAction:grey_swipeFastInDirection(kGREYDirectionLeft)];191  [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"gesture")]192      assertWithMatcher:grey_text(@"swipe left")];193  [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"Grey Box")]194      performAction:grey_swipeSlowInDirection(kGREYDirectionRight)];195  [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"gesture")]196      assertWithMatcher:grey_text(@"swipe right")];197}198// Asserts that Pinch works in all directions by verifying if the pinch gestures are correctly199// recognized.200- (void)ftr_assertPinchWorksInAllDirections {201  [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"Grey Box")]202      performAction:grey_pinchFastInDirectionAndAngle(kGREYPinchDirectionOutward,203                                                      kGREYPinchAngleDefault)];204  [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"gesture")]205      assertWithMatcher:grey_text(@"pinch out")];206  [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"Grey Box")]207      performAction:grey_pinchSlowInDirectionAndAngle(kGREYPinchDirectionInward,208                                                      kGREYPinchAngleDefault)];...FTRGestureTest.m
Source:FTRGestureTest.m  
...172  [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"Grey Box")]173      performAction:grey_swipeFastInDirection(kGREYDirectionUp)];174  [self grey_assertGestureRecognized:@"swipe up"];175  [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"Grey Box")]176      performAction:grey_swipeSlowInDirection(kGREYDirectionDown)];177  [self grey_assertGestureRecognized:@"swipe down"];178  [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"Grey Box")]179      performAction:grey_swipeFastInDirection(kGREYDirectionLeft)];180  [self grey_assertGestureRecognized:@"swipe left"];181  [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"Grey Box")]182      performAction:grey_swipeSlowInDirection(kGREYDirectionRight)];183  [self grey_assertGestureRecognized:@"swipe right"];184}185@end...UITableViewTest.m
Source:UITableViewTest.m  
...27      grey_allOf(grey_accessibilityLabel(@"Delete"), grey_kindOfClass([UIButton class]), nil);28  for (int i = 0; i < 5; i++) {29    NSString *labelForRowToDelete = [NSString stringWithFormat:@"Row %d", i];30    [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(labelForRowToDelete)]31        performAction:grey_swipeSlowInDirection(kGREYDirectionLeft)];32    [[EarlGrey selectElementWithMatcher:deleteRowMatcher] performAction:grey_tap()];33    [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(labelForRowToDelete)]34        assertWithMatcher:grey_notVisible()];35  }36}37/** Tests the visibility of a table view cell when the above cell is in delete mode. */38- (void)testVisibilityOfTheBelowRowInDeleteMode {39  for (int i = 0; i < 5; i++) {40    NSString *labelForRowToDelete = [NSString stringWithFormat:@"Row %d", i];41    NSString *labelForNextRow = [NSString stringWithFormat:@"Row %d", i + 1];42    [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(labelForRowToDelete)]43        performAction:grey_swipeSlowInDirection(kGREYDirectionLeft)];44    [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(labelForNextRow)]45        assertWithMatcher:grey_sufficientlyVisible()];46  }47}48- (void)testSearchActionWithTinyScrollIncrements {49  [[self ftr_scrollToCellAtIndex:18 byScrollingInAmounts:5050                     InDirection:kGREYDirectionDown] assertWithMatcher:grey_notNil()];51  [[self ftr_scrollToCellAtIndex:0 byScrollingInAmounts:5052                     InDirection:kGREYDirectionUp] assertWithMatcher:grey_notNil()];53  [[self ftr_scrollToCellAtIndex:18 byScrollingInAmounts:5054                     InDirection:kGREYDirectionDown] assertWithMatcher:grey_notNil()];55}56- (void)testSearchActionWithLargeScrollIncrements {57  [[self ftr_scrollToCellAtIndex:20 byScrollingInAmounts:20058                     InDirection:kGREYDirectionDown] assertWithMatcher:grey_notNil()];59  [[self ftr_scrollToCellAtIndex:0 byScrollingInAmounts:20060                     InDirection:kGREYDirectionUp] assertWithMatcher:grey_notNil()];61  [[self ftr_scrollToCellAtIndex:20 byScrollingInAmounts:20062                     InDirection:kGREYDirectionDown] assertWithMatcher:grey_notNil()];63}64- (void)testScrollToTop {65  // Scroll down.66  [[self ftr_scrollToCellAtIndex:20 byScrollingInAmounts:20067                     InDirection:kGREYDirectionDown] assertWithMatcher:grey_notNil()];68  // Scroll to top and verify that we are at the top.69  [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"main_table_view")]70      performAction:grey_scrollToContentEdge(kGREYContentEdgeTop)]71      assertWithMatcher:grey_scrolledToContentEdge(kGREYContentEdgeTop)];72}73- (void)testScrollToTopWithPositiveInsets {74  // Add positive insets using this format {top,left,bottom,right}75  [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"insets value")]76      performAction:grey_typeText(@"{100,0,0,0}\n")];77  [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"insets toggle")]78      performAction:grey_turnSwitchOn(YES)];79  // Scroll down.80  [[self ftr_scrollToCellAtIndex:20 byScrollingInAmounts:20081                     InDirection:kGREYDirectionDown] assertWithMatcher:grey_notNil()];82  // Scroll to top and verify that we are at the top.83  [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"main_table_view")]84      performAction:grey_scrollToContentEdge(kGREYContentEdgeTop)]85      assertWithMatcher:grey_scrolledToContentEdge(kGREYContentEdgeTop)];86}87- (void)testScrollToTopWithNegativeInsets {88  // Add negative insets using this format {top,left,bottom,right}89  [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"insets value")]90      performAction:grey_typeText(@"{-100,0,0,0}\n")];91  [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"insets toggle")]92      performAction:grey_turnSwitchOn(YES)];93  // Scroll down.94  [[self ftr_scrollToCellAtIndex:20 byScrollingInAmounts:20095                     InDirection:kGREYDirectionDown] assertWithMatcher:grey_notNil()];96  // Scroll to top and verify that we are at the top.97  [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"main_table_view")]98      performAction:grey_scrollToContentEdge(kGREYContentEdgeTop)]99      assertWithMatcher:grey_scrolledToContentEdge(kGREYContentEdgeTop)];100}101- (void)testScrollToTopWhenAlreadyAtTheTopWithoutBounce {102  id<GREYAction> bounceOff =103      [GREYHostApplicationDistantObject.sharedInstance actionForTableViewBoundOff];104  // Verify this test with and without bounce enabled by toggling it.105  [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"main_table_view")]106      performAction:bounceOff];107  [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"main_table_view")]108      performAction:grey_scrollToContentEdge(kGREYContentEdgeTop)];109  // Verify that top most cell is visible.110  [[EarlGrey selectElementWithMatcher:[self ftr_matcherForCellAtIndex:0]]111      assertWithMatcher:grey_sufficientlyVisible()];112}113- (void)testScrollToTopWhenAlreadyAtTheTopWithBounce {114  [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"main_table_view")]115      performAction:grey_scrollToContentEdge(kGREYContentEdgeTop)];116  // Verify that top most cell is visible.117  [[EarlGrey selectElementWithMatcher:[self ftr_matcherForCellAtIndex:0]]118      assertWithMatcher:grey_sufficientlyVisible()];119}120- (void)testTableViewVisibleWhenScrolled {121  [[[[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"main_table_view")]122      assertWithMatcher:grey_sufficientlyVisible()]123      performAction:grey_swipeFastInDirection(kGREYDirectionUp)]124      performAction:grey_swipeFastInDirection(kGREYDirectionUp)]125      assertWithMatcher:grey_sufficientlyVisible()];126}127- (void)testFrameworkSynchronizesWithScrolling {128  id<GREYMatcher> notScrollingMatcher =129      [GREYHostApplicationDistantObject.sharedInstance matcherForNotScrolling];130  [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"main_table_view")]131      performAction:grey_swipeSlowInDirection(kGREYDirectionDown)]132      assertWithMatcher:notScrollingMatcher];133  [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"Row 1")]134      assertWithMatcher:grey_sufficientlyVisible()];135}136#pragma mark - Private137- (id<GREYMatcher>)ftr_matcherForCellAtIndex:(NSInteger)index {138  return grey_accessibilityLabel([NSString stringWithFormat:@"Row %d", (int)index]);139}140- (GREYElementInteraction *)ftr_scrollToCellAtIndex:(NSInteger)index141                               byScrollingInAmounts:(CGFloat)amount142                                        InDirection:(GREYDirection)direction {143  id<GREYMatcher> matcher =144      grey_allOf([self ftr_matcherForCellAtIndex:index], grey_interactable(), nil);145  return [[EarlGrey selectElementWithMatcher:matcher]...FTRUITableViewTest.m
Source:FTRUITableViewTest.m  
...27      grey_allOf(grey_accessibilityLabel(@"Delete"), grey_kindOfClass([UIButton class]), nil);28  for (int i = 0; i < 5; i++) {29    NSString *labelForRowToDelete = [NSString stringWithFormat:@"Row %d", i];30    [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(labelForRowToDelete)]31        performAction:grey_swipeSlowInDirection(kGREYDirectionLeft)];32    [[EarlGrey selectElementWithMatcher:deleteRowMatcher] performAction:grey_tap()];33    [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(labelForRowToDelete)]34        assertWithMatcher:grey_notVisible()];35  }36}37- (void)testSearchActionWithTinyScrollIncrements {38  [[self ftr_scrollToCellAtIndex:18 byScrollingInAmounts:5039                     InDirection:kGREYDirectionDown] assertWithMatcher:grey_notNil()];40  [[self ftr_scrollToCellAtIndex:0 byScrollingInAmounts:50 InDirection:kGREYDirectionUp]41      assertWithMatcher:grey_notNil()];42  [[self ftr_scrollToCellAtIndex:18 byScrollingInAmounts:5043                     InDirection:kGREYDirectionDown] assertWithMatcher:grey_notNil()];44}45- (void)testSearchActionWithLargeScrollIncrements {46  [[self ftr_scrollToCellAtIndex:20 byScrollingInAmounts:200 InDirection:kGREYDirectionDown]47      assertWithMatcher:grey_notNil()];48  [[self ftr_scrollToCellAtIndex:0 byScrollingInAmounts:200 InDirection:kGREYDirectionUp]49      assertWithMatcher:grey_notNil()];50  [[self ftr_scrollToCellAtIndex:20 byScrollingInAmounts:200 InDirection:kGREYDirectionDown]51      assertWithMatcher:grey_notNil()];52}53- (void)testScrollToTop {54  // Scroll down.55  [[self ftr_scrollToCellAtIndex:20 byScrollingInAmounts:200 InDirection:kGREYDirectionDown]56      assertWithMatcher:grey_notNil()];57  // Scroll to top and verify that we are at the top.58  [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"main_table_view")]59      performAction:grey_scrollToContentEdge(kGREYContentEdgeTop)]60      assertWithMatcher:grey_scrolledToContentEdge(kGREYContentEdgeTop)];61}62- (void)testScrollToTopWithPositiveInsets {63  // Add positive insets using this format {top,left,bottom,right}64  [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"insets value")]65      performAction:grey_typeText(@"{100,0,0,0}\n")];66  [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"insets toggle")]67      performAction:grey_turnSwitchOn(YES)];68  // Scroll down.69  [[self ftr_scrollToCellAtIndex:20 byScrollingInAmounts:200 InDirection:kGREYDirectionDown]70      assertWithMatcher:grey_notNil()];71  // Scroll to top and verify that we are at the top.72  [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"main_table_view")]73      performAction:grey_scrollToContentEdge(kGREYContentEdgeTop)]74      assertWithMatcher:grey_scrolledToContentEdge(kGREYContentEdgeTop)];75}76- (void)testScrollToTopWithNegativeInsets {77  // Add negative insets using this format {top,left,bottom,right}78  [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"insets value")]79      performAction:grey_typeText(@"{-100,0,0,0}\n")];80  [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"insets toggle")]81      performAction:grey_turnSwitchOn(YES)];82  // Scroll down.83  [[self ftr_scrollToCellAtIndex:20 byScrollingInAmounts:200 InDirection:kGREYDirectionDown]84      assertWithMatcher:grey_notNil()];85  // Scroll to top and verify that we are at the top.86  [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"main_table_view")]87      performAction:grey_scrollToContentEdge(kGREYContentEdgeTop)]88      assertWithMatcher:grey_scrolledToContentEdge(kGREYContentEdgeTop)];89}90- (void)testScrollToTopWhenAlreadyAtTheTopWithoutBounce {91  id<GREYAction> bounceOff =92      [GREYHostApplicationDistantObject.sharedInstance actionForTableViewBoundOff];93  // Verify this test with and without bounce enabled by toggling it.94  [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"main_table_view")]95      performAction:bounceOff];96  [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"main_table_view")]97      performAction:grey_scrollToContentEdge(kGREYContentEdgeTop)];98  // Verify that top most cell is visible.99  [[EarlGrey selectElementWithMatcher:[self ftr_matcherForCellAtIndex:0]]100      assertWithMatcher:grey_sufficientlyVisible()];101}102- (void)testScrollToTopWhenAlreadyAtTheTopWithBounce {103  [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"main_table_view")]104      performAction:grey_scrollToContentEdge(kGREYContentEdgeTop)];105  // Verify that top most cell is visible.106  [[EarlGrey selectElementWithMatcher:[self ftr_matcherForCellAtIndex:0]]107      assertWithMatcher:grey_sufficientlyVisible()];108}109- (void)testTableViewVisibleWhenScrolled {110  [[[[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"main_table_view")]111      assertWithMatcher:grey_sufficientlyVisible()]112      performAction:grey_swipeFastInDirection(kGREYDirectionUp)]113      performAction:grey_swipeFastInDirection(kGREYDirectionUp)]114      assertWithMatcher:grey_sufficientlyVisible()];115}116- (void)testFrameworkSynchronizesWithScrolling {117  id<GREYMatcher> notScrollingMatcher =118      [GREYHostApplicationDistantObject.sharedInstance matcherForNotScrolling];119  [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"main_table_view")]120      performAction:grey_swipeSlowInDirection(kGREYDirectionDown)]121      assertWithMatcher:notScrollingMatcher];122  [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"Row 1")]123      assertWithMatcher:grey_sufficientlyVisible()];124}125#pragma mark - Private126- (id<GREYMatcher>)ftr_matcherForCellAtIndex:(NSInteger)index {127  return grey_accessibilityLabel([NSString stringWithFormat:@"Row %d", (int)index]);128}129- (GREYElementInteraction *)ftr_scrollToCellAtIndex:(NSInteger)index130                               byScrollingInAmounts:(CGFloat)amount131                                        InDirection:(GREYDirection)direction {132  id<GREYMatcher> matcher =133      grey_allOf([self ftr_matcherForCellAtIndex:index], grey_interactable(), nil);134  return [[EarlGrey selectElementWithMatcher:matcher]...movies_Tests.m
Source:movies_Tests.m  
...33}34//- (void)test_ScrollMarqueeToTop {35//	36//  [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(AXLABEL_marqueeTableView)]37//      performAction:grey_swipeSlowInDirection(kGREYDirectionUp)];38//}39//40//- (void)test_ScrollMarqueeToBottom {41//  [[EarlGrey selectElementWithMatcher:grey_accessibilityID(AXLABEL_marqueeTableView)]42//      performAction:grey_swipeSlowInDirection(kGREYDirectionDown)];43//}44@end...grey_swipeSlowInDirection
Using AI Code Generation
1[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"button1")] performAction:grey_swipeSlowInDirection(kGREYDirectionRight, 1000)];2[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"button1")] performAction:grey_swipeFastInDirection(kGREYDirectionRight, 1000)];3GREYActionBlock* swipeSlowInDirection = grey_swipeSlowInDirection(kGREYDirectionRight, 1000);4GREYActionBlock* swipeFastInDirection = grey_swipeFastInDirection(kGREYDirectionRight, 1000);5GREYActionBlock* grey_swipeSlowInDirection(GREYDirection direction, CGFloat duration) {6  return [GREYActionBlock actionWithName:[NSString stringWithFormat:@"SwipeSlowInDirection(%@, %f)", NSStringFromGREYDirection(direction), duration] performBlock:^BOOL (id element, NSError *__strong *errorOrNil) {7    return [GREYActions grey_swipeSlowInDirection:direction duration:duration error:errorOrNil];8  }];9}10GREYActionBlock* grey_swipeFastInDirection(GREYDirection direction, CGFloat duration) {11  return [GREYActionBlock actionWithName:[NSString stringWithFormat:@"SwipeFastInDirection(%@, %f)", NSStringFromGREYDirection(direction), duration] performBlock:^BOOL (id element, NSError *__strong *errorOrNil) {12    return [GREYActions grey_swipeFastInDirection:direction duration:duration error:errorOrNil];13  }];14}15+ (BOOL)grey_swipeSlowInDirection:(GREYDirection)direction duration:(CGFloat)duration error:(__strong NSError **)error {16  return [GREYActions grey_swipeSlowInDirection:direction duration:duration startPointPercentage:grey_centerPoint() error:error];17}grey_swipeSlowInDirection
Using AI Code Generation
1block:^BOOL (id element, NSError *__strong *errorOrNil) {2error:errorOrNil];3}];4[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"swipeMe")]5performAction:swipeAction];6+ (id<GREYAction>)grey_swipeSlowInDirection:(GREYDirection)direction7forDuration:(CFTimeInterval)duration8error:(__strong NSError **)errorOrNil {9GREYFatalAssertMainThread();10GREYFatalAssertWithError(errorOrNil, @"Error must not be null!");11GREYFatalAssertWithMessage(direction != kGREYDirectionNone,12@"Cannot swipe in kGREYDirectionNone");13GREYFatalAssertWithMessage(duration > 0, @"Duration must be greater than 0");14CGPoint startPoint, endPoint;15GREYGetStartPointForSwipeInDirection(direction, &startPoint);16GREYGetEndPointForSwipeInDirection(direction, &endPoint);17GREYScrollInDirection(direction, duration);18block:^BOOL (id element, NSError *__strong *errorOrNil) {19return grey_swipeFastInDirection(element,20errorOrNil);21}];22}23+ (id<GREYAction>)grey_swipeFastInDirection:(GREYDirection)direction24forDuration:(CFTimeInterval)duration25error:(__strong NSError **)errorOrNil {26GREYFatalAssertMainThread();27GREYFatalAssertWithError(errorOrNil, @"Error must not be null!");28GREYFatalAssertWithMessage(direction != kGREYDirectionNone,29@"Cannot swipe in kGREYDirectionNone");30GREYFatalAssertWithMessage(duration > 0, @"Duration must be greater than 0");31CGPoint startPoint, endPoint;32GREYGetStartPointForSwipeInDirection(direction, &startPoint);33GREYGetEndPointForSwipeInDirection(direction, &endPoint);34GREYScrollInDirection(direction, duration);35block:^BOOL (id element, NSError *__strong *errorOrNil) {grey_swipeSlowInDirection
Using AI Code Generation
1[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"tableview")]2    performAction:grey_swipeSlowInDirection(kGREYDirectionLeft, 1000)];3+ (id<GREYAction>)grey_swipeSlowInDirection:(GREYDirection)direction4                               forDuration:(CFTimeInterval)duration {5                                     atStartPt:CGPointZero];6}7+ (id<GREYAction>)grey_swipeSlowInDirection:(GREYDirection)direction8                               forDuration:(CFTimeInterval)duration9                                 atStartPt:(CGPoint)startPt {10                                         atStartPt:startPt];11}12- (instancetype)initWithDirection:(GREYDirection)direction13                     forDuration:(CFTimeInterval)duration14                       atStartPt:(CGPoint)startPt {15  NSAssert(direction == kGREYDirectionLeft || direction == kGREYDirectionRight,16           @"Only kGREYDirectionLeft or kGREYDirectionRight is supported.");17                                             GREYStringFromGREYDirection(direction),18                                             duration];19               constraints:grey_respondsToSelector(@selector(accessibilityFrame))];20  if (self) {21    _direction = direction;22    _duration = duration;23    _startPt = startPt;24  }25  return self;26}27- (BOOL)perform:(id)element error:(__strong NSError **)errorOrNil {28  GREYFatalAssertMainThread();29  GREYFatalAssertWithMessage([element conformsToProtocol:@protocol(GREYScrollable)],30                             @"%@ must conform to GREYScrollable", element);31  GREYFatalAssertWithMessage([element isKindOfClass:[UIView class]],32                             @"%@ must be a UIView", element);grey_swipeSlowInDirection
Using AI Code Generation
1[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"tableview")]2    performAction:grey_swipeSlowInDirection(kGREYDirectionLeft, 1000)];3+ (id<GREYAction>)grey_swipeSlowInDirection:(GREYDirection)direction4                               forDuration:(CFTimeInterval)duration {5                                     atStartPt:CGPointZero];6}grey_swipeSlowInDirection
Using AI Code Generation
1    [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"view")] performAction:grey_swipe/lowInDirection(kGREYDirectionLeft, 1000)];2+ (id<GREYAction>)grey_swipeSlowInDirection:(GREYDirection)direction3                               forDuration:(CFTimeInterval)duration4                                 atStartPt:(CGPoint)startPt {5                                         atStartPt:startPt];6}7- (instancetype)initWithDirection:(GREYDirection)direction8                     forDuration:(CFTimeInterval)duration9                       atStartPt:(CGPoint)startPt {10  NSAssert(direction == kGREYDirectionLeft || direction == kGREYDirectionRight,11           @"Only kGREYDirectionLeft or kGREYDirectionRight is supported.");12                                             GREYStringFromGREYDirection(direction),13                                             duration];14               constraints:grey_respondsToSelector(@selector(accessibilityFrame))];15  if (self) {16    _direction = direction;17    _duration = duration;18    _startPt = startPt;19  }20  return self;21}22- (BOOL)perform:(id)element error:(__strong NSError **)errorOrNil {23  GREYFatalAssertMainThread();24  GREYFatalAssertWithMessage([element conformsToProtocol:@protocol(GREYScrollable)],25                             @"%@ must conform to GREYScrollable", element);26  GREYFatalAssertWithMessage([element isKindOfClass:[UIView class]],27                             @"%@ must be a UIView", element);Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!
