OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_TEST_EARL_GREY_CHROME_EARL_GREY_H_ |
| 6 #define IOS_CHROME_TEST_EARL_GREY_CHROME_EARL_GREY_H_ |
| 7 |
| 8 #import <EarlGrey/EarlGrey.h> |
| 9 |
| 10 #include "url/gurl.h" |
| 11 |
| 12 namespace chrome_test_util { |
| 13 |
| 14 // TODO(crbug.com/638674): Evaluate if this can move to shared code. |
| 15 // Execute |javascript| on current web state, and wait for either the completion |
| 16 // of execution or timeout. If |out_error| is not nil, it is set to the |
| 17 // error resulting from the execution, if one occurs. The return value is the |
| 18 // result of the JavaScript execution. If the request is timed out, then nil is |
| 19 // returned. |
| 20 id ExecuteJavaScript(NSString* javascript, NSError** out_error); |
| 21 |
| 22 } // namespace chrome_test_util |
| 23 |
| 24 // Test methods that perform actions on Chrome. These methods may read or alter |
| 25 // Chrome's internal state programmatically or via the UI, but in both cases |
| 26 // will properly synchronize the UI for Earl Grey tests. |
| 27 @interface ChromeEarlGrey : NSObject |
| 28 |
| 29 #pragma mark - History Utilities |
| 30 |
| 31 // Clears browsing history. |
| 32 + (void)clearBrowsingHistory; |
| 33 |
| 34 #pragma mark - Navigation Utilities |
| 35 |
| 36 // Loads |URL| in the current WebState with transition of type |
| 37 // ui::PAGE_TRANSITION_TYPED, and waits for the page to complete loading, or |
| 38 // a timeout. |
| 39 + (void)loadURL:(GURL)URL; |
| 40 |
| 41 // Waits for the page to finish loading or a timeout. |
| 42 + (void)waitForPageToFinishLoading; |
| 43 |
| 44 // Taps html element with |elementID| in the current web view. |
| 45 + (void)tapWebViewElementWithID:(NSString*)elementID; |
| 46 |
| 47 @end |
| 48 |
| 49 #endif // IOS_CHROME_TEST_EARL_GREY_CHROME_EARL_GREY_H_ |
OLD | NEW |