How to use grey_text method of selectElementWithMatcher class

Best EarlGrey code snippet using selectElementWithMatcher.grey_text

FTRKeyboardKeysTest.m

Source:FTRKeyboardKeysTest.m Github

copy

Full Screen

...30- (void)testTypingAtBeginning {31 [[[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]32 performAction:[GREYActions actionForTypeText:@"Foo"]]33 performAction:[self grey_actionForTypingText:@"Bar" atPosition:0]]34 assertWithMatcher:grey_text(@"BarFoo")];35}36- (void)testTypingAtEnd {37 [[[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]38 performAction:[GREYActions actionForTypeText:@"Foo"]]39 performAction:[self grey_actionForTypingText:@"Bar" atPosition:-1]]40 assertWithMatcher:grey_text(@"FooBar")];41}42- (void)testTypingInMiddle {43 [[[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]44 performAction:[GREYActions actionForTypeText:@"Foo"]]45 performAction:[self grey_actionForTypingText:@"Bar" atPosition:2]]46 assertWithMatcher:grey_text(@"FoBaro")];47}48- (void)testTypingInMiddleOfBigString {49 [[[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]50 performAction:51 [GREYActions actionForTypeText:@"This string is a little too long for this text field!"]]52 performAction:[self grey_actionForTypingText:@"Foo" atPosition:1]]53 assertWithMatcher:grey_text(@"TFoohis string is a little too long for this text field!")];54}55- (void)testClearAfterTyping {56 [[[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]57 performAction:[GREYActions actionForTypeText:@"Foo"]]58 performAction:[GREYActions actionForClearText]]59 assertWithMatcher:grey_text(@"")];60}61- (void)testClearAfterClearing {62 [[[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]63 performAction:[GREYActions actionForClearText]]64 performAction:[GREYActions actionForClearText]]65 assertWithMatcher:grey_text(@"")];66}67- (void)testClearAndType_TypeShort {68 [[[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]69 performAction:[GREYActions actionForClearText]]70 performAction:[GREYActions actionForTypeText:@"Foo"]]71 assertWithMatcher:grey_text(@"Foo")];72}73- (void)testTypeAfterClearing_ClearThenType {74 [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]75 performAction:[GREYActions actionForTypeText:@"f"]]76 assertWithMatcher:grey_text(@"f")];77 [[[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]78 performAction:[GREYActions actionForClearText]]79 performAction:[GREYActions actionForTypeText:@"g"]]80 assertWithMatcher:grey_text(@"g")];81}82- (void)testTypeAfterClearing_TypeLong {83 [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]84 performAction:[GREYActions actionForTypeText:@"This is a long string"]]85 assertWithMatcher:grey_text(@"This is a long string")];86 [[[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]87 performAction:[GREYActions actionForClearText]]88 performAction:[GREYActions actionForTypeText:@"short string"]]89 assertWithMatcher:grey_text(@"short string")];90}91- (void)testNonTypistKeyboardInteraction {92 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]93 performAction:[GREYActions actionForTap]];94 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"a")]95 performAction:[GREYActions actionForTap]];96 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"b")]97 performAction:[GREYActions actionForTap]];98 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"c")]99 performAction:[GREYActions actionForTap]];100 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"return")]101 performAction:[GREYActions actionForTap]];102}103- (void)testNonTypingTextField {104 [EarlGrey setFailureHandler:[[FTRFailureHandler alloc] init]];105 @try {106 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"NonTypingTextField")]107 performAction:[GREYActions actionForTypeText:@"Should Fail"]];108 XCTFail(@"Should throw an exception");109 } @catch (NSException *exception) {110 NSRange exceptionRange =111 [[exception reason] rangeOfString:@"Action 'Type \"Should Fail\"' failed."];112 XCTAssertTrue(exceptionRange.length > 0, @"Should throw exception indicating action failure.");113 }114}115- (void)testTypingWordsThatTriggerAutoCorrect {116 NSString *string = @"hekp";117 [self typeString:string andVerifyOutput:string];118 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]119 performAction:grey_clearText()];120 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextView")]121 performAction:grey_clearText()];122 string = @"helko";123 [self typeString:string andVerifyOutput:string];124 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]125 performAction:grey_clearText()];126 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextView")]127 performAction:grey_clearText()];128 string = @"balk";129 [self typeString:string andVerifyOutput:string];130 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]131 performAction:grey_clearText()];132 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextView")]133 performAction:grey_clearText()];134 string = @"surr";135 [self typeString:string andVerifyOutput:string];136}137- (void)testNumbersTyping {138 NSString *string = @"1234567890";139 [self typeString:string andVerifyOutput:string];140}141- (void)testSymbolsTyping {142 NSString *string = @"~!@#$%^&*()_+-={}:;<>?";143 [self typeString:string andVerifyOutput:string];144}145- (void)testLetterTyping {146 NSString *string = @"aBc";147 [self typeString:string andVerifyOutput:string];148}149- (void)testEmailTyping {150 NSString *string = @"donec.metus+spam@google.com";151 [self typeString:string andVerifyOutput:string];152}153- (void)testUpperCaseLettersTyping {154 NSString *string = @"VERYLONGTEXTWITHMANYLETTERS";155 [self typeString:string andVerifyOutput:string];156}157- (void)testNumbersAndSpacesTyping {158 NSString *string = @"0 1 2 3 4 5 6 7 8 9";159 [self typeString:string andVerifyOutput:string];160}161- (void)testSymbolsAndSpacesTyping {162 NSString *string = @"[ ] # + = _ < > { }";163 [self typeString:string andVerifyOutput:string];164}165- (void)testSpaceKey {166 NSString *string = @"a b";167 [self typeString:string andVerifyOutput:string];168}169- (void)testBackspaceKey {170 NSString *string = @"ab\b";171 NSString *verificationString = @"a";172 [self typeString:string andVerifyOutput:verificationString];173}174- (void)testReturnKey {175 Class kbViewClass = NSClassFromString(@"UIKeyboardImpl");176 NSString *textFieldString = @"and\n";177 [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]178 performAction:grey_typeText(textFieldString)]179 assertWithMatcher:grey_text(@"and")];180 [[EarlGrey selectElementWithMatcher:grey_kindOfClass(kbViewClass)] assertWithMatcher:grey_nil()];181 NSString *string = @"and\nand";182 [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextView")]183 performAction:grey_typeText(string)]184 assertWithMatcher:grey_text(@"and\nand")];185 [[EarlGrey selectElementWithMatcher:grey_kindOfClass(kbViewClass)]186 assertWithMatcher:grey_notNil()];187}188- (void)testAllReturnKeyTypes {189 Class kbViewClass = NSClassFromString(@"UIKeyboardImpl");190 // There are 11 returnKeyTypes; test all of them.191 for (int i = 0; i < 11; i++) {192 [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]193 performAction:grey_typeText(@"a\n")]194 assertWithMatcher:grey_text(@"a")];195 [[EarlGrey selectElementWithMatcher:grey_kindOfClass(kbViewClass)]196 assertWithMatcher:grey_nil()];197 [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]198 performAction:grey_typeText(@"*\n")]199 assertWithMatcher:grey_text(@"a*")];200 [[EarlGrey selectElementWithMatcher:grey_kindOfClass(kbViewClass)]201 assertWithMatcher:grey_nil()];202 [[EarlGrey selectElementWithMatcher:grey_buttonTitle(@"next returnKeyType")]203 performAction:grey_tap()];204 }205}206- (void)testPanelNavigation {207 NSString *string = @"a1a%a%1%";208 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]209 performAction:grey_typeText(string)];210}211- (void)typeString:(NSString *)string andVerifyOutput:(NSString *)verificationString {212 [[[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]213 performAction:grey_typeText(string)]214 performAction:grey_typeText(@"\n")]215 assertWithMatcher:grey_text(verificationString)];216 [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextView")]217 performAction:grey_typeText(string)]218 assertWithMatcher:grey_text(verificationString)];219 [[EarlGrey selectElementWithMatcher:grey_buttonTitle(@"Done")]220 performAction:grey_tap()];221}222- (void)testKeyplaneIsDetectedCorrectlyWhenSwitchingTextFields {223 NSString *string = @"$";224 [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]225 performAction:grey_typeText(string)]226 assertWithMatcher:grey_text(string)];227 [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextView")]228 performAction:grey_typeText(string)]229 assertWithMatcher:grey_text(string)];230}231- (void)testUIKeyboardTypeDefault {232 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"KeyboardPicker")]233 performAction:[GREYActions actionForSetPickerColumn:0 toValue:@"Default"]];234 NSString *string = @":$a8. {T<b@CC";235 [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]236 performAction:grey_typeText(string)]237 assertWithMatcher:grey_text(string)];238}239- (void)testUIKeyboardTypeASCIICapable {240 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"KeyboardPicker")]241 performAction:[GREYActions actionForSetPickerColumn:0 toValue:@"ASCIICapable"]];242 NSString *string = @":$a8. {T<b@CC";243 [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]244 performAction:grey_typeText(string)]245 assertWithMatcher:grey_text(string)];246}247- (void)testUIKeyboardTypeNumbersAndPunctuation {248 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"KeyboardPicker")]249 performAction:[GREYActions actionForSetPickerColumn:0 toValue:@"NumbersAndPunctuation"]];250 NSString *string = @":$a8. {T<b@CC";251 [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]252 performAction:grey_typeText(string)]253 assertWithMatcher:grey_text(string)];254}255- (void)testUIKeyboardTypeURL {256 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"KeyboardPicker")]257 performAction:[GREYActions actionForSetPickerColumn:0 toValue:@"URL"]];258 NSString *string = @"http://www.google.com/@*s$&T+t?[]#testLabel%foo;";259 [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]260 performAction:grey_typeText(string)]261 assertWithMatcher:grey_text(string)];262}263- (void)testUIKeyboardTypeNumberPad {264 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"KeyboardPicker")]265 performAction:[GREYActions actionForSetPickerColumn:0 toValue:@"NumberPad"]];266 NSString *string = @"\b0123456\b789\b\b";267 NSString *verificationString = @"0123457";268 [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]269 performAction:grey_typeText(string)]270 assertWithMatcher:grey_text(verificationString)];271}272- (void)testUIKeyboardTypePhonePad {273 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"KeyboardPicker")]274 performAction:[GREYActions actionForSetPickerColumn:0 toValue:@"PhonePad"]];275 NSString *string = @"01*23\b\b+45#67,89;";276 NSString *verificationString = @"01*+45#67,89;";277 [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]278 performAction:grey_typeText(string)]279 assertWithMatcher:grey_text(verificationString)];280}281- (void)testUIKeyboardTypeEmailAddress {282 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"KeyboardPicker")]283 performAction:[GREYActions actionForSetPickerColumn:0 toValue:@"EmailAddress"]];284 NSString *string = @"l0rem.ipsum+42@google.com#$_T*-";285 [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]286 performAction:grey_typeText(string)]287 assertWithMatcher:grey_text(string)];288}289- (void)testUIKeyboardTypeDecimalPad {290 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"KeyboardPicker")]291 performAction:[GREYActions actionForSetPickerColumn:0 toValue:@"DecimalPad"]];292 NSString *string = @"\b0123.456\b78..9\b\b";293 NSString *verificationString = @"0123.4578.";294 [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]295 performAction:grey_typeText(string)]296 assertWithMatcher:grey_text(verificationString)];297}298- (void)testUIKeyboardTypeTwitter {299 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"KeyboardPicker")]300 performAction:[GREYActions actionForSetPickerColumn:0 toValue:@"Twitter"]];301 NSString *string = @"@earlgrey Your framework is #awesome!!!1$:,eG%g\n";302 NSString *verificationString = @"@earlgrey Your framework is #awesome!!!1$:,eG%g";303 [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]304 performAction:grey_typeText(string)]305 assertWithMatcher:grey_text(verificationString)];306}307- (void)testUIKeyboardTypeWebSearch {308 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"KeyboardPicker")]309 performAction:[GREYActions actionForSetPickerColumn:0 toValue:@"WebSearch"]];310 NSString *string = @":$a8. {T<b@CC";311 [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]312 performAction:grey_typeText(string)]313 assertWithMatcher:grey_text(string)];314}315- (void)testTypingOnLandscapeLeft {316 [EarlGrey rotateDeviceToOrientation:UIDeviceOrientationLandscapeLeft errorOrNil:nil];317 [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]318 performAction:grey_typeText(@"Cat")]319 assertWithMatcher:grey_text(@"Cat")];320}321- (void)testTypingOnLandscapeRight {322 [EarlGrey rotateDeviceToOrientation:UIDeviceOrientationLandscapeRight errorOrNil:nil];323 [[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]324 performAction:grey_typeText(@"Cat")]325 assertWithMatcher:grey_text(@"Cat")];326}327- (void)testTogglingShiftByChangingCase {328 NSString *multiCaseString = @"aA1a1A1aA1AaAa1A1a";329 id<GREYAction> action =330 [GREYActionBlock actionWithName:@"ToggleShift"331 performBlock:^(id element, __strong NSError **errorOrNil) {332 NSArray *shiftAXLabels = @[@"shift", @"more, symbols"];333 for (NSString *axLabel in shiftAXLabels) {334 NSError *error;335 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(axLabel)]336 performAction:grey_tap()337 error:&error];338 }339 return YES;340 }];341 for (NSUInteger i = 0; i < multiCaseString.length; i++) {342 NSString *currentCharacter = [multiCaseString substringWithRange:NSMakeRange(i, 1)];343 [[[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]344 performAction:grey_typeText(currentCharacter)]345 performAction:action]346 assertWithMatcher:grey_text([multiCaseString substringToIndex:i + 1])];347 }348 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"TypingTextField")]349 assertWithMatcher:grey_text(multiCaseString)];350}351#pragma mark - Private352// Helper action that converts numeric position to UITextPosition.353- (id<GREYAction>)grey_actionForTypingText:(NSString *)text atPosition:(NSInteger)position {354 NSString *actionName =355 [NSString stringWithFormat:@"Test type \"%@\" at position %ld", text, (long)position];356 return [GREYActionBlock actionWithName:actionName357 constraints:grey_not(grey_systemAlertViewShown())358 performBlock:^BOOL (id element, __strong NSError **errorOrNil) {359 if ([element conformsToProtocol:@protocol(UITextInput)]) {360 UITextPosition *textPosition;361 if (position >= 0) {362 textPosition = [element positionFromPosition:[element beginningOfDocument]363 offset:position];...

