Commit 1b76dc5e authored by Nazerke's avatar Nazerke Committed by Commit Bot

[iOS] Add eg2 test for 'new window' option to bookrmarks context menu.

Bug: 1072370
Change-Id: I1b3c08277001dc5baf245d0aa2bc142a1b887e35
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2247737Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Commit-Queue: Nazerke Kalidolda <nazerke@google.com>
Cr-Commit-Position: refs/heads/master@{#783881}
parent f43ac66c
......@@ -203,6 +203,7 @@ source_set("eg_tests") {
"//ios/chrome/browser/ui/authentication/signin:constants",
"//ios/chrome/browser/ui/popup_menu:constants",
"//ios/chrome/browser/ui/table_view:feature_flags",
"//ios/chrome/browser/ui/util:multiwindow_util",
"//ios/chrome/test/app:test_support",
"//ios/chrome/test/earl_grey:test_support",
"//ios/testing/earl_grey:earl_grey_support",
......@@ -284,6 +285,7 @@ source_set("eg2_tests") {
"//ios/chrome/browser/ui/authentication/signin:constants",
"//ios/chrome/browser/ui/popup_menu:constants",
"//ios/chrome/browser/ui/table_view:feature_flags",
"//ios/chrome/browser/ui/util:multiwindow_util",
"//ios/chrome/test/earl_grey:eg_test_support+eg2",
"//ios/testing/earl_grey:eg_test_support+eg2",
"//ios/third_party/earl_grey2:test_lib",
......
......@@ -12,6 +12,7 @@
#import "ios/chrome/browser/ui/bookmarks/bookmark_earl_grey_ui.h"
#import "ios/chrome/browser/ui/bookmarks/bookmark_ui_constants.h"
#import "ios/chrome/browser/ui/table_view/feature_flags.h"
#import "ios/chrome/browser/ui/util/multi_window_support.h"
#include "ios/chrome/grit/ios_strings.h"
#import "ios/chrome/test/earl_grey/chrome_earl_grey.h"
#import "ios/chrome/test/earl_grey/chrome_matchers.h"
......@@ -208,6 +209,41 @@ using chrome_test_util::TappableBookmarkNodeWithLabel;
[BookmarkEarlGreyUI verifyContextMenuForSingleURLWithEditEnabled:YES];
}
// Tests display and selection of 'Open in New Window' in a context menu on a
// bookmarks entry.
- (void)testContextMenuOpenInNewWindow {
// TODO(crbug.com/1035764): EG1 Test fails on iOS 12.
if (!base::ios::IsRunningOnIOS13OrLater()) {
EARL_GREY_TEST_DISABLED(@"EG1 Fails on iOS 12.");
}
if (!IsMultiwindowSupported()) {
EARL_GREY_TEST_DISABLED(@"MultiWindow is not Supported.");
}
[BookmarkEarlGrey setupStandardBookmarks];
[BookmarkEarlGreyUI openBookmarks];
[BookmarkEarlGreyUI openMobileBookmarks];
[ChromeEarlGrey waitForBrowserCount:1];
// Open a bookmark in a new window (through a long press).
[[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"First URL")]
performAction:grey_longPress()];
[[EarlGrey
selectElementWithMatcher:ButtonWithAccessibilityLabelId(
IDS_IOS_CONTENT_CONTEXT_OPENINNEWWINDOW)]
performAction:grey_tap()];
[[EarlGrey selectElementWithMatcher:chrome_test_util::OmniboxText(
GetFirstUrl().GetContent())]
assertWithMatcher:grey_notNil()];
[ChromeEarlGrey waitForBrowserCount:2];
[ChromeEarlGrey closeCurrentTab];
[ChromeEarlGrey waitForBrowserCount:1];
}
// Verify Edit Text functionality on single URL selection.
- (void)testEditTextOnSingleURL {
// TODO(crbug.com/1049972): Re-enable on iOS 12.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment