Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef IOS_CHROME_TEST_EARL_GREY_CHROME_EARL_GREY_UI_H_ | 5 #ifndef IOS_CHROME_TEST_EARL_GREY_CHROME_EARL_GREY_UI_H_ |
| 6 #define IOS_CHROME_TEST_EARL_GREY_CHROME_EARL_GREY_UI_H_ | 6 #define IOS_CHROME_TEST_EARL_GREY_CHROME_EARL_GREY_UI_H_ |
| 7 | 7 |
| 8 #import <EarlGrey/EarlGrey.h> | |
| 8 #import <Foundation/Foundation.h> | 9 #import <Foundation/Foundation.h> |
| 9 | 10 |
| 10 // Test methods that perform actions on Chrome. These methods only affect Chrome | 11 // Test methods that perform actions on Chrome. These methods only affect Chrome |
| 11 // using the UI with Earl Grey. | 12 // using the UI with Earl Grey. |
| 12 @interface ChromeEarlGreyUI : NSObject | 13 @interface ChromeEarlGreyUI : NSObject |
| 13 | 14 |
| 14 // Makes the toolbar visible by swiping downward, if necessary. Then taps on | 15 // Makes the toolbar visible by swiping downward, if necessary. Then taps on |
| 15 // the Tools menu button. At least one tab needs to be open and visible when | 16 // the Tools menu button. At least one tab needs to be open and visible when |
| 16 // calling this method. | 17 // calling this method. |
| 17 + (void)openToolsMenu; | 18 + (void)openToolsMenu; |
| 18 | 19 |
| 19 // Opens the settings menu by opening the tools menu, and then tapping the | 20 // Opens the settings menu by opening the tools menu, and then tapping the |
| 20 // Settings button. There will be a GREYAssert if the tools menu is open when | 21 // Settings button. There will be a GREYAssert if the tools menu is open when |
| 21 // calling this method. | 22 // calling this method. |
| 22 + (void)openSettingsMenu; | 23 + (void)openSettingsMenu; |
| 23 | 24 |
| 25 // Scrolls to find the button in the Settings menu with the corresponding | |
|
Eugene But (OOO till 7-30)
2017/05/09 00:15:03
Is this API used anywhere except settings tests? I
baxley
2017/05/09 18:39:19
Yes, it is used in some other tests. However, the
baxley
2017/05/09 20:16:39
After offline discussion with eugenebut@ it was de
| |
| 26 // |buttonMatcher|, and then taps it. If |buttonMatcher| is not found, or | |
| 27 // the Settings menu is not open when this is called there will be a GREYAssert. | |
| 28 + (void)tapButtonInSettingsMenu:(id<GREYMatcher>)buttonMatcher; | |
|
Eugene But (OOO till 7-30)
2017/05/09 00:15:03
Per Cocoa Guidelines for Coding, make world(s) bef
baxley
2017/05/09 18:39:19
Done.
| |
| 29 | |
| 30 // Scrolls to find the button in the Privacy menu with the corresponding | |
| 31 // |buttonMatcher|, and then taps it. If |buttonMatcher| is not found, or | |
| 32 // the Privacy menu is not open when this is called there will be a GREYAssert. | |
| 33 + (void)tapButtonInPrivacyMenu:(id<GREYMatcher>)buttonMatcher; | |
| 34 | |
| 35 // Scrolls to find the button in the Clear Browsing Data menu with the | |
| 36 // corresponding |buttonMatcher|, and then taps it. If |buttonMatcher| is | |
| 37 // not found, or the Clear Browsing Data menu is not open when this is called | |
| 38 // there will be a GREYAssert. | |
| 39 + (void)tapButtonInClearBrowsingDataMenu:(id<GREYMatcher>)buttonMatcher; | |
| 40 | |
| 24 // Open a new tab via the tools menu. | 41 // Open a new tab via the tools menu. |
| 25 + (void)openNewTab; | 42 + (void)openNewTab; |
| 26 | 43 |
| 27 // Open a new incognito tab via the tools menu. | 44 // Open a new incognito tab via the tools menu. |
| 28 + (void)openNewIncognitoTab; | 45 + (void)openNewIncognitoTab; |
| 29 | 46 |
| 30 // Reloads the page via the reload button, and does not wait for the page to | 47 // Reloads the page via the reload button, and does not wait for the page to |
| 31 // finish loading. | 48 // finish loading. |
| 32 + (void)reload; | 49 + (void)reload; |
| 33 | 50 |
| 34 // Opens the share menu via the share button. | 51 // Opens the share menu via the share button. |
| 35 // This method requires that there is at least one tab open. | 52 // This method requires that there is at least one tab open. |
| 36 + (void)openShareMenu; | 53 + (void)openShareMenu; |
| 37 | 54 |
| 38 // Waits for toolbar to become visible if |isVisible| is YES, otherwise waits | 55 // Waits for toolbar to become visible if |isVisible| is YES, otherwise waits |
| 39 // for it to disappear. If the condition is not met within a timeout, a | 56 // for it to disappear. If the condition is not met within a timeout, a |
| 40 // GREYAssert is induced. | 57 // GREYAssert is induced. |
| 41 + (void)waitForToolbarVisible:(BOOL)isVisible; | 58 + (void)waitForToolbarVisible:(BOOL)isVisible; |
| 42 | 59 |
| 43 @end | 60 @end |
| 44 | 61 |
| 45 #endif // IOS_CHROME_TEST_EARL_GREY_CHROME_EARL_GREY_UI_H_ | 62 #endif // IOS_CHROME_TEST_EARL_GREY_CHROME_EARL_GREY_UI_H_ |
| OLD | NEW |