Full Screen

Full Screen

FirebaseAuthEarlGreyTests.m

Source:FirebaseAuthEarlGreyTests.m Github

copy

Full Screen

...61 * --networkReplayMode=(replay|record|disabled|observe)62 */63- (void)testSignInExistingUser {64 NSString *email = @"123@abc.com";65 [[[EarlGrey selectElementWithMatcher:grey_allOf(grey_text(@"Sign in with Email/Password"),66 grey_sufficientlyVisible(), nil)]67 usingSearchAction:grey_scrollInDirection(kGREYDirectionDown, kShortScrollDistance)68 onElementWithMatcher:grey_allOf(grey_scrollView(), grey_kindOfClass([UITableView class]),69 nil)] performAction:grey_tap()];70 id<GREYMatcher> comfirmationButtonMatcher =71 grey_allOf(grey_kindOfClass([UILabel class]), grey_accessibilityLabel(@"OK"), nil);72 [[EarlGrey selectElementWithMatcher:73 #warning TODO Add accessibilityIdentifiers for the elements.74 grey_kindOfClass(NSClassFromString(@"_UIAlertControllerView"))]75 performAction:grey_typeText(email)];76 [[EarlGrey selectElementWithMatcher:comfirmationButtonMatcher] performAction:grey_tap()];77 [[EarlGrey78 selectElementWithMatcher:grey_kindOfClass(NSClassFromString(@"_UIAlertControllerView"))]79 performAction:grey_typeText(@"password")];80 [[EarlGrey selectElementWithMatcher:comfirmationButtonMatcher] performAction:grey_tap()];81 [[[EarlGrey82 selectElementWithMatcher:grey_allOf(grey_text(email), grey_sufficientlyVisible(), nil)]83 usingSearchAction:grey_scrollInDirection(kGREYDirectionUp, kShortScrollDistance)84 onElementWithMatcher:grey_allOf(grey_scrollView(), grey_kindOfClass([UITableView class]),85 nil)] assertWithMatcher:grey_sufficientlyVisible()];86}87/** Test sign in with a valid BYOAuth token retrived from a remote server. */88- (void)testSignInWithValidBYOAuthToken {89 NSError *error;90 NSString *customToken = [NSString stringWithContentsOfURL:[NSURL URLWithString:kCustomTokenUrl]91 encoding:NSUTF8StringEncoding92 error:&error];93 if (!customToken) {94 GREYFail(@"There was an error retrieving the custom token: %@", error);95 }96 [[[EarlGrey selectElementWithMatcher:grey_allOf(grey_text(@"Sign In (BYOAuth)"),97 grey_sufficientlyVisible(), nil)]98 usingSearchAction:grey_scrollInDirection(kGREYDirectionDown, kShortScrollDistance)99 onElementWithMatcher:grey_allOf(grey_scrollView(), grey_kindOfClass([UITableView class]),100 nil)] performAction:grey_tap()];101 [[[EarlGrey selectElementWithMatcher:grey_kindOfClass([UITextView class])]102 performAction:grey_replaceText(customToken)] assertWithMatcher:grey_text(customToken)];103 [[EarlGrey selectElementWithMatcher:grey_text(@"Done")] performAction:grey_tap()];104 [self waitForElementWithText:@"OK" withDelay:kWaitForElementTimeOut];105 [[EarlGrey selectElementWithMatcher:grey_text(@"OK")] performAction:grey_tap()];106 [[[EarlGrey107 selectElementWithMatcher:grey_allOf(grey_text(kTestingAccountUserID),108 grey_sufficientlyVisible(), nil)]109 usingSearchAction:grey_scrollInDirection(kGREYDirectionUp,110 kShortScrollDistance)111 onElementWithMatcher:grey_allOf(grey_scrollView(),112 grey_kindOfClass([UITableView class]),113 nil)]114 assertWithMatcher:grey_sufficientlyVisible()];115}116- (void)testSignInWithInvalidBYOAuthToken {117 [[[EarlGrey selectElementWithMatcher:grey_allOf(grey_text(@"Sign In (BYOAuth)"),118 grey_sufficientlyVisible(), nil)]119 usingSearchAction:grey_scrollInDirection(kGREYDirectionDown, kShortScrollDistance)120 onElementWithMatcher:grey_allOf(grey_scrollView(), grey_kindOfClass([UITableView class]),121 nil)] performAction:grey_tap()];122 [[[EarlGrey selectElementWithMatcher:grey_kindOfClass([UITextView class])]123 performAction:grey_replaceText(kInvalidCustomToken)]124 assertWithMatcher:grey_text(kInvalidCustomToken)];125 [[EarlGrey selectElementWithMatcher:grey_text(@"Done")] performAction:grey_tap()];126 NSString *invalidTokenErrorMessage =127 @"The custom token format is incorrect. Please check the documentation.";128 [self waitForElementWithText:invalidTokenErrorMessage withDelay:kWaitForElementTimeOut];129 [[EarlGrey selectElementWithMatcher:grey_text(@"OK")] performAction:grey_tap()];130}131#pragma mark - Helpers132/** Sign out current account. */133- (void)signOut {134 NSError *signOutError;135 BOOL status = [[FIRAuth auth] signOut:&signOutError];136 // Just log the error because we don't want to fail the test if signing out fails.137 if (!status) {138 NSLog(@"Error signing out: %@", signOutError);139 }140}141/** Wait for an element with text to appear. */142- (void)waitForElementWithText:(NSString *)text withDelay:(NSTimeInterval)maxDelay {143 GREYCondition *displayed =144 [GREYCondition conditionWithName:@"Wait for element"145 block:^BOOL {146 NSError *error = nil;147 [[EarlGrey selectElementWithMatcher:grey_text(text)]148 assertWithMatcher:grey_sufficientlyVisible()149 error:&error];150 return !error;151 }];152 GREYAssertTrue([displayed waitWithTimeout:maxDelay], @"Failed to wait for element '%@'.", text);153}154@end...

Full Screen

Full Screen

FTRAccessibilityTest.m

Source:FTRAccessibilityTest.m Github

copy

Full Screen

...35- (void)testAccessibilityElementTappedSuccessfullyWithTapAtPoint {36 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"SquareElementLabel")]37 performAction:[GREYActions actionForTapAtPoint:CGPointMake(1, 1)]];38 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"AccessibilityElementStatus")]39 assertWithMatcher:grey_text(@"Square Tapped")];40 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"CircleElementLabel")]41 performAction:[GREYActions actionForTapAtPoint:CGPointMake(49, 49)]];42 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"AccessibilityElementStatus")]43 assertWithMatcher:grey_text(@"Circle Tapped")];44}45- (void)testSquareTappedSuccessfully {46 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"SquareElementLabel")]47 assertWithMatcher:grey_sufficientlyVisible()];48 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"SquareElementLabel")]49 performAction:[GREYActions actionForTap]];50 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"AccessibilityElementStatus")]51 assertWithMatcher:grey_text(@"Square Tapped")];52}53- (void)testSquareTappedAtOriginSuccessfully {54 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"SquareElementLabel")]55 assertWithMatcher:grey_sufficientlyVisible()];56 // Square element rect is {50, 150, 100, 100}57 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"SquareElementLabel")]58 performAction:[GREYActions actionForTapAtPoint:CGPointMake(0, 0)]];59 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"AccessibilityElementStatus")]60 assertWithMatcher:grey_text(@"Square Tapped")];61}62- (void)testSquareTappedAtSpecificPointSuccessfully {63 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"SquareElementLabel")]64 assertWithMatcher:grey_sufficientlyVisible()];65 // Square element rect is {50, 150, 100, 100}66 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"SquareElementLabel")]67 performAction:grey_tapAtPoint(CGPointMake(50, 50))];68 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"AccessibilityElementStatus")]69 assertWithMatcher:grey_text(@"Square Tapped")];70}71- (void)testSquareTappedAtEndBoundsSuccessfully {72 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"SquareElementLabel")]73 assertWithMatcher:grey_sufficientlyVisible()];74 // Square element rect is {50, 150, 100, 100}75 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"SquareElementLabel")]76 performAction:grey_tapAtPoint(CGPointMake(99, 99))];77 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"AccessibilityElementStatus")]78 assertWithMatcher:grey_text(@"Square Tapped")];79}80- (void)testSquareTappedOutsideBoundsDoesNothing {81 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"SquareElementLabel")]82 assertWithMatcher:grey_sufficientlyVisible()];83 // Square element rect is {50, 150, 100, 100}84 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"SquareElementLabel")]85 performAction:grey_tapAtPoint(CGPointMake(151, 251))];86 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"AccessibilityElementStatus")]87 assertWithMatcher:grey_not(grey_text(@"Square Tapped"))];88 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"SquareElementLabel")]89 performAction:grey_tapAtPoint(CGPointMake(49, 150))];90 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"AccessibilityElementStatus")]91 assertWithMatcher:grey_not(grey_text(@"Square Tapped"))];92 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"SquareElementLabel")]93 performAction:grey_tapAtPoint(CGPointMake(50, 149))];94 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"AccessibilityElementStatus")]95 assertWithMatcher:grey_not(grey_text(@"Square Tapped"))];96}97- (void)testSquareTappedOutsideWindowBoundsFails {98 [EarlGrey setFailureHandler:[[FTRFailureHandler alloc] init]];99 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"SquareElementLabel")]100 assertWithMatcher:grey_sufficientlyVisible()];101 @try {102 // Square element rect is {50, 150, 100, 100}103 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"SquareElementLabel")]104 performAction:grey_tapAtPoint(CGPointMake(-51, -151))];105 XCTFail(@"Should throw an exception");106 } @catch (NSException *exception) {107 NSRange exceptionRange = [[exception reason] rangeOfString:@"Action 'Tap' failed."];108 XCTAssertNotEqual(exceptionRange.location, (NSUInteger)NSNotFound);109 }110}111- (void)testCircleTappedSuccessfully {112 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"CircleElementIdentifier")]113 assertWithMatcher:grey_sufficientlyVisible()];114 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"CircleElementIdentifier")]115 performAction:[GREYActions actionForTap]];116 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"AccessibilityElementStatus")]117 assertWithMatcher:grey_text(@"Circle Tapped")];118}119- (void)testRectangleIsNotSufficientlyVisible {120 [[EarlGrey selectElementWithMatcher:121 grey_accessibilityLabel(@"PartialOffScreenRectangleElementLabel")]122 assertWithMatcher:grey_not(grey_sufficientlyVisible())];123}124- (void)testOffScreenAccessibilityElementIsNotVisible {125 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"OffScreenElementIdentifier")]126 assertWithMatcher:grey_notVisible()];127}128- (void)testElementWithZeroHeightIsNotVisible {129 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"ElementWithZeroHeight")]130 assertWithMatcher:grey_notVisible()];131}132- (void)testElementWithZeroWidthIsNotVisible {133 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"ElementWithZeroWidth")]134 assertWithMatcher:grey_notVisible()];135}136- (void)testTapElementPartiallyOutside {137 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"PartiallyOutsideElementLabel")]138 performAction:grey_tap()];139 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"AccessibilityElementStatus")]140 assertWithMatcher:grey_text(@"Partially Outside Tapped")];141}142@end...

