Commit 089ce14f authored by mathp's avatar mathp Committed by Commit bot

[Payment Request] Mark some tests as flaky, and attempt fixes

Since crrev.com/2561373002 was submitted, cancelling out of the editor
will now go back to the "ready to pay" state with an item still
selected (given there was one selected prior to entering the editor).

This made a bunch of tests flaky, so this change
- marks known flaky tests as FlakyTest
- Attempts to fix some tests with mReadyToPay, although this is just
  speculative at this point; a more comprehensive fix is in order.

BUG=673371
TEST=PaymentRequest* (java)

Review-Url: https://codereview.chromium.org/2571493002
Cr-Commit-Position: refs/heads/master@{#438182}
parent 04d636d1
......@@ -9,8 +9,8 @@ import android.test.suitebuilder.annotation.MediumTest;
import org.chromium.base.ThreadUtils;
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.base.test.util.DisabledTest;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.FlakyTest;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.autofill.AutofillTestHelper;
import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile;
......@@ -53,9 +53,9 @@ public class PaymentRequestContactDetailsTest extends PaymentRequestTestBase {
}
/** Attempt to add invalid contact information and cancel the transaction. */
// @MediumTest
// @Feature({"Payments"})
@DisabledTest
@MediumTest
@FlakyTest(message = "crbug.com/673371")
@Feature({"Payments"})
public void testAddInvalidContactAndCancel()
throws InterruptedException, ExecutionException, TimeoutException {
triggerUIAndWait(mReadyToPay);
......@@ -63,7 +63,7 @@ public class PaymentRequestContactDetailsTest extends PaymentRequestTestBase {
clickInContactInfoAndWait(R.id.payments_add_option_button, mReadyToEdit);
setTextInEditorAndWait(new String[] {"", "+++", "jane.jones"}, mEditorTextUpdate);
clickInEditorAndWait(R.id.payments_edit_done_button, mEditorValidationError);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyForInput);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyToPay);
clickAndWait(R.id.close_button, mDismissed);
expectResultContains(new String[] {"Request cancelled"});
}
......@@ -105,7 +105,7 @@ public class PaymentRequestContactDetailsTest extends PaymentRequestTestBase {
});
mReadyToEdit.waitForCallback(callCount);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyForInput);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyToPay);
clickAndWait(R.id.close_button, mDismissed);
expectResultContains(new String[] {"Request cancelled"});
}
......@@ -144,7 +144,7 @@ public class PaymentRequestContactDetailsTest extends PaymentRequestTestBase {
clickInContactInfoAndWait(R.id.payments_open_editor_pencil_button, mReadyToEdit);
// Cancel the editor.
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyForInput);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyToPay);
// Expect the row to still be selected in the Contact Details section.
expectContactDetailsRowIsSelected(0);
......@@ -161,7 +161,7 @@ public class PaymentRequestContactDetailsTest extends PaymentRequestTestBase {
clickInContactInfoAndWait(R.id.payments_add_option_button, mReadyToEdit);
// Cancel the editor.
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyForInput);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyToPay);
// Expect the existing row to still be selected in the Contact Details section.
expectContactDetailsRowIsSelected(0);
......@@ -187,7 +187,7 @@ public class PaymentRequestContactDetailsTest extends PaymentRequestTestBase {
});
mReadyToEdit.waitForCallback(callCount);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyForInput);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyToPay);
clickAndWait(R.id.close_button, mDismissed);
expectResultContains(new String[] {"Request cancelled"});
}
......
......@@ -68,7 +68,7 @@ public class PaymentRequestDynamicShippingSingleAddressTest extends PaymentReque
}
/** Attempt to add an invalid address and cancel the transaction. */
@FlakyTest(message = "crbug.com/673136")
@FlakyTest(message = "crbug.com/673371")
@Feature({"Payments"})
public void testAddInvalidAddressAndCancel()
throws InterruptedException, ExecutionException, TimeoutException {
......@@ -76,7 +76,7 @@ public class PaymentRequestDynamicShippingSingleAddressTest extends PaymentReque
clickInShippingSummaryAndWait(R.id.payments_section, mReadyForInput);
clickInShippingAddressAndWait(R.id.payments_add_option_button, mReadyToEdit);
clickInEditorAndWait(R.id.payments_edit_done_button, mEditorValidationError);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyForInput);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyToPay);
clickAndWait(R.id.close_button, mDismissed);
expectResultContains(new String[] {"Request cancelled"});
}
......@@ -105,6 +105,7 @@ public class PaymentRequestDynamicShippingSingleAddressTest extends PaymentReque
/** Quickly pressing "add address" and then [X] should not crash. */
@MediumTest
@FlakyTest(message = "crbug.com/673371")
@Feature({"Payments"})
public void testQuickAddAddressAndCloseShouldNotCrash()
throws InterruptedException, ExecutionException, TimeoutException {
......@@ -153,6 +154,7 @@ public class PaymentRequestDynamicShippingSingleAddressTest extends PaymentReque
/** Quickly pressing "add address" and then "cancel" should not crash. */
@MediumTest
@FlakyTest(message = "crbug.com/673371")
@Feature({"Payments"})
public void testQuickAddAddressAndCancelShouldNotCrash()
throws InterruptedException, ExecutionException, TimeoutException {
......
......@@ -9,6 +9,7 @@ import android.test.suitebuilder.annotation.MediumTest;
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.FlakyTest;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.autofill.AutofillTestHelper;
import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile;
......@@ -52,6 +53,7 @@ public class PaymentRequestEmailTest extends PaymentRequestTestBase {
/** Attempt to add an invalid email address and cancel the transaction. */
@MediumTest
@FlakyTest(message = "crbug.com/673371")
@Feature({"Payments"})
public void testAddInvalidEmailAndCancel()
throws InterruptedException, ExecutionException, TimeoutException {
......@@ -60,7 +62,7 @@ public class PaymentRequestEmailTest extends PaymentRequestTestBase {
clickInContactInfoAndWait(R.id.payments_add_option_button, mReadyToEdit);
setTextInEditorAndWait(new String[] {"jane.jones"}, mEditorTextUpdate);
clickInEditorAndWait(R.id.payments_edit_done_button, mEditorValidationError);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyForInput);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyToPay);
clickAndWait(R.id.close_button, mDismissed);
expectResultContains(new String[] {"Request cancelled"});
}
......
......@@ -10,6 +10,7 @@ import android.test.suitebuilder.annotation.MediumTest;
import org.chromium.base.ThreadUtils;
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.FlakyTest;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.autofill.AutofillTestHelper;
import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile;
......@@ -55,6 +56,7 @@ public class PaymentRequestFreeShippingTest extends PaymentRequestTestBase {
/** Attempt to add an invalid address and cancel the transaction. */
@MediumTest
@FlakyTest(message = "crbug.com/673371")
@Feature({"Payments"})
public void testAddInvalidAddressAndCancel()
throws InterruptedException, ExecutionException, TimeoutException {
......@@ -62,7 +64,7 @@ public class PaymentRequestFreeShippingTest extends PaymentRequestTestBase {
clickInShippingSummaryAndWait(R.id.payments_section, mReadyForInput);
clickInShippingAddressAndWait(R.id.payments_add_option_button, mReadyToEdit);
clickInEditorAndWait(R.id.payments_edit_done_button, mEditorValidationError);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyForInput);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyToPay);
clickAndWait(R.id.close_button, mDismissed);
expectResultContains(new String[] {"Request cancelled"});
}
......@@ -124,7 +126,7 @@ public class PaymentRequestFreeShippingTest extends PaymentRequestTestBase {
});
mReadyToEdit.waitForCallback(callCount);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyForInput);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyToPay);
clickAndWait(R.id.close_button, mDismissed);
expectResultContains(new String[] {"Request cancelled"});
}
......@@ -154,6 +156,7 @@ public class PaymentRequestFreeShippingTest extends PaymentRequestTestBase {
/** Quickly pressing on "add address" and then "cancel" should not crash. */
@MediumTest
@FlakyTest(message = "crbug.com/673371")
@Feature({"Payments"})
public void testQuickAddAddressAndCancelShouldNotCrash()
throws InterruptedException, ExecutionException, TimeoutException {
......@@ -172,7 +175,7 @@ public class PaymentRequestFreeShippingTest extends PaymentRequestTestBase {
});
mReadyToEdit.waitForCallback(callCount);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyForInput);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyToPay);
clickAndWait(R.id.close_button, mDismissed);
expectResultContains(new String[] {"Request cancelled"});
}
......
......@@ -41,11 +41,8 @@ public class PaymentRequestIncompleteContactDetailsTest extends PaymentRequestTe
}
/** Attempt to update the contact information with invalid data and cancel the transaction. */
/*
* @MediumTest
* Bug=crbug.com/673299
*/
@FlakyTest
@MediumTest
@FlakyTest(message = "crbug.com/673371")
@Feature({"Payments"})
public void testEditIncompleteContactAndCancel()
throws InterruptedException, ExecutionException, TimeoutException {
......@@ -54,7 +51,7 @@ public class PaymentRequestIncompleteContactDetailsTest extends PaymentRequestTe
clickInContactInfoAndWait(R.id.payments_first_radio_button, mReadyToEdit);
setTextInEditorAndWait(new String[] {"", "---", "jane.jones"}, mEditorTextUpdate);
clickInEditorAndWait(R.id.payments_edit_done_button, mEditorValidationError);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyForInput);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyToPay);
clickAndWait(R.id.close_button, mDismissed);
expectResultContains(new String[] {"Request cancelled"});
}
......
......@@ -8,6 +8,7 @@ import android.content.DialogInterface;
import android.test.suitebuilder.annotation.MediumTest;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.FlakyTest;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.autofill.AutofillTestHelper;
import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile;
......@@ -41,6 +42,7 @@ public class PaymentRequestIncompleteEmailTest extends PaymentRequestTestBase {
/** Attempt to update the email with invalid data and cancel the transaction. */
@MediumTest
@FlakyTest(message = "crbug.com/673371")
@Feature({"Payments"})
public void testEditIncompleteEmailAndCancel()
throws InterruptedException, ExecutionException, TimeoutException {
......@@ -49,7 +51,7 @@ public class PaymentRequestIncompleteEmailTest extends PaymentRequestTestBase {
clickInContactInfoAndWait(R.id.payments_first_radio_button, mReadyToEdit);
setTextInEditorAndWait(new String[] {"gmail.com"}, mEditorTextUpdate);
clickInEditorAndWait(R.id.payments_edit_done_button, mEditorValidationError);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyForInput);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyToPay);
clickAndWait(R.id.close_button, mDismissed);
expectResultContains(new String[] {"Request cancelled"});
}
......
......@@ -7,6 +7,7 @@ package org.chromium.chrome.browser.payments;
import android.test.suitebuilder.annotation.MediumTest;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.FlakyTest;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.autofill.AutofillTestHelper;
import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile;
......@@ -42,6 +43,7 @@ public class PaymentRequestIncompletePhoneTest extends PaymentRequestTestBase {
/** Attempt to update the phone number with invalid data and cancel the transaction. */
@MediumTest
@FlakyTest(message = "crbug.com/673371")
@Feature({"Payments"})
public void testEditIncompletePhoneAndCancel()
throws InterruptedException, ExecutionException, TimeoutException {
......@@ -50,7 +52,7 @@ public class PaymentRequestIncompletePhoneTest extends PaymentRequestTestBase {
clickInContactInfoAndWait(R.id.payments_first_radio_button, mReadyToEdit);
setTextInEditorAndWait(new String[] {"---"}, mEditorTextUpdate);
clickInEditorAndWait(R.id.payments_edit_done_button, mEditorValidationError);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyForInput);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyToPay);
clickAndWait(R.id.close_button, mDismissed);
expectResultContains(new String[] {"Request cancelled"});
}
......
......@@ -9,6 +9,7 @@ import android.test.suitebuilder.annotation.MediumTest;
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.FlakyTest;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.autofill.AutofillTestHelper;
import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile;
......@@ -52,6 +53,7 @@ public class PaymentRequestNameTest extends PaymentRequestTestBase {
/** Attempt to add an invalid payer name and cancel the transaction. */
@MediumTest
@FlakyTest(message = "crbug.com/673371")
@Feature({"Payments"})
public void testAddInvalidNameAndCancel()
throws InterruptedException, ExecutionException, TimeoutException {
......@@ -60,7 +62,7 @@ public class PaymentRequestNameTest extends PaymentRequestTestBase {
clickInContactInfoAndWait(R.id.payments_add_option_button, mReadyToEdit);
setTextInEditorAndWait(new String[] {""}, mEditorTextUpdate);
clickInEditorAndWait(R.id.payments_edit_done_button, mEditorValidationError);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyForInput);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyToPay);
clickAndWait(R.id.close_button, mDismissed);
expectResultContains(new String[] {"Request cancelled"});
}
......
......@@ -98,17 +98,15 @@ public class PaymentRequestNoShippingTest extends PaymentRequestTestBase {
"123"});
}
/**
* Attempt to add an invalid credit card number and cancel payment.
* @MediumTest
*/
@FlakyTest(message = "crbug.com/626289")
/** Attempt to add an invalid credit card number and cancel payment. */
@MediumTest
@FlakyTest(message = "crbug.com/673371")
@Feature({"Payments"})
public void testAddInvalidCardNumberAndCancel()
throws InterruptedException, ExecutionException, TimeoutException {
fillNewCardForm("123", "Bob", DECEMBER, NEXT_YEAR, FIRST_BILLING_ADDRESS);
clickInCardEditorAndWait(R.id.payments_edit_done_button, mEditorValidationError);
clickInCardEditorAndWait(R.id.payments_edit_cancel_button, mReadyForInput);
clickInCardEditorAndWait(R.id.payments_edit_cancel_button, mReadyToPay);
clickAndWait(R.id.close_button, mDismissed);
expectResultContains(new String[] {"Request cancelled"});
}
......@@ -123,17 +121,15 @@ public class PaymentRequestNoShippingTest extends PaymentRequestTestBase {
new int[] {month, year, billingAddress}, mBillingAddressChangeProcessed);
}
/**
* Attempt to add a credit card with an empty name on card and cancel payment.
* @MediumTest
*/
@FlakyTest(message = "crbug.com/626289")
/** Attempt to add a credit card with an empty name on card and cancel payment. */
@MediumTest
@FlakyTest(message = "crbug.com/673371")
@Feature({"Payments"})
public void testAddEmptyNameOnCardAndCancel()
throws InterruptedException, ExecutionException, TimeoutException {
fillNewCardForm("5454-5454-5454-5454", "", DECEMBER, NEXT_YEAR, FIRST_BILLING_ADDRESS);
clickInCardEditorAndWait(R.id.payments_edit_done_button, mEditorValidationError);
clickInCardEditorAndWait(R.id.payments_edit_cancel_button, mReadyForInput);
clickInCardEditorAndWait(R.id.payments_edit_cancel_button, mReadyToPay);
clickAndWait(R.id.close_button, mDismissed);
expectResultContains(new String[] {"Request cancelled"});
}
......@@ -216,7 +212,7 @@ public class PaymentRequestNoShippingTest extends PaymentRequestTestBase {
});
mReadyToEdit.waitForCallback(callCount);
clickInCardEditorAndWait(R.id.payments_edit_cancel_button, mReadyForInput);
clickInCardEditorAndWait(R.id.payments_edit_cancel_button, mReadyToPay);
clickAndWait(R.id.close_button, mDismissed);
expectResultContains(new String[] {"Request cancelled"});
}
......@@ -264,7 +260,7 @@ public class PaymentRequestNoShippingTest extends PaymentRequestTestBase {
});
mReadyToEdit.waitForCallback(callCount);
clickInCardEditorAndWait(R.id.payments_edit_cancel_button, mReadyForInput);
clickInCardEditorAndWait(R.id.payments_edit_cancel_button, mReadyToPay);
clickAndWait(R.id.close_button, mDismissed);
expectResultContains(new String[] {"Request cancelled"});
}
......
......@@ -96,7 +96,7 @@ public class PaymentRequestPaymentAppAndCardsTest extends PaymentRequestTestBase
clickInPaymentMethodAndWait(R.id.payments_add_option_button, mReadyToEdit);
// Cancel the editor.
clickInCardEditorAndWait(R.id.payments_edit_cancel_button, mReadyForInput);
clickInCardEditorAndWait(R.id.payments_edit_cancel_button, mReadyToPay);
// Expect the existing row to still be selected in the Shipping Address section.
expectPaymentMethodRowIsSelected(0);
......@@ -113,7 +113,7 @@ public class PaymentRequestPaymentAppAndCardsTest extends PaymentRequestTestBase
clickInPaymentMethodAndWait(R.id.payments_open_editor_pencil_button, mReadyToEdit);
// Cancel the editor.
clickInCardEditorAndWait(R.id.payments_edit_cancel_button, mReadyForInput);
clickInCardEditorAndWait(R.id.payments_edit_cancel_button, mReadyToPay);
// Expect the row to still be selected in the Shipping Address section.
expectPaymentMethodRowIsSelected(0);
......
......@@ -9,6 +9,7 @@ import android.test.suitebuilder.annotation.MediumTest;
import org.chromium.base.metrics.RecordHistogram;
import org.chromium.base.test.util.Feature;
import org.chromium.base.test.util.FlakyTest;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.autofill.AutofillTestHelper;
import org.chromium.chrome.browser.autofill.PersonalDataManager.AutofillProfile;
......@@ -52,6 +53,7 @@ public class PaymentRequestPhoneTest extends PaymentRequestTestBase {
/** Attempt to add an invalid phone number and cancel the transaction. */
@MediumTest
@FlakyTest(message = "crbug.com/673371")
@Feature({"Payments"})
public void testAddInvalidPhoneAndCancel()
throws InterruptedException, ExecutionException, TimeoutException {
......@@ -60,7 +62,7 @@ public class PaymentRequestPhoneTest extends PaymentRequestTestBase {
clickInContactInfoAndWait(R.id.payments_add_option_button, mReadyToEdit);
setTextInEditorAndWait(new String[] {"+++"}, mEditorTextUpdate);
clickInEditorAndWait(R.id.payments_edit_done_button, mEditorValidationError);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyForInput);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyToPay);
clickAndWait(R.id.close_button, mDismissed);
expectResultContains(new String[] {"Request cancelled"});
}
......
......@@ -125,7 +125,7 @@ public class PaymentRequestShippingAddressTest extends PaymentRequestTestBase {
clickInShippingAddressAndWait(R.id.payments_open_editor_pencil_button, mReadyToEdit);
// Cancel the editor.
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyForInput);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyToPay);
// Expect the row to still be selected in the Shipping Address section.
expectShippingAddressRowIsSelected(0);
......@@ -142,7 +142,7 @@ public class PaymentRequestShippingAddressTest extends PaymentRequestTestBase {
clickInShippingAddressAndWait(R.id.payments_add_option_button, mReadyToEdit);
// Cancel the editor.
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyForInput);
clickInEditorAndWait(R.id.payments_edit_cancel_button, mReadyToPay);
// Expect the existing row to still be selected in the Shipping Address section.
expectShippingAddressRowIsSelected(0);
......
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