| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.payments; | 5 package org.chromium.chrome.browser.payments; |
| 6 | 6 |
| 7 import android.content.DialogInterface; | |
| 8 import android.test.suitebuilder.annotation.MediumTest; | 7 import android.test.suitebuilder.annotation.MediumTest; |
| 9 | 8 |
| 10 import org.chromium.chrome.R; | 9 import org.chromium.chrome.R; |
| 11 import org.chromium.chrome.browser.autofill.AutofillTestHelper; | 10 import org.chromium.chrome.browser.autofill.AutofillTestHelper; |
| 12 import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile; | 11 import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile; |
| 13 import org.chromium.chrome.browser.autofill.PersonalDataManager.CreditCard; | 12 import org.chromium.chrome.browser.autofill.PersonalDataManager.CreditCard; |
| 14 | 13 |
| 15 import java.util.concurrent.ExecutionException; | 14 import java.util.concurrent.ExecutionException; |
| 16 import java.util.concurrent.TimeoutException; | 15 import java.util.concurrent.TimeoutException; |
| 17 | 16 |
| 18 /** | 17 /** |
| 19 * A payment integration test for a merchant that requests phone number from a u
ser that has | 18 * A payment integration test for a merchant that requests phone number from a u
ser that has |
| 20 * incomplete phone number stored on disk. | 19 * incomplete phone number stored on disk. |
| 20 * |
| 21 * TODO(rouslan): Add a test to fill in the valid phone number and submit it to
the merchant. |
| 21 */ | 22 */ |
| 22 public class PaymentRequestIncompletePhoneTest extends PaymentRequestTestBase { | 23 public class PaymentRequestIncompletePhoneTest extends PaymentRequestTestBase { |
| 23 public PaymentRequestIncompletePhoneTest() { | 24 public PaymentRequestIncompletePhoneTest() { |
| 24 // This merchant requests a phone number. | 25 // This merchant requests a phone number. |
| 25 super("payment_request_phone_test.html"); | 26 super("payment_request_phone_test.html"); |
| 26 } | 27 } |
| 27 | 28 |
| 28 @Override | 29 @Override |
| 29 public void onMainActivityStarted() | 30 public void onMainActivityStarted() |
| 30 throws InterruptedException, ExecutionException, TimeoutException { | 31 throws InterruptedException, ExecutionException, TimeoutException { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 44 throws InterruptedException, ExecutionException, TimeoutException { | 45 throws InterruptedException, ExecutionException, TimeoutException { |
| 45 triggerUIAndWait(mReadyForInput); | 46 triggerUIAndWait(mReadyForInput); |
| 46 clickInContactInfoAndWait(R.id.payments_section, mReadyForInput); | 47 clickInContactInfoAndWait(R.id.payments_section, mReadyForInput); |
| 47 clickInContactInfoAndWait(R.id.payments_first_radio_button, mReadyToEdit
); | 48 clickInContactInfoAndWait(R.id.payments_first_radio_button, mReadyToEdit
); |
| 48 setTextInEditorAndWait(new String[] {"---"}, mEditorTextUpdate); | 49 setTextInEditorAndWait(new String[] {"---"}, mEditorTextUpdate); |
| 49 clickInEditorAndWait(R.id.payments_edit_done_button, mEditorValidationEr
ror); | 50 clickInEditorAndWait(R.id.payments_edit_done_button, mEditorValidationEr
ror); |
| 50 clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyToClose); | 51 clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyToClose); |
| 51 clickAndWait(R.id.close_button, mDismissed); | 52 clickAndWait(R.id.close_button, mDismissed); |
| 52 expectResultContains(new String[] {"Request cancelled"}); | 53 expectResultContains(new String[] {"Request cancelled"}); |
| 53 } | 54 } |
| 54 | |
| 55 /** Update the phone number with valid data and provide that to the merchant
. */ | |
| 56 @MediumTest | |
| 57 public void testEditIncompletePhoneAndPay() | |
| 58 throws InterruptedException, ExecutionException, TimeoutException { | |
| 59 triggerUIAndWait(mReadyForInput); | |
| 60 clickInContactInfoAndWait(R.id.payments_section, mReadyForInput); | |
| 61 clickInContactInfoAndWait(R.id.payments_first_radio_button, mReadyToEdit
); | |
| 62 setTextInEditorAndWait(new String[] {"555-555-5555"}, mEditorTextUpdate)
; | |
| 63 clickInEditorAndWait(R.id.payments_edit_done_button, mReadyToPay); | |
| 64 clickAndWait(R.id.button_primary, mReadyForUnmaskInput); | |
| 65 setTextInCardUnmaskDialogAndWait(R.id.card_unmask_input, "123", mReadyTo
Unmask); | |
| 66 clickCardUnmaskButtonAndWait(DialogInterface.BUTTON_POSITIVE, mDismissed
); | |
| 67 expectResultContains(new String[] {"555-555-5555"}); | |
| 68 } | |
| 69 } | 55 } |
| OLD | NEW |