Full Screen

Full Screen

BYOAuthTests.m

Source:BYOAuthTests.m Github

copy

Full Screen

...31 error:&error];32 if (!customToken) {33 GREYFail(@"There was an error retrieving the custom token: %@", error);34 }35 [[[EarlGrey selectElementWithMatcher:grey_allOf(grey_text(@"Sign In (BYOAuth)"),36 grey_sufficientlyVisible(), nil)]37 usingSearchAction:grey_scrollInDirection(kGREYDirectionDown, kShortScrollDistance)38 onElementWithMatcher:grey_allOf(grey_scrollView(), grey_kindOfClass([UITableView class]),39 nil)] performAction:grey_tap()];40 [[[EarlGrey selectElementWithMatcher:grey_kindOfClass([UITextView class])]41 performAction:grey_replaceText(customToken)] assertWithMatcher:grey_text(customToken)];42 [[EarlGrey selectElementWithMatcher:grey_text(@"Done")] performAction:grey_tap()];43 [self waitForElementWithText:@"OK" withDelay:kWaitForElementTimeOut];44 [[EarlGrey selectElementWithMatcher:grey_text(@"OK")] performAction:grey_tap()];45 [[[EarlGrey selectElementWithMatcher:grey_allOf(grey_text(kTestingAccountUserID),46 grey_sufficientlyVisible(), nil)]47 usingSearchAction:grey_scrollInDirection(kGREYDirectionUp, kShortScrollDistance)48 onElementWithMatcher:grey_allOf(grey_scrollView(), grey_kindOfClass([UITableView class]),49 nil)] assertWithMatcher:grey_sufficientlyVisible()];50}51- (void)testSignInWithInvalidBYOAuthToken {52 [[[EarlGrey selectElementWithMatcher:grey_allOf(grey_text(@"Sign In (BYOAuth)"),53 grey_sufficientlyVisible(), nil)]54 usingSearchAction:grey_scrollInDirection(kGREYDirectionDown, kShortScrollDistance)55 onElementWithMatcher:grey_allOf(grey_scrollView(), grey_kindOfClass([UITableView class]),56 nil)] performAction:grey_tap()];57 [[[EarlGrey selectElementWithMatcher:grey_kindOfClass([UITextView class])]58 performAction:grey_replaceText(kInvalidCustomToken)]59 assertWithMatcher:grey_text(kInvalidCustomToken)];60 [[EarlGrey selectElementWithMatcher:grey_text(@"Done")] performAction:grey_tap()];61 NSString *invalidTokenErrorMessage = @"Sign-In Error";62 [self waitForElementWithText:invalidTokenErrorMessage withDelay:kWaitForElementTimeOut];63 [[EarlGrey selectElementWithMatcher:grey_text(@"OK")] performAction:grey_tap()];64}65@end...

