Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Side by Side Diff: ios/chrome/browser/ui/settings/translate_ui_egtest.mm

Issue 2642193012: Make EarlGrey matchers compliant with Chromium style. (Closed)
Patch Set: build.gn and rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import <EarlGrey/EarlGrey.h> 5 #import <EarlGrey/EarlGrey.h>
6 #import <XCTest/XCTest.h> 6 #import <XCTest/XCTest.h>
7 7
8 #import "ios/chrome/browser/ui/settings/settings_collection_view_controller.h" 8 #import "ios/chrome/browser/ui/settings/settings_collection_view_controller.h"
9 #import "ios/chrome/browser/ui/tools_menu/tools_menu_view_controller.h" 9 #import "ios/chrome/browser/ui/tools_menu/tools_menu_view_controller.h"
10 #import "ios/chrome/browser/ui/tools_menu/tools_popup_controller.h" 10 #import "ios/chrome/browser/ui/tools_menu/tools_popup_controller.h"
(...skipping 19 matching lines...) Expand all
30 // TODO(crbug.com/606815): This and close settings is mostly shared with block 30 // TODO(crbug.com/606815): This and close settings is mostly shared with block
31 // popups settings tests, and others. See if this can move to shared code. 31 // popups settings tests, and others. See if this can move to shared code.
32 [ChromeEarlGreyUI openToolsMenu]; 32 [ChromeEarlGreyUI openToolsMenu];
33 [[[EarlGrey 33 [[[EarlGrey
34 selectElementWithMatcher:grey_accessibilityID(kToolsMenuSettingsId)] 34 selectElementWithMatcher:grey_accessibilityID(kToolsMenuSettingsId)]
35 usingSearchAction:grey_scrollInDirection(kGREYDirectionDown, 35 usingSearchAction:grey_scrollInDirection(kGREYDirectionDown,
36 kScrollDisplacement) 36 kScrollDisplacement)
37 onElementWithMatcher:grey_accessibilityID(kToolsMenuTableViewId)] 37 onElementWithMatcher:grey_accessibilityID(kToolsMenuTableViewId)]
38 performAction:grey_tap()]; 38 performAction:grey_tap()];
39 [[[EarlGrey 39 [[[EarlGrey
40 selectElementWithMatcher:chrome_test_util::buttonWithAccessibilityLabelId( 40 selectElementWithMatcher:chrome_test_util::ButtonWithAccessibilityLabelId(
41 IDS_IOS_CONTENT_SETTINGS_TITLE)] 41 IDS_IOS_CONTENT_SETTINGS_TITLE)]
42 usingSearchAction:grey_scrollInDirection(kGREYDirectionDown, 42 usingSearchAction:grey_scrollInDirection(kGREYDirectionDown,
43 kScrollDisplacement) 43 kScrollDisplacement)
44 onElementWithMatcher:grey_accessibilityID(kSettingsCollectionViewId)] 44 onElementWithMatcher:grey_accessibilityID(kSettingsCollectionViewId)]
45 performAction:grey_tap()]; 45 performAction:grey_tap()];
46 [[EarlGrey 46 [[EarlGrey
47 selectElementWithMatcher:chrome_test_util::buttonWithAccessibilityLabelId( 47 selectElementWithMatcher:chrome_test_util::ButtonWithAccessibilityLabelId(
48 IDS_IOS_TRANSLATE_SETTING)] 48 IDS_IOS_TRANSLATE_SETTING)]
49 performAction:grey_tap()]; 49 performAction:grey_tap()];
50 50
51 // Assert title and accessibility. 51 // Assert title and accessibility.
52 [[EarlGrey 52 [[EarlGrey
53 selectElementWithMatcher:grey_accessibilityID( 53 selectElementWithMatcher:grey_accessibilityID(
54 @"translate_settings_view_controller")] 54 @"translate_settings_view_controller")]
55 assertWithMatcher:grey_notNil()]; 55 assertWithMatcher:grey_notNil()];
56 chrome_test_util::VerifyAccessibilityForCurrentScreen(); 56 chrome_test_util::VerifyAccessibilityForCurrentScreen();
57 57
58 // Close settings. 58 // Close settings.
59 [[EarlGrey 59 [[EarlGrey
60 selectElementWithMatcher:grey_allOf( 60 selectElementWithMatcher:grey_allOf(
61 grey_accessibilityID(@"ic_arrow_back"), 61 grey_accessibilityID(@"ic_arrow_back"),
62 grey_accessibilityTrait( 62 grey_accessibilityTrait(
63 UIAccessibilityTraitButton), 63 UIAccessibilityTraitButton),
64 nil)] performAction:grey_tap()]; 64 nil)] performAction:grey_tap()];
65 [[EarlGrey 65 [[EarlGrey
66 selectElementWithMatcher:grey_allOf( 66 selectElementWithMatcher:grey_allOf(
67 grey_accessibilityID(@"ic_arrow_back"), 67 grey_accessibilityID(@"ic_arrow_back"),
68 grey_accessibilityTrait( 68 grey_accessibilityTrait(
69 UIAccessibilityTraitButton), 69 UIAccessibilityTraitButton),
70 nil)] performAction:grey_tap()]; 70 nil)] performAction:grey_tap()];
71 [[EarlGrey 71 [[EarlGrey
72 selectElementWithMatcher:chrome_test_util::buttonWithAccessibilityLabelId( 72 selectElementWithMatcher:chrome_test_util::ButtonWithAccessibilityLabelId(
73 IDS_IOS_NAVIGATION_BAR_DONE_BUTTON)] 73 IDS_IOS_NAVIGATION_BAR_DONE_BUTTON)]
74 performAction:grey_tap()]; 74 performAction:grey_tap()];
75 } 75 }
76 76
77 @end 77 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/settings/settings_egtest.mm ('k') | ios/chrome/browser/ui/stack_view/stack_view_egtest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698