Chromium Code Reviews| Index: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestShippingAddressChangeTest.java |
| diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestShippingAddressChangeTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestShippingAddressChangeTest.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4bba79c3667d4a6eedf9ac3d58f193f56572bdb8 |
| --- /dev/null |
| +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestShippingAddressChangeTest.java |
| @@ -0,0 +1,63 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +package org.chromium.chrome.browser.payments; |
| + |
| +import android.content.DialogInterface; |
| +import android.support.test.filters.MediumTest; |
| + |
| +import org.chromium.base.test.util.Feature; |
| +import org.chromium.chrome.R; |
| +import org.chromium.chrome.browser.autofill.AutofillTestHelper; |
| +import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile; |
| +import org.chromium.chrome.browser.autofill.PersonalDataManager.CreditCard; |
| + |
| +import java.util.concurrent.ExecutionException; |
| +import java.util.concurrent.TimeoutException; |
| + |
| +/** |
| + * A payment integration test for a merchant that requires shipping address to calculate shipping. |
| + */ |
| +public class PaymentRequestShippingAddressChangeTest extends PaymentRequestTestBase { |
| + public PaymentRequestShippingAddressChangeTest() { |
| + // This merchant requests the shipping address first before providing any shipping options. |
| + // The result printed from this site is the shipping address change, not the Payment |
| + // Response. |
| + super("payment_request_shipping_address_change_test.html"); |
| + } |
| + |
| + @Override |
| + public void onMainActivityStarted() |
| + throws InterruptedException, ExecutionException, TimeoutException { |
| + AutofillTestHelper helper = new AutofillTestHelper(); |
| + // The user has a shipping address on disk. |
| + String billingAddressId = helper.setProfile(new AutofillProfile("", "https://example.com", |
| + true, "Jon Doe", "Google", "340 Main St", "CA", "Los Angeles", "", "90291", "", |
|
please use gerrit instead
2017/04/20 15:41:44
Let's change "CA" to "California" to verify that i
sebsg
2017/04/20 21:16:39
Done.
|
| + "US", "650-253-0000", "", "en-US")); |
| + helper.setCreditCard(new CreditCard("", "https://example.com", true, true, "Jon Doe", |
| + "4111111111111111", "1111", "12", "2050", "visa", R.drawable.pr_visa, |
| + billingAddressId, "" /* serverId */)); |
| + } |
| + |
| + /** |
| + * Tests the format of the shipping address that is sent to the merchant when the user changes |
| + * the shipping address selection. |
| + */ |
| + @MediumTest |
| + @Feature({"Payments"}) |
| + public void testShippingAddressChangeFormat() |
| + throws InterruptedException, ExecutionException, TimeoutException { |
| + // Select a shipping address and pay. |
| + triggerUIAndWait(mReadyForInput); |
| + clickInShippingSummaryAndWait(R.id.payments_section, mReadyForInput); |
| + clickOnShippingAddressSuggestionOptionAndWait(0, mReadyToPay); |
| + clickAndWait(R.id.button_primary, mReadyForUnmaskInput); |
| + setTextInCardUnmaskDialogAndWait(R.id.card_unmask_input, "123", mReadyToUnmask); |
| + clickCardUnmaskButtonAndWait(DialogInterface.BUTTON_POSITIVE, mDismissed); |
|
please use gerrit instead
2017/04/20 15:41:44
No need to type in the CVC. 'shippingoptionchange'
sebsg
2017/04/20 21:16:39
Done.
|
| + |
| + // The phone number should be formatted to the internation format. |
| + expectResultContains(new String[] {"Jon Doe", "Google", "340 Main St", "CA", "Los Angeles", |
| + "90291", "+16502530000", "US"}); |
| + } |
| +} |