Full Screen

Full Screen

DemoAppTests.m

Source:DemoAppTests.m Github

copy

Full Screen

...39}40void waitForViewWithAccessibility(NSString *view)41{42 NSError *error;43 [[EarlGrey selectElementWithMatcher:grey_firstResponder()] assertWithMatcher:grey_text(view) error:&error];44 if (error) {45 NSLog(@"Error: %@", error);46 }47}48@interface DemoAppTests : XCTestCase <GREYFailureHandler>49@end50@implementation DemoAppTests51- (void)handleException:(GREYFrameworkException *)exception details:(NSString *)details52{53 // Log the failure and state of the app if required.54 // Call thru to XCTFail() with an appropriate error message.55 NSLog(@"Failed test %@", exception);56}57- (void)setInvocationFile:(NSString *)fileName andInvocationLine:(NSUInteger)lineNumber58{59 // Record the file name and line number of the statement which was executing before the60 // failure occurred.61 NSLog(@"Failed %@ at %lu", fileName, (unsigned long)lineNumber);62}63- (void)setUp64{65 [EarlGrey setFailureHandler:self];66}67#pragma mark - Tabs68- (void)testTabBar_demoControllers69{70 selectTab(@"Demo");71 // assertView(@"Action Buttons");72}73- (void)testTabBar_authPage74{75 selectTab(@"OAuth");76 // assertView(@"Log in with Twitter");77}78- (void)testTabBar_teamPage79{80 selectTab(@"Team");81}82#pragma mark - OAuth Tab83- (void)testLoginButton84{85 selectTab(@"OAuth");86 selectView(@"Clear Test Account");87 selectView(@"Log in with Twitter");88 selectView(@"Cancel");89 // TODO: Add tab first item if accounts exist90}91- (void)testCustomLoginButton92{93 selectTab(@"OAuth");94 selectButton(@"Login with Custom Button");95 GREYCondition *waitForWebView = [GREYCondition conditionWithName:@"wait for web view" block:^BOOL {96 return [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"Username or email")] assertWithMatcher:grey_notNil()];97 }];98 GREYAssertTrue([waitForWebView waitWithTimeout:3], @"Wait for web view");99}100- (void)testAuth_RemoveAccount101{102 selectTab(@"OAuth");103 selectView(@"Clear Test Account");104 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"Accounts in current session")] assertWithMatcher:grey_text(@"")];105}106#pragma mark - Compact Tweets107- (void)testTweets_compact108{109 selectTab(@"Demo");110 selectView(@"Compact Tweets");111 selectView(@"Image Attachment");112 selectView(@"Close");113}114#pragma mark - Regular Tweets115- (void)testTweets_regular116{117 selectTab(@"Demo");118 selectView(@"Regular Tweets");...

Full Screen

Full Screen

FTRActionSheetTest.m

Source:FTRActionSheetTest.m Github

copy

Full Screen

...8}9- (void)testSimpleActionSheet {10 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"simpleActionSheetButton")]11 performAction:grey_tap()];12 [[EarlGrey selectElementWithMatcher:grey_text(@"Action Sheet")]13 assertWithMatcher:grey_sufficientlyVisible()];14 [[EarlGrey selectElementWithMatcher:grey_text(@"Simple Button")]15 performAction:grey_tap()];16 [[EarlGrey selectElementWithMatcher:grey_text(@"Action Sheet Button Pressed")]17 assertWithMatcher:grey_sufficientlyVisible()];18 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"simpleActionSheetButton")]19 performAction:grey_tap()];20 [[EarlGrey selectElementWithMatcher:grey_text(@"Action Sheet")]21 assertWithMatcher:grey_sufficientlyVisible()];22 if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {23 [[EarlGrey selectElementWithMatcher:grey_text(@"Cancel")]24 performAction:grey_tap()];25 } else {26 [[EarlGrey selectElementWithMatcher:grey_keyWindow()]27 performAction:grey_tapAtPoint(CGPointMake(50, 50))];28 }29 [[EarlGrey selectElementWithMatcher:grey_text(@"Actions Verified Here")]30 assertWithMatcher:grey_sufficientlyVisible()];31}32- (void)testMultipleActionSheet {33 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"multipleActionSheetButton")]34 performAction:grey_tap()];35 [[EarlGrey selectElementWithMatcher:grey_text(@"Action Sheet")]36 assertWithMatcher:grey_sufficientlyVisible()];37 [[EarlGrey selectElementWithMatcher:grey_text(@"Simple Button")]38 performAction:grey_tap()];39 [[EarlGrey selectElementWithMatcher:grey_text(@"Action Sheet Button Pressed")]40 assertWithMatcher:grey_sufficientlyVisible()];41 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"multipleActionSheetButton")]42 performAction:grey_tap()];43 [[EarlGrey selectElementWithMatcher:grey_text(@"Action Sheet")]44 assertWithMatcher:grey_sufficientlyVisible()];45 if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {46 [[EarlGrey selectElementWithMatcher:grey_text(@"Cancel")]47 performAction:grey_tap()];48 } else {49 [[EarlGrey selectElementWithMatcher:grey_keyWindow()]50 performAction:grey_tapAtPoint(CGPointMake(50, 50))];51 }52 [[EarlGrey selectElementWithMatcher:grey_text(@"Actions Verified Here")]53 assertWithMatcher:grey_sufficientlyVisible()];54 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"multipleActionSheetButton")]55 performAction:grey_tap()];56 [[EarlGrey selectElementWithMatcher:grey_text(@"Action Sheet")]57 assertWithMatcher:grey_sufficientlyVisible()];58 [[EarlGrey selectElementWithMatcher:grey_text(@"Hide Button")]59 performAction:grey_tap()];60 [[EarlGrey selectElementWithMatcher:grey_text(@"")]61 assertWithMatcher:grey_sufficientlyVisible()];62 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"multipleActionSheetButton")]63 assertWithMatcher:grey_notVisible()];64}65@end...

