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 #import <UIKit/UIKit.h> |
| 6 #import <XCTest/XCTest.h> |
| 7 |
| 8 #import <EarlGrey/EarlGrey.h> |
| 9 |
| 10 #import "ios/web/shell/view_controller.h" |
| 11 |
| 12 @interface CRWWebShellNavigationTest : XCTestCase |
| 13 |
| 14 @end |
| 15 |
| 16 @implementation CRWWebShellNavigationTest |
| 17 |
| 18 // Sample test to load a live URL, go back and then forward. |
| 19 - (void)testExternalURLBackAndForward { |
| 20 [[EarlGrey |
| 21 selectElementWithMatcher:grey_accessibilityLabel( |
| 22 kWebShellAddressFieldAccessibilityLabel)] |
| 23 performAction:grey_tap()]; |
| 24 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"Clear text")] |
| 25 performAction:grey_tap()]; |
| 26 [[EarlGrey |
| 27 selectElementWithMatcher:grey_accessibilityLabel( |
| 28 kWebShellAddressFieldAccessibilityLabel)] |
| 29 performAction:grey_typeText(@"http://browsingtest.appspot.com\n")]; |
| 30 [[EarlGrey |
| 31 selectElementWithMatcher:grey_accessibilityLabel( |
| 32 kWebShellBackButtonAccessibilityLabel)] |
| 33 performAction:grey_tap()]; |
| 34 [[EarlGrey |
| 35 selectElementWithMatcher:grey_accessibilityLabel( |
| 36 kWebShellForwardButtonAccessibilityLabel)] |
| 37 performAction:grey_tap()]; |
| 38 } |
| 39 |
| 40 // Sample test to load a live URL, go back, forward, and then back again. |
| 41 - (void)testExternalURLBackAndForwardAndBack { |
| 42 [[EarlGrey |
| 43 selectElementWithMatcher:grey_accessibilityLabel( |
| 44 kWebShellAddressFieldAccessibilityLabel)] |
| 45 performAction:grey_tap()]; |
| 46 [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(@"Clear text")] |
| 47 performAction:grey_tap()]; |
| 48 [[EarlGrey |
| 49 selectElementWithMatcher:grey_accessibilityLabel( |
| 50 kWebShellAddressFieldAccessibilityLabel)] |
| 51 performAction:grey_typeText(@"http://browsingtest.appspot.com\n")]; |
| 52 [[EarlGrey |
| 53 selectElementWithMatcher:grey_accessibilityLabel( |
| 54 kWebShellBackButtonAccessibilityLabel)] |
| 55 performAction:grey_tap()]; |
| 56 [[EarlGrey |
| 57 selectElementWithMatcher:grey_accessibilityLabel( |
| 58 kWebShellForwardButtonAccessibilityLabel)] |
| 59 performAction:grey_tap()]; |
| 60 [[EarlGrey |
| 61 selectElementWithMatcher:grey_accessibilityLabel( |
| 62 kWebShellBackButtonAccessibilityLabel)] |
| 63 performAction:grey_tap()]; |
| 64 } |
| 65 @end |
OLD | NEW |