Commit 919aab84 authored by Javier Ernesto Flores Robles's avatar Javier Ernesto Flores Robles Committed by Commit Bot

[iOS][MF][EG2] Migrate credit card tests

Consolidate Manual Fallback matchers in one place.
Consolidate credit card Autofill helpers in the respective app
interface.

TBR= eugenebut@chromium.org

Bug: 1017685, 1016367
Change-Id: Ib91e2baba9e72f6e065e8ebf08fdd5f5d3c0c9bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1878197
Commit-Queue: Javier Ernesto Flores Robles <javierrobles@chromium.org>
Reviewed-by: default avatarStepan Khapugin <stkhapugin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#709020}
parent 8d8965d2
......@@ -30,6 +30,15 @@
// Resturns the name of the sample profile.
+ (NSString*)exampleProfileName;
// Removes the stored credit cards.
+ (void)clearCreditCardStore;
// Saves a local credit card that doesn't require CVC to be used.
+ (void)saveLocalCreditCard;
// Saves a masked credit card that requires CVC to be used.
+ (void)saveMaskedCreditCard;
@end
#endif // IOS_CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_APP_INTERFACE_H_
......@@ -189,6 +189,41 @@ void AddAutofillProfile(autofill::PersonalDataManager* personalDataManager) {
return base::SysUTF16ToNSString(name);
}
+ (void)clearCreditCardStore {
autofill::PersonalDataManager* personalDataManager =
[self personalDataManager];
for (const auto* creditCard : personalDataManager->GetCreditCards()) {
personalDataManager->RemoveByGUID(creditCard->guid());
}
}
+ (void)saveLocalCreditCard {
autofill::PersonalDataManager* personalDataManager =
[self personalDataManager];
autofill::CreditCard card = autofill::test::GetCreditCard();
size_t card_count = personalDataManager->GetCreditCards().size();
personalDataManager->AddCreditCard(card);
ConditionBlock conditionBlock = ^bool {
return card_count < personalDataManager->GetCreditCards().size();
};
base::test::ios::TimeUntilCondition(
nil, conditionBlock, false,
base::TimeDelta::FromSeconds(
base::test::ios::kWaitForFileOperationTimeout));
personalDataManager->NotifyPersonalDataObserver();
}
+ (void)saveMaskedCreditCard {
autofill::PersonalDataManager* personalDataManager =
[self personalDataManager];
autofill::CreditCard card = autofill::test::GetMaskedServerCard();
DCHECK(card.record_type() != autofill::CreditCard::LOCAL_CARD);
personalDataManager->AddServerCreditCardForTest(
std::make_unique<autofill::CreditCard>(card));
personalDataManager->NotifyPersonalDataObserver();
}
#pragma mark - Private
// The PersonalDataManager instance for the current browser state.
......
......@@ -236,6 +236,7 @@ source_set("eg2_tests") {
]
testonly = true
sources = [
"card_view_controller_egtest.mm",
"fallback_coordinator_egtest.mm",
"password_view_controller_egtest.mm",
]
......@@ -244,6 +245,7 @@ source_set("eg2_tests") {
"//base/test:test_support",
"//ios/chrome/app/strings:ios_strings_grit",
"//ios/chrome/browser/ui/autofill:eg_test_support+eg2",
"//ios/chrome/browser/ui/settings/autofill:feature_flags",
"//ios/chrome/test/earl_grey:eg_test_support+eg2",
"//ios/testing/earl_grey:eg_test_support+eg2",
"//ios/third_party/earl_grey2:test_lib",
......
......@@ -2,35 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import <EarlGrey/EarlGrey.h>
#import <EarlGrey/GREYKeyboard.h>
#include "base/ios/ios_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#import "base/test/ios/wait_util.h"
#include "base/test/scoped_feature_list.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/data_model/credit_card.h"
#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/autofill/core/common/autofill_features.h"
#include "components/keyed_service/core/service_access_type.h"
#import "ios/chrome/browser/autofill/form_suggestion_constants.h"
#include "ios/chrome/browser/autofill/personal_data_manager_factory.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/card_coordinator.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/card_mediator.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/card_view_controller.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_accessory_view_controller.h"
#import "ios/chrome/browser/ui/settings/autofill/autofill_credit_card_table_view_controller.h"
#import "ios/chrome/browser/ui/autofill/autofill_app_interface.h"
#import "ios/chrome/browser/ui/settings/autofill/features.h"
#import "ios/chrome/browser/ui/util/ui_util.h"
#include "ios/chrome/grit/ios_strings.h"
#import "ios/chrome/test/app/chrome_test_util.h"
#import "ios/chrome/test/earl_grey/chrome_actions.h"
#import "ios/chrome/test/earl_grey/chrome_earl_grey.h"
#import "ios/chrome/test/earl_grey/chrome_matchers.h"
#import "ios/chrome/test/earl_grey/chrome_test_case.h"
#import "ios/web/public/test/earl_grey/web_view_matchers.h"
#import "ios/testing/earl_grey/app_launch_manager.h"
#import "ios/testing/earl_grey/earl_grey_test.h"
#include "ios/web/public/test/element_selector.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "url/gurl.h"
......@@ -39,7 +22,17 @@
#error "This file requires ARC support."
#endif
using base::test::ios::kWaitForActionTimeout;
using chrome_test_util::CancelButton;
using chrome_test_util::ManualFallbackAddCreditCardsMatcher;
using chrome_test_util::ManualFallbackCreditCardIconMatcher;
using chrome_test_util::ManualFallbackCreditCardTableViewMatcher;
using chrome_test_util::ManualFallbackCreditCardTableViewWindowMatcher;
using chrome_test_util::ManualFallbackFormSuggestionViewMatcher;
using chrome_test_util::ManualFallbackKeyboardIconMatcher;
using chrome_test_util::ManualFallbackManageCreditCardsMatcher;
using chrome_test_util::NavigationBarCancelButton;
using chrome_test_util::SettingsCreditCardMatcher;
using chrome_test_util::StaticTextWithAccessibilityLabelId;
using chrome_test_util::TapWebElementWithId;
......@@ -57,10 +50,12 @@ NSString* kLocalCardExpirationYear = @"22";
// - 0x0020 - Space.
// - 0x2060 - WORD-JOINER (makes string undivisible).
constexpr base::char16 separator[] = {0x2060, 0x0020, 0};
constexpr base::char16 kMidlineEllipsis[] = {
0x2022, 0x2060, 0x2006, 0x2060, 0x2022, 0x2060, 0x2006, 0x2060, 0x2022,
0x2060, 0x2006, 0x2060, 0x2022, 0x2060, 0x2006, 0x2060, 0};
NSString* kObfuscatedNumberPrefix = base::SysUTF16ToNSString(
autofill::kMidlineEllipsis + base::string16(separator) +
autofill::kMidlineEllipsis + base::string16(separator) +
autofill::kMidlineEllipsis + base::string16(separator));
kMidlineEllipsis + base::string16(separator) + kMidlineEllipsis +
base::string16(separator) + kMidlineEllipsis + base::string16(separator));
NSString* kLocalNumberObfuscated =
[NSString stringWithFormat:@"%@1111", kObfuscatedNumberPrefix];
......@@ -70,70 +65,15 @@ NSString* kServerNumberObfuscated =
const char kFormHTMLFile[] = "/multi_field_form.html";
// Timeout in seconds while waiting for a profile or a credit to be added to the
// PersonalDataManager.
const NSTimeInterval kPDMMaxDelaySeconds = 10.0;
// Returns a matcher for the scroll view in keyboard accessory bar.
id<GREYMatcher> FormSuggestionViewMatcher() {
return grey_accessibilityID(kFormSuggestionsViewAccessibilityIdentifier);
}
// Returns a matcher for the credit card icon in the keyboard accessory bar.
id<GREYMatcher> CreditCardIconMatcher() {
return grey_accessibilityID(
manual_fill::AccessoryCreditCardAccessibilityIdentifier);
}
id<GREYMatcher> KeyboardIconMatcher() {
return grey_accessibilityID(
manual_fill::AccessoryKeyboardAccessibilityIdentifier);
}
// Returns a matcher for the credit card table view in manual fallback.
id<GREYMatcher> CreditCardTableViewMatcher() {
return grey_accessibilityID(
manual_fill::CardTableViewAccessibilityIdentifier);
}
// Returns a matcher for the button to open password settings in manual
// fallback.
id<GREYMatcher> ManageCreditCardsMatcher() {
return grey_accessibilityID(manual_fill::ManageCardsAccessibilityIdentifier);
}
// Returns a matcher for the button to add credit cards settings in manual
// fallback.
id<GREYMatcher> AddCreditCardsMatcher() {
return grey_accessibilityID(
manual_fill::kAddCreditCardsAccessibilityIdentifier);
}
// Returns a matcher for the credit card settings collection view.
id<GREYMatcher> CreditCardSettingsMatcher() {
return grey_accessibilityID(kAutofillCreditCardTableViewId);
}
// TODO(crbug.com/1016367): Remove the guard once ExecuteJavaScript is updated
// to compile on EG2.
#if defined(CHROME_EARL_GREY_1)
// Matcher for the not secure website alert.
id<GREYMatcher> NotSecureWebsiteAlert() {
return StaticTextWithAccessibilityLabelId(
IDS_IOS_MANUAL_FALLBACK_NOT_SECURE_TITLE);
}
// Returns a matcher for the CreditCardTableView window.
id<GREYMatcher> CreditCardTableViewWindowMatcher() {
id<GREYMatcher> classMatcher = grey_kindOfClass([UIWindow class]);
id<GREYMatcher> parentMatcher = grey_descendant(CreditCardTableViewMatcher());
return grey_allOf(classMatcher, parentMatcher, nil);
}
// Returns the matcher for an enabled cancel button in a navigation bar.
id<GREYMatcher> NavigationBarCancelMatcher() {
return grey_allOf(
grey_ancestor(grey_kindOfClass([UINavigationBar class])), CancelButton(),
grey_not(grey_accessibilityTrait(UIAccessibilityTraitNotEnabled)), nil);
}
// Polls the JavaScript query |java_script_condition| until the returned
// |boolValue| is YES with a kWaitForActionTimeout timeout.
BOOL WaitForJavaScriptCondition(NSString* java_script_condition) {
......@@ -148,92 +88,48 @@ BOOL WaitForJavaScriptCondition(NSString* java_script_condition) {
block:verify_block];
return [condition waitWithTimeout:timeout];
}
#endif
// Waits for the keyboard to appear. Returns NO on timeout.
BOOL WaitForKeyboardToAppear() {
GREYCondition* waitForKeyboard = [GREYCondition
conditionWithName:@"Wait for keyboard"
block:^BOOL {
return [ChromeEarlGrey isKeyboardShownWithError:nil];
}];
return [waitForKeyboard waitWithTimeout:kWaitForActionTimeout];
}
} // namespace
// Integration Tests for Manual Fallback credit cards View Controller.
@interface CreditCardViewControllerTestCase : ChromeTestCase {
// The PersonalDataManager instance for the current browser state.
autofill::PersonalDataManager* _personalDataManager;
// Credit Cards added to the PersonalDataManager.
std::vector<autofill::CreditCard> _cards;
}
@interface CreditCardViewControllerTestCase : ChromeTestCase
@end
@implementation CreditCardViewControllerTestCase
- (void)setUp {
[super setUp];
[[AppLaunchManager sharedManager]
ensureAppLaunchedWithFeaturesEnabled:{kSettingsAddPaymentMethod,
kCreditCardScanner}
disabled:{}
forceRestart:NO];
GREYAssertTrue(self.testServer->Start(), @"Test server failed to start.");
const GURL URL = self.testServer->GetURL(kFormHTMLFile);
[ChromeEarlGrey loadURL:URL];
[ChromeEarlGrey waitForWebStateContainingText:"hello!"];
_personalDataManager =
autofill::PersonalDataManagerFactory::GetForBrowserState(
chrome_test_util::GetOriginalBrowserState());
_personalDataManager->SetSyncingForTest(true);
for (autofill::CreditCard* card :
_personalDataManager->GetLocalCreditCards()) {
_personalDataManager->RemoveByGUID(card->guid());
}
GREYAssert(base::test::ios::WaitUntilConditionOrTimeout(
kPDMMaxDelaySeconds,
^bool() {
return _personalDataManager->GetLocalCreditCards().size() ==
0;
}),
@"Failed to remove local credit cards.");
[AutofillAppInterface clearCreditCardStore];
}
- (void)tearDown {
for (const auto& card : _cards) {
_personalDataManager->RemoveByGUID(card.guid());
}
_cards.clear();
[EarlGrey rotateDeviceToOrientation:UIDeviceOrientationPortrait
errorOrNil:nil];
[AutofillAppInterface clearCreditCardStore];
[ChromeEarlGrey rotateDeviceToOrientation:UIDeviceOrientationPortrait
error:nil];
[super tearDown];
}
#pragma mark - Helpers
// Adds a local credit card, one that doesn't need CVC unlocking.
- (void)addCreditCard:(const autofill::CreditCard&)card {
_cards.push_back(card);
size_t card_count = _personalDataManager->GetCreditCards().size();
_personalDataManager->AddCreditCard(card);
GREYAssert(base::test::ios::WaitUntilConditionOrTimeout(
kPDMMaxDelaySeconds,
^bool() {
return card_count <
_personalDataManager->GetCreditCards().size();
}),
@"Failed to add credit card.");
_personalDataManager->NotifyPersonalDataObserver();
}
// Adds a server credit card, one that needs CVC unlocking.
- (void)addServerCreditCard:(const autofill::CreditCard&)card {
DCHECK(card.record_type() != autofill::CreditCard::LOCAL_CARD);
_personalDataManager->AddServerCreditCardForTest(
std::make_unique<autofill::CreditCard>(card));
_personalDataManager->NotifyPersonalDataObserver();
}
- (void)saveLocalCreditCard {
autofill::CreditCard card = autofill::test::GetCreditCard();
[self addCreditCard:card];
}
- (void)saveMaskedCreditCard {
autofill::CreditCard card = autofill::test::GetMaskedServerCard();
[self addServerCreditCard:card];
}
#pragma mark - Tests
// Tests that the credit card view butotn is absent when there are no cards
......@@ -244,141 +140,145 @@ BOOL WaitForJavaScriptCondition(NSString* java_script_condition) {
performAction:TapWebElementWithId(kFormElementUsername)];
// Verify there's no credit card icon.
[[EarlGrey selectElementWithMatcher:CreditCardIconMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackCreditCardIconMatcher()]
assertWithMatcher:grey_notVisible()];
}
// Tests that the credit card view controller appears on screen.
- (void)testCreditCardsViewControllerIsPresented {
[self saveLocalCreditCard];
[AutofillAppInterface saveLocalCreditCard];
// Bring up the keyboard.
[[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewMatcher()]
performAction:TapWebElementWithId(kFormElementUsername)];
// Tap on the credit card icon.
[[EarlGrey selectElementWithMatcher:CreditCardIconMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackCreditCardIconMatcher()]
performAction:grey_tap()];
// Verify the credit cards controller table view is visible.
[[EarlGrey selectElementWithMatcher:CreditCardTableViewMatcher()]
[[EarlGrey
selectElementWithMatcher:ManualFallbackCreditCardTableViewMatcher()]
assertWithMatcher:grey_sufficientlyVisible()];
}
// Tests that the credit cards view controller contains the "Manage Credit
// Cards..." action.
- (void)testCreditCardsViewControllerContainsManageCreditCardsAction {
[self saveLocalCreditCard];
[AutofillAppInterface saveLocalCreditCard];
// Bring up the keyboard.
[[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewMatcher()]
performAction:TapWebElementWithId(kFormElementUsername)];
// Tap on the credit card icon.
[[EarlGrey selectElementWithMatcher:CreditCardIconMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackCreditCardIconMatcher()]
performAction:grey_tap()];
// Try to scroll.
[[EarlGrey selectElementWithMatcher:CreditCardTableViewMatcher()]
[[EarlGrey
selectElementWithMatcher:ManualFallbackCreditCardTableViewMatcher()]
performAction:grey_scrollToContentEdge(kGREYContentEdgeBottom)];
// Verify the credit cards controller contains the "Manage Credit Cards..."
// action.
[[EarlGrey selectElementWithMatcher:ManageCreditCardsMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackManageCreditCardsMatcher()]
assertWithMatcher:grey_interactable()];
}
// Tests that the "Manage Credit Cards..." action works.
- (void)testManageCreditCardsActionOpensCreditCardSettings {
[self saveLocalCreditCard];
[AutofillAppInterface saveLocalCreditCard];
// Bring up the keyboard.
[[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewMatcher()]
performAction:TapWebElementWithId(kFormElementUsername)];
// Tap on the credit card icon.
[[EarlGrey selectElementWithMatcher:CreditCardIconMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackCreditCardIconMatcher()]
performAction:grey_tap()];
// Try to scroll.
[[EarlGrey selectElementWithMatcher:CreditCardTableViewMatcher()]
[[EarlGrey
selectElementWithMatcher:ManualFallbackCreditCardTableViewMatcher()]
performAction:grey_scrollToContentEdge(kGREYContentEdgeBottom)];
// Tap the "Manage Credit Cards..." action.
[[EarlGrey selectElementWithMatcher:ManageCreditCardsMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackManageCreditCardsMatcher()]
performAction:grey_tap()];
// Verify the credit cards settings opened.
[[EarlGrey selectElementWithMatcher:CreditCardSettingsMatcher()]
[[EarlGrey selectElementWithMatcher:SettingsCreditCardMatcher()]
assertWithMatcher:grey_sufficientlyVisible()];
}
// Tests that the manual fallback view and icon is not highlighted after
// presenting the manage credit cards view.
- (void)testCreditCardsStateAfterPresentingCreditCardSettings {
[self saveLocalCreditCard];
[AutofillAppInterface saveLocalCreditCard];
// Bring up the keyboard.
[[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewMatcher()]
performAction:TapWebElementWithId(kFormElementUsername)];
// Scroll to the right.
[[EarlGrey selectElementWithMatcher:FormSuggestionViewMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackFormSuggestionViewMatcher()]
performAction:grey_scrollToContentEdge(kGREYContentEdgeRight)];
// Tap on the credit card icon.
[[EarlGrey selectElementWithMatcher:CreditCardIconMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackCreditCardIconMatcher()]
performAction:grey_tap()];
// Verify the status of the icon.
[[EarlGrey selectElementWithMatcher:CreditCardIconMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackCreditCardIconMatcher()]
assertWithMatcher:grey_not(grey_userInteractionEnabled())];
// Try to scroll.
[[EarlGrey selectElementWithMatcher:CreditCardTableViewMatcher()]
[[EarlGrey
selectElementWithMatcher:ManualFallbackCreditCardTableViewMatcher()]
performAction:grey_scrollToContentEdge(kGREYContentEdgeBottom)];
// Tap the "Manage Credit Cards..." action.
[[EarlGrey selectElementWithMatcher:ManageCreditCardsMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackManageCreditCardsMatcher()]
performAction:grey_tap()];
// Tap Cancel Button.
[[EarlGrey selectElementWithMatcher:NavigationBarCancelMatcher()]
[[EarlGrey selectElementWithMatcher:NavigationBarCancelButton()]
performAction:grey_tap()];
// Verify the status of the icons.
[[EarlGrey selectElementWithMatcher:CreditCardIconMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackCreditCardIconMatcher()]
assertWithMatcher:grey_sufficientlyVisible()];
[[EarlGrey selectElementWithMatcher:CreditCardIconMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackCreditCardIconMatcher()]
assertWithMatcher:grey_userInteractionEnabled()];
[[EarlGrey selectElementWithMatcher:KeyboardIconMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackKeyboardIconMatcher()]
assertWithMatcher:grey_not(grey_sufficientlyVisible())];
// Verify the keyboard is not cover by the cards view.
[[EarlGrey selectElementWithMatcher:CreditCardTableViewMatcher()]
[[EarlGrey
selectElementWithMatcher:ManualFallbackCreditCardTableViewMatcher()]
assertWithMatcher:grey_notVisible()];
}
// Tests that the "Add Credit Cards..." action works.
- (void)testAddCreditCardsActionOpensAddCreditCardSettings {
base::test::ScopedFeatureList featureList;
featureList.InitAndEnableFeature(kSettingsAddPaymentMethod);
[self saveLocalCreditCard];
[AutofillAppInterface saveLocalCreditCard];
// Bring up the keyboard.
[[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewMatcher()]
performAction:TapWebElementWithId(kFormElementUsername)];
// Tap on the credit card icon.
[[EarlGrey selectElementWithMatcher:CreditCardIconMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackCreditCardIconMatcher()]
performAction:grey_tap()];
// Try to scroll.
[[EarlGrey selectElementWithMatcher:CreditCardTableViewMatcher()]
[[EarlGrey
selectElementWithMatcher:ManualFallbackCreditCardTableViewMatcher()]
performAction:grey_scrollToContentEdge(kGREYContentEdgeBottom)];
// Tap the "Add Credit Cards..." action.
[[EarlGrey selectElementWithMatcher:AddCreditCardsMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackAddCreditCardsMatcher()]
performAction:grey_tap()];
// Verify the credit cards settings opened.
......@@ -388,9 +288,7 @@ BOOL WaitForJavaScriptCondition(NSString* java_script_condition) {
// Tests that the "Add Credit Cards..." action works on OTR.
- (void)testOTRAddCreditCardsActionOpensAddCreditCardSettings {
base::test::ScopedFeatureList featureList;
featureList.InitAndEnableFeature(kSettingsAddPaymentMethod);
[self saveLocalCreditCard];
[AutofillAppInterface saveLocalCreditCard];
// Open a tab in incognito.
[ChromeEarlGrey openNewIncognitoTab];
......@@ -403,15 +301,16 @@ BOOL WaitForJavaScriptCondition(NSString* java_script_condition) {
performAction:TapWebElementWithId(kFormElementUsername)];
// Tap on the credit card icon.
[[EarlGrey selectElementWithMatcher:CreditCardIconMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackCreditCardIconMatcher()]
performAction:grey_tap()];
// Try to scroll.
[[EarlGrey selectElementWithMatcher:CreditCardTableViewMatcher()]
[[EarlGrey
selectElementWithMatcher:ManualFallbackCreditCardTableViewMatcher()]
performAction:grey_scrollToContentEdge(kGREYContentEdgeBottom)];
// Tap the "Add Credit Cards..." action.
[[EarlGrey selectElementWithMatcher:AddCreditCardsMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackAddCreditCardsMatcher()]
performAction:grey_tap()];
// Verify the credit cards settings opened.
......@@ -422,48 +321,48 @@ BOOL WaitForJavaScriptCondition(NSString* java_script_condition) {
// Tests that the manual fallback view icon is not highlighted after presenting
// the add credit card view.
- (void)testCreditCardsButtonStateAfterPresentingAddCreditCard {
base::test::ScopedFeatureList featureList;
featureList.InitAndEnableFeature(kSettingsAddPaymentMethod);
[self saveLocalCreditCard];
[AutofillAppInterface saveLocalCreditCard];
// Bring up the keyboard.
[[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewMatcher()]
performAction:TapWebElementWithId(kFormElementUsername)];
// Scroll to the right.
[[EarlGrey selectElementWithMatcher:FormSuggestionViewMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackFormSuggestionViewMatcher()]
performAction:grey_scrollToContentEdge(kGREYContentEdgeRight)];
// Tap on the credit card icon.
[[EarlGrey selectElementWithMatcher:CreditCardIconMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackCreditCardIconMatcher()]
performAction:grey_tap()];
// Verify the status of the icon.
[[EarlGrey selectElementWithMatcher:CreditCardIconMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackCreditCardIconMatcher()]
assertWithMatcher:grey_not(grey_userInteractionEnabled())];
// Try to scroll.
[[EarlGrey selectElementWithMatcher:CreditCardTableViewMatcher()]
[[EarlGrey
selectElementWithMatcher:ManualFallbackCreditCardTableViewMatcher()]
performAction:grey_scrollToContentEdge(kGREYContentEdgeBottom)];
// Tap the "Add Credit Cards..." action.
[[EarlGrey selectElementWithMatcher:AddCreditCardsMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackAddCreditCardsMatcher()]
performAction:grey_tap()];
// Tap Cancel Button.
[[EarlGrey selectElementWithMatcher:NavigationBarCancelMatcher()]
[[EarlGrey selectElementWithMatcher:NavigationBarCancelButton()]
performAction:grey_tap()];
// Verify the status of the icons.
[[EarlGrey selectElementWithMatcher:CreditCardIconMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackCreditCardIconMatcher()]
assertWithMatcher:grey_sufficientlyVisible()];
[[EarlGrey selectElementWithMatcher:CreditCardIconMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackCreditCardIconMatcher()]
assertWithMatcher:grey_userInteractionEnabled()];
[[EarlGrey selectElementWithMatcher:KeyboardIconMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackKeyboardIconMatcher()]
assertWithMatcher:grey_not(grey_sufficientlyVisible())];
// Verify the keyboard is not cover by the cards view.
[[EarlGrey selectElementWithMatcher:CreditCardTableViewMatcher()]
[[EarlGrey
selectElementWithMatcher:ManualFallbackCreditCardTableViewMatcher()]
assertWithMatcher:grey_notVisible()];
}
......@@ -474,29 +373,31 @@ BOOL WaitForJavaScriptCondition(NSString* java_script_condition) {
// The keyboard icon is never present in iPads.
return;
}
[self saveLocalCreditCard];
[AutofillAppInterface saveLocalCreditCard];
// Bring up the keyboard.
[[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewMatcher()]
performAction:TapWebElementWithId(kFormElementUsername)];
// Tap on the credit cards icon.
[[EarlGrey selectElementWithMatcher:CreditCardIconMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackCreditCardIconMatcher()]
performAction:grey_tap()];
// Verify the credit card controller table view is visible.
[[EarlGrey selectElementWithMatcher:CreditCardTableViewMatcher()]
[[EarlGrey
selectElementWithMatcher:ManualFallbackCreditCardTableViewMatcher()]
assertWithMatcher:grey_sufficientlyVisible()];
// Tap on the keyboard icon.
[[EarlGrey selectElementWithMatcher:KeyboardIconMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackKeyboardIconMatcher()]
performAction:grey_tap()];
// Verify the credit card controller table view and the credit card icon is
// NOT visible.
[[EarlGrey selectElementWithMatcher:CreditCardTableViewMatcher()]
[[EarlGrey
selectElementWithMatcher:ManualFallbackCreditCardTableViewMatcher()]
assertWithMatcher:grey_notVisible()];
[[EarlGrey selectElementWithMatcher:KeyboardIconMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackKeyboardIconMatcher()]
assertWithMatcher:grey_notVisible()];
}
......@@ -506,31 +407,34 @@ BOOL WaitForJavaScriptCondition(NSString* java_script_condition) {
if (![ChromeEarlGrey isIPadIdiom]) {
return;
}
[self saveLocalCreditCard];
[AutofillAppInterface saveLocalCreditCard];
// Bring up the keyboard.
[[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewMatcher()]
performAction:TapWebElementWithId(kFormElementUsername)];
// Tap on the credit cards icon.
[[EarlGrey selectElementWithMatcher:CreditCardIconMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackCreditCardIconMatcher()]
performAction:grey_tap()];
// Verify the credit card controller table view is visible.
[[EarlGrey selectElementWithMatcher:CreditCardTableViewMatcher()]
[[EarlGrey
selectElementWithMatcher:ManualFallbackCreditCardTableViewMatcher()]
assertWithMatcher:grey_sufficientlyVisible()];
// Tap on a point outside of the popover.
// The way EarlGrey taps doesn't go through the window hierarchy. Because of
// this, the tap needs to be done in the same window as the popover.
[[EarlGrey selectElementWithMatcher:CreditCardTableViewWindowMatcher()]
[[EarlGrey
selectElementWithMatcher:ManualFallbackCreditCardTableViewWindowMatcher()]
performAction:grey_tapAtPoint(CGPointMake(0, 0))];
// Verify the credit card controller table view and the credit card icon is
// NOT visible.
[[EarlGrey selectElementWithMatcher:CreditCardTableViewMatcher()]
[[EarlGrey
selectElementWithMatcher:ManualFallbackCreditCardTableViewMatcher()]
assertWithMatcher:grey_notVisible()];
[[EarlGrey selectElementWithMatcher:KeyboardIconMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackKeyboardIconMatcher()]
assertWithMatcher:grey_notVisible()];
}
......@@ -541,42 +445,45 @@ BOOL WaitForJavaScriptCondition(NSString* java_script_condition) {
if (![ChromeEarlGrey isIPadIdiom]) {
return;
}
[self saveLocalCreditCard];
[AutofillAppInterface saveLocalCreditCard];
// Bring up the keyboard.
[[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewMatcher()]
performAction:TapWebElementWithId(kFormElementUsername)];
// Tap on the credit cards icon.
[[EarlGrey selectElementWithMatcher:CreditCardIconMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackCreditCardIconMatcher()]
performAction:grey_tap()];
// Verify the credit card controller table view is visible.
[[EarlGrey selectElementWithMatcher:CreditCardTableViewMatcher()]
[[EarlGrey
selectElementWithMatcher:ManualFallbackCreditCardTableViewMatcher()]
assertWithMatcher:grey_sufficientlyVisible()];
[[EarlGrey selectElementWithMatcher:CreditCardTableViewMatcher()]
[[EarlGrey
selectElementWithMatcher:ManualFallbackCreditCardTableViewMatcher()]
performAction:grey_typeText(@"text")];
// Verify the credit card controller table view and the credit card icon is
// NOT visible.
[[EarlGrey selectElementWithMatcher:CreditCardTableViewMatcher()]
[[EarlGrey
selectElementWithMatcher:ManualFallbackCreditCardTableViewMatcher()]
assertWithMatcher:grey_notVisible()];
[[EarlGrey selectElementWithMatcher:KeyboardIconMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackKeyboardIconMatcher()]
assertWithMatcher:grey_notVisible()];
}
// Tests that after switching fields the content size of the table view didn't
// grow.
- (void)testCreditCardControllerKeepsRightSize {
[self saveLocalCreditCard];
[AutofillAppInterface saveLocalCreditCard];
// Bring up the keyboard.
[[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewMatcher()]
performAction:TapWebElementWithId(kFormElementUsername)];
// Tap on the credit cards icon.
[[EarlGrey selectElementWithMatcher:CreditCardIconMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackCreditCardIconMatcher()]
performAction:grey_tap()];
// Tap the second element.
......@@ -584,34 +491,40 @@ BOOL WaitForJavaScriptCondition(NSString* java_script_condition) {
performAction:TapWebElementWithId(kFormElementOtherStuff)];
// Try to scroll.
[[EarlGrey selectElementWithMatcher:CreditCardTableViewMatcher()]
[[EarlGrey
selectElementWithMatcher:ManualFallbackCreditCardTableViewMatcher()]
performAction:grey_scrollToContentEdge(kGREYContentEdgeBottom)];
}
// Tests that the credit card View Controller stays on rotation.
- (void)testCreditCardControllerSupportsRotation {
[self saveLocalCreditCard];
[AutofillAppInterface saveLocalCreditCard];
// Bring up the keyboard.
[[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewMatcher()]
performAction:TapWebElementWithId(kFormElementUsername)];
// Tap on the credit cards icon.
[[EarlGrey selectElementWithMatcher:CreditCardIconMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackCreditCardIconMatcher()]
performAction:grey_tap()];
// Verify the credit card controller table view is visible.
[[EarlGrey selectElementWithMatcher:CreditCardTableViewMatcher()]
[[EarlGrey
selectElementWithMatcher:ManualFallbackCreditCardTableViewMatcher()]
assertWithMatcher:grey_sufficientlyVisible()];
[EarlGrey rotateDeviceToOrientation:UIDeviceOrientationLandscapeLeft
errorOrNil:nil];
[ChromeEarlGrey rotateDeviceToOrientation:UIDeviceOrientationLandscapeLeft
error:nil];
// Verify the credit card controller table view is still visible.
[[EarlGrey selectElementWithMatcher:CreditCardTableViewMatcher()]
[[EarlGrey
selectElementWithMatcher:ManualFallbackCreditCardTableViewMatcher()]
assertWithMatcher:grey_sufficientlyVisible()];
}
// TODO(crbug.com/1016367): Remove the guard once ExecuteJavaScript is updated
// to compile on EG2.
#if defined(CHROME_EARL_GREY_1)
// Tests that credit card number (for local card) is injected.
// TODO(crbug.com/845472): maybe figure a way to test successfull injection
// when page is https, but right now if we use the https embedded server,
......@@ -649,25 +562,27 @@ BOOL WaitForJavaScriptCondition(NSString* java_script_condition) {
[self verifyCreditCardButtonWithTitle:kLocalCardExpirationYear
doesInjectValue:kLocalCardExpirationYear];
}
#endif
// Tests that masked credit card offer CVC input.
// TODOD(crbug.com/909748) can't test this one until https tests are possible.
- (void)DISABLED_testCreditCardServerNumberRequiresCVC {
[self saveMaskedCreditCard];
[AutofillAppInterface saveMaskedCreditCard];
// Bring up the keyboard.
[[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewMatcher()]
performAction:TapWebElementWithId(kFormElementUsername)];
// Wait for the accessory icon to appear.
[GREYKeyboard waitForKeyboardToAppear];
GREYAssert(WaitForKeyboardToAppear(), @"Keyboard didn't appear.");
// Tap on the passwords icon.
[[EarlGrey selectElementWithMatcher:CreditCardIconMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackCreditCardIconMatcher()]
performAction:grey_tap()];
// Verify the password controller table view is visible.
[[EarlGrey selectElementWithMatcher:CreditCardTableViewMatcher()]
[[EarlGrey
selectElementWithMatcher:ManualFallbackCreditCardTableViewMatcher()]
assertWithMatcher:grey_sufficientlyVisible()];
// Select a the masked number.
......@@ -684,23 +599,27 @@ BOOL WaitForJavaScriptCondition(NSString* java_script_condition) {
#pragma mark - Private
// TODO(crbug.com/1016367): Remove the guard once ExecuteJavaScript is updated
// to compile on EG2.
#if defined(CHROME_EARL_GREY_1)
- (void)verifyCreditCardButtonWithTitle:(NSString*)title
doesInjectValue:(NSString*)result {
[self saveLocalCreditCard];
[AutofillAppInterface saveLocalCreditCard];
// Bring up the keyboard.
[[EarlGrey selectElementWithMatcher:chrome_test_util::WebViewMatcher()]
performAction:TapWebElementWithId(kFormElementUsername)];
// Wait for the accessory icon to appear.
[GREYKeyboard waitForKeyboardToAppear];
GREYAssert(WaitForKeyboardToAppear(), @"Keyboard didn't appear.");
// Tap on the passwords icon.
[[EarlGrey selectElementWithMatcher:CreditCardIconMatcher()]
[[EarlGrey selectElementWithMatcher:ManualFallbackCreditCardIconMatcher()]
performAction:grey_tap()];
// Verify the password controller table view is visible.
[[EarlGrey selectElementWithMatcher:CreditCardTableViewMatcher()]
[[EarlGrey
selectElementWithMatcher:ManualFallbackCreditCardTableViewMatcher()]
assertWithMatcher:grey_sufficientlyVisible()];
// Select a field.
......@@ -713,5 +632,6 @@ BOOL WaitForJavaScriptCondition(NSString* java_script_condition) {
kFormElementUsername, result];
XCTAssertTrue(WaitForJavaScriptCondition(javaScriptCondition));
}
#endif
@end
......@@ -134,6 +134,7 @@ source_set("eg2_tests") {
":feature_flags",
"//base",
"//ios/chrome/app/strings",
"//ios/chrome/browser/ui/autofill:eg_test_support+eg2",
"//ios/chrome/test/earl_grey:eg_test_support+eg2",
"//ios/testing/earl_grey:eg_test_support+eg2",
"//ios/third_party/earl_grey2:test_lib",
......
......@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "base/ios/ios_util.h"
#import "ios/chrome/browser/ui/autofill/autofill_app_interface.h"
#import "ios/chrome/browser/ui/settings/autofill/features.h"
#include "ios/chrome/grit/ios_strings.h"
#import "ios/chrome/test/earl_grey/chrome_earl_grey.h"
......@@ -107,7 +108,7 @@ id<GREYMatcher> CardNumberIconView(NSString* icon_type) {
}
- (void)tearDown {
[ChromeEarlGrey clearCreditCards];
[AutofillAppInterface clearCreditCardStore];
[super tearDown];
}
......@@ -230,7 +231,7 @@ id<GREYMatcher> CardNumberIconView(NSString* icon_type) {
// and the new card number appears on the Autofill Credit Card 'Payment Methods'
// screen.
- (void)testAddButtonOnValidNumber {
[ChromeEarlGrey clearCreditCards];
[AutofillAppInterface clearCreditCardStore];
[[EarlGrey selectElementWithMatcher:CardNumberTextField()]
performAction:grey_typeText(@"4111111111111111")];
[[EarlGrey selectElementWithMatcher:MonthOfExpiryTextField()]
......
......@@ -370,11 +370,6 @@ id ExecuteJavaScript(NSString* javascript, NSError* __autoreleasing* out_error);
// doesn't specify a title.
- (NSString*)displayTitleForURL:(const GURL&)URL;
#pragma mark - Autofill Utilities (EG2)
// Removes the stored credit cards.
- (void)clearCreditCards;
#pragma mark - JavaScript Utilities (EG2)
// Executes JavaScript on current WebState, and waits for either the completion
......
......@@ -669,12 +669,6 @@ GREY_STUB_CLASS_IN_APP_MAIN_QUEUE(ChromeEarlGreyAppInterface)
return [ChromeEarlGreyAppInterface displayTitleForURL:spec];
}
#pragma mark - Autofill Utilities (EG2)
- (void)clearCreditCards {
[ChromeEarlGreyAppInterface clearCreditCards];
}
#pragma mark - Accessibility Utilities (EG2)
- (void)verifyAccessibilityForCurrentScreen {
......
......@@ -219,11 +219,6 @@
// doesn't specify a title.
+ (NSString*)displayTitleForURL:(NSString*)URL;
#pragma mark - Autofill Utilities (EG2)
// Removes the stored credit cards.
+ (void)clearCreditCards;
#pragma mark - Sync Utilities (EG2)
// Clears fake sync server data.
......
......@@ -376,17 +376,6 @@ using chrome_test_util::BrowserCommandDispatcherForMainBVC;
web::GetDisplayTitleForUrl(GURL(base::SysNSStringToUTF8(URL))));
}
#pragma mark - Autofill Utilities (EG2)
+ (void)clearCreditCards {
autofill::PersonalDataManager* personalDataManager =
autofill::PersonalDataManagerFactory::GetForBrowserState(
chrome_test_util::GetOriginalBrowserState());
for (const auto* creditCard : personalDataManager->GetCreditCards()) {
personalDataManager->RemoveByGUID(creditCard->guid());
}
}
#pragma mark - Sync Utilities (EG2)
+ (int)numberOfSyncEntitiesWithType:(syncer::ModelType)type {
......
......@@ -377,6 +377,9 @@ id<GREYMatcher> SettingsPasswordSearchMatcher();
// Returns a matcher for the profiles settings collection view.
id<GREYMatcher> SettingsProfileMatcher();
// Returns a matcher for the credit card settings collection view.
id<GREYMatcher> SettingsCreditCardMatcher();
// Returns a matcher for an autofill suggestion view.
id<GREYMatcher> AutofillSuggestionViewMatcher();
......@@ -428,6 +431,23 @@ id<GREYMatcher> SettingsProfileMatcher();
// Returns a matcher for the ProfileTableView window.
id<GREYMatcher> ManualFallbackProfileTableViewWindowMatcher();
// Returns a matcher for the credit card icon in the keyboard accessory bar.
id<GREYMatcher> ManualFallbackCreditCardIconMatcher();
// Returns a matcher for the credit card table view in manual fallback.
id<GREYMatcher> ManualFallbackCreditCardTableViewMatcher();
// Returns a matcher for the button to open password settings in manual
// fallback.
id<GREYMatcher> ManualFallbackManageCreditCardsMatcher();
// Returns a matcher for the button to add credit cards settings in manual
// fallback.
id<GREYMatcher> ManualFallbackAddCreditCardsMatcher();
// Returns a matcher for the CreditCardTableView window.
id<GREYMatcher> ManualFallbackCreditCardTableViewWindowMatcher();
} // namespace chrome_test_util
#endif // IOS_CHROME_TEST_EARL_GREY_CHROME_MATCHERS_H_
......@@ -471,6 +471,10 @@ id<GREYMatcher> SettingsProfileMatcher() {
return [ChromeMatchersAppInterface settingsProfileMatcher];
}
id<GREYMatcher> SettingsCreditCardMatcher() {
return [ChromeMatchersAppInterface settingsCreditCardMatcher];
}
id<GREYMatcher> AutofillSuggestionViewMatcher() {
return [ChromeMatchersAppInterface autofillSuggestionViewMatcher];
}
......@@ -536,4 +540,27 @@ id<GREYMatcher> ManualFallbackProfileTableViewWindowMatcher() {
[ChromeMatchersAppInterface manualFallbackProfileTableViewWindowMatcher];
}
id<GREYMatcher> ManualFallbackCreditCardIconMatcher() {
return [ChromeMatchersAppInterface manualFallbackCreditCardIconMatcher];
}
id<GREYMatcher> ManualFallbackCreditCardTableViewMatcher() {
return [ChromeMatchersAppInterface manualFallbackCreditCardTableViewMatcher];
}
// Returns a matcher for the button to open password settings in manual
id<GREYMatcher> ManualFallbackManageCreditCardsMatcher() {
return [ChromeMatchersAppInterface manualFallbackManageCreditCardsMatcher];
}
// Returns a matcher for the button to add credit cards settings in manual
id<GREYMatcher> ManualFallbackAddCreditCardsMatcher() {
return [ChromeMatchersAppInterface manualFallbackAddCreditCardsMatcher];
}
id<GREYMatcher> ManualFallbackCreditCardTableViewWindowMatcher() {
return [ChromeMatchersAppInterface
manualFallbackCreditCardTableViewWindowMatcher];
}
} // namespace chrome_test_util
......@@ -382,6 +382,9 @@
// Returns a matcher for the profiles settings collection view.
+ (id<GREYMatcher>)settingsProfileMatcher;
// Returns a matcher for the credit card settings collection view.
+ (id<GREYMatcher>)settingsCreditCardMatcher;
// Returns a matcher for an autofill suggestion view.
+ (id<GREYMatcher>)autofillSuggestionViewMatcher;
......@@ -430,6 +433,23 @@
// Returns a matcher for the ProfileTableView window.
+ (id<GREYMatcher>)manualFallbackProfileTableViewWindowMatcher;
// Returns a matcher for the credit card icon in the keyboard accessory bar.
+ (id<GREYMatcher>)manualFallbackCreditCardIconMatcher;
// Returns a matcher for the credit card table view in manual fallback.
+ (id<GREYMatcher>)manualFallbackCreditCardTableViewMatcher;
// Returns a matcher for the button to open password settings in manual
// fallback.
+ (id<GREYMatcher>)manualFallbackManageCreditCardsMatcher;
// Returns a matcher for the button to add credit cards settings in manual
// fallback.
+ (id<GREYMatcher>)manualFallbackAddCreditCardsMatcher;
// Returns a matcher for the CreditCardTableView window.
+ (id<GREYMatcher>)manualFallbackCreditCardTableViewWindowMatcher;
@end
#endif // IOS_CHROME_TEST_EARL_GREY_CHROME_MATCHERS_APP_INTERFACE_H_
......@@ -11,6 +11,9 @@
#import "ios/chrome/browser/ui/authentication/cells/signin_promo_view.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/address_mediator.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/address_view_controller.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/card_coordinator.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/card_mediator.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/card_view_controller.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_accessory_view_controller.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_password_cell.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_password_mediator.h"
......@@ -748,6 +751,10 @@ UIView* SubviewWithAccessibilityIdentifier(NSString* accessibility_id,
return grey_accessibilityID(kAutofillProfileTableViewID);
}
+ (id<GREYMatcher>)settingsCreditCardMatcher {
return grey_accessibilityID(kAutofillCreditCardTableViewId);
}
+ (id<GREYMatcher>)autofillSuggestionViewMatcher {
return grey_accessibilityID(kFormSuggestionLabelAccessibilityIdentifier);
}
......@@ -825,4 +832,31 @@ UIView* SubviewWithAccessibilityIdentifier(NSString* accessibility_id,
grey_descendant([self manualFallbackProfilesTableViewMatcher]);
return grey_allOf(classMatcher, parentMatcher, nil);
}
+ (id<GREYMatcher>)manualFallbackCreditCardIconMatcher {
return grey_accessibilityID(
manual_fill::AccessoryCreditCardAccessibilityIdentifier);
}
+ (id<GREYMatcher>)manualFallbackCreditCardTableViewMatcher {
return grey_accessibilityID(
manual_fill::CardTableViewAccessibilityIdentifier);
}
+ (id<GREYMatcher>)manualFallbackManageCreditCardsMatcher {
return grey_accessibilityID(manual_fill::ManageCardsAccessibilityIdentifier);
}
+ (id<GREYMatcher>)manualFallbackAddCreditCardsMatcher {
return grey_accessibilityID(
manual_fill::kAddCreditCardsAccessibilityIdentifier);
}
+ (id<GREYMatcher>)manualFallbackCreditCardTableViewWindowMatcher {
id<GREYMatcher> classMatcher = grey_kindOfClass([UIWindow class]);
id<GREYMatcher> parentMatcher =
grey_descendant([self manualFallbackCreditCardTableViewMatcher]);
return grey_allOf(classMatcher, parentMatcher, nil);
}
@end
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