Full Screen

Full Screen

FTRAlertViewTest.m

Source:FTRAlertViewTest.m Github

copy

Full Screen

...21 [super setUp];22 [self openTestViewNamed:@"Alert Views"];23}24- (void)testSimpleAlertView {25 [[EarlGrey selectElementWithMatcher:grey_text(@"Simple Alert")]26 performAction:[GREYActions actionForTap]];27 [[EarlGrey selectElementWithMatcher:grey_text(@"Flee")] performAction:[GREYActions actionForTap]];28}29- (void)testMultiOptionAlertView {30 [[EarlGrey selectElementWithMatcher:grey_text(@"Multi-Option Alert")]31 performAction:[GREYActions actionForTap]];32 [[EarlGrey selectElementWithMatcher:grey_text(@"Use Slingshot")]33 performAction:[GREYActions actionForTap]];34 [[EarlGrey selectElementWithMatcher:grey_text(@"Multi-Option Alert")]35 performAction:[GREYActions actionForTap]];36 [[EarlGrey selectElementWithMatcher:grey_text(@"Use Phaser")]37 performAction:[GREYActions actionForTap]];38 [[EarlGrey selectElementWithMatcher:grey_text(@"Roger")]39 performAction:[GREYActions actionForTap]];40}41- (void)testAlertViewChain {42 [[EarlGrey selectElementWithMatcher:grey_text(@"Multi-Option Alert")]43 performAction:[GREYActions actionForTap]];44 [[EarlGrey selectElementWithMatcher:grey_text(@"Use Phaser")]45 performAction:[GREYActions actionForTap]];46 [[EarlGrey selectElementWithMatcher:grey_text(@"Roger")]47 performAction:[GREYActions actionForTap]];48}49- (void)testStyledAlertView {50 [[EarlGrey selectElementWithMatcher:grey_text(@"Styled Alert")]51 performAction:[GREYActions actionForTap]];52 [[EarlGrey selectElementWithMatcher:grey_text(@"Login")]53 performAction:grey_typeText(@"test_user")];54 [[EarlGrey selectElementWithMatcher:grey_text(@"test_user")] assertWithMatcher:grey_notNil()];55 [[EarlGrey selectElementWithMatcher:grey_text(@"Password")]56 performAction:grey_typeText(@"test_pwd")];57 [[EarlGrey selectElementWithMatcher:grey_text(@"test_pwd")] assertWithMatcher:grey_notNil()];58 [[EarlGrey selectElementWithMatcher:grey_text(@"Leave")]59 performAction:[GREYActions actionForTap]];60}61@end...

Full Screen

Full Screen

MyFirstEarlGrey2ObjCTest.m

Source:MyFirstEarlGrey2ObjCTest.m Github

copy

Full Screen

...14 [application launch];15}16- (void)test_preconditions {17 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"CountLabel")] assertWithMatcher:grey_sufficientlyVisible()];18 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"CountLabel")] assertWithMatcher:grey_text(@"0")];19 20 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"IncrementCountButton")] assertWithMatcher:grey_sufficientlyVisible()];21 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"IncrementCountButton")] assertWithMatcher:grey_text(@"Increment Count")];22}23- (void)test_tapping_the_increment_count_button_increments_the_value_in_the_count_label {24 // When.25 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"IncrementCountButton")] performAction:grey_tap()];26 27 // Then.28 [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"CountLabel")] assertWithMatcher:grey_text(@"1")];29}30@end...

Full Screen

Full Screen

grey_text

Using AI Code Generation

copy

Full Screen

1selectElementWithMatcher *matcher = [selectElementWithMatcher alloc];2[matcher grey_text:@"text"];3selectElementWithMatcher *matcher = [selectElementWithMatcher alloc];4[matcher grey_accessibilityLabel:@"accessibilityLabel"];5selectElementWithMatcher *matcher = [selectElementWithMatcher alloc];6[matcher grey_accessibilityID:@"accessibilityID"];7selectElementWithMatcher *matcher = [selectElementWithMatcher alloc];8[matcher grey_accessibilityValue:@"accessibilityValue"];9selectElementWithMatcher *matcher = [selectElementWithMatcher alloc];10[matcher grey_accessibilityTraits:@"accessibilityTraits"];11selectElementWithMatcher *matcher = [selectElementWithMatcher alloc];12[matcher grey_accessibilityHint:@"accessibilityHint"];13selectElementWithMatcher *matcher = [selectElementWithMatcher alloc];14[matcher grey_accessibilityFrame:@"accessibilityFrame"];15selectElementWithMatcher *matcher = [selectElementWithMatcher alloc];16[matcher grey_accessibilityActivationPoint:@"accessibilityActivationPoint"];17selectElementWithMatcher *matcher = [selectElementWithMatcher alloc];18[matcher grey_accessibilityLanguage:@"accessibilityLanguage"];19selectElementWithMatcher *matcher = [selectElementWithMatcher alloc];20[matcher grey_kindOfClass:@"kindOfClass"];21selectElementWithMatcher *matcher = [selectElementWithMatcher alloc];22[matcher grey_kindOfClasses:@"kindOfClasses"];23selectElementWithMatcher *matcher = [selectElementWithMatcher alloc];24[matcher grey_respondsToSelector:@"respondsToSelector"];

Full Screen

Full Screen

grey_text

Using AI Code Generation

copy

Full Screen

1[selectElementWithMatcher grey_text:@"Sign In" error:nil];2[selectElementWithMatcher grey_button:@"Sign In" error:nil];3[selectElementWithMatcher grey_accessibilityLabel:@"Sign In" error:nil];4[selectElementWithMatcher grey_accessibilityHint:@"Sign In" error:nil];5[selectElementWithMatcher grey_accessibilityValue:@"Sign In" error:nil];6[selectElementWithMatcher grey_accessibilityID:@"Sign In" error:nil];7[selectElementWithMatcher grey_accessibilityTrait:UIAccessibilityTraitButton error:nil];8[selectElementWithMatcher grey_text:@"Sign In" error:nil];9[selectElementWithMatcher grey_button:@"Sign In" error:nil];10[selectElementWithMatcher grey_accessibilityLabel:@"Sign In" error:nil];11[selectElementWithMatcher grey_accessibilityHint:@"Sign In" error:nil];12[selectElementWithMatcher grey_accessibilityValue:@"Sign In" error:nil];13[selectElementWithMatcher grey_accessibilityID:@"Sign In" error:nil];14[selectElementWithMatcher grey_accessibilityTrait:UIAccessibilityTraitButton error:nil];15[selectElementWithMatcher grey_text:@"Sign In" error:nil];16[selectElementWithMatcher grey_button:@"Sign In" error:nil];

Full Screen

Full Screen

grey_text

Using AI Code Generation

copy

Full Screen

1selectElementWithMatcher *selectElementWithMatcherClass = [[selectElementWithMatcher alloc] init];2[selectElementWithMatcherClass grey_text:@"Sign in" withError:nil];3- (void)grey_text:(NSString *)text withError:(NSError **)error {4 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(text)] performAction:grey_tap()];5}6- (void)grey_text:(NSString *)text withError:(NSError **)error;7- (void)grey_text:(NSString *)text withError:(NSError **)error {8 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(text)] performAction:grey_tap()];9}10+ (id<GREYMatcher>)selectElementWithMatcher:(id<GREYMatcher>)matcher;11+ (id<GREYMatcher>)selectElementWithMatcher:(id<GREYMatcher>)matcher {12 return matcher;13}14+ (id<GREYMatcher>)grey_accessibilityLabel:(NSString *)text;15+ (id<GREYMatcher>)grey_accessibilityLabel:(NSString *)text {16 return [[GREYElementMatcherBlock alloc] initWithMatchesBlock:^BOOL(id element) {17 return true;18 } descriptionBlock:^NSString *{19 return @"text";20 }];21}

Full Screen

Full Screen

grey_text

Using AI Code Generation

copy

Full Screen

1[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"text_field_1")] grey_typeText:@"Hello World!"];2[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"text_field_1")] grey_textField] grey_typeText:@"Hello World!"];3[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"text_field_1")] grey_textView] grey_typeText:@"Hello World!"];4[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"text_field_1")] grey_textField] grey_typeText:@"Hello World!"];5[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"text_field_1")] grey_textView] grey_typeText:@"Hello World!"];6[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"text_field_1")] grey_textField] grey_typeText:@"Hello World!"];7[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"text_field_1")] grey_textView] grey_typeText:@"Hello World!"];8[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"text_field_1")] grey_textField] grey_typeText:@"Hello World!"];9[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"text_field_1")] grey_textView] grey_typeText:@"Hello World!"];10[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"text_field_1")] grey_textField] grey_typeText:@"Hello World!"];

Full Screen

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run EarlGrey automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful