Commit e0803b96 authored by Eric Aleshire's avatar Eric Aleshire Committed by Commit Bot

Change a form in the autofill credit card upload form HTML page to be more accurate.

Instead of using a "fake" select field, we integrate it more naturally as per
Moe's comments by implementing a select for the month field. See:
https://chromium-review.googlesource.com/c/chromium/src/+/1240913

Bug: 881096
Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
Change-Id: I467c0c9c33ef4f4239f39743672d22de6bf66d06
Reviewed-on: https://chromium-review.googlesource.com/1256067Reviewed-by: default avatarMoe Ahmadi <mahmadi@chromium.org>
Reviewed-by: default avatarEric Noyau <noyau@chromium.org>
Commit-Queue: ericale <ericale@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595896}
parent 460eaa32
...@@ -22,18 +22,24 @@ found in the LICENSE file. ...@@ -22,18 +22,24 @@ found in the LICENSE file.
<div>Name on card: <input type="text" name="name_cc" autocomplete="cc-name"></div> <div>Name on card: <input type="text" name="name_cc" autocomplete="cc-name"></div>
<div>Credit card number: <input type="text" name="cc_number" autocomplete="cc-number"></div> <div>Credit card number: <input type="text" name="cc_number" autocomplete="cc-number"></div>
<div>Expiry Date: <div>Expiry Date:
<input type="text" name="cc_month_exp" placeholder="MM" autocomplete="cc-exp-month"> <select name="cc_month_exp" autocomplete="cc-month-exp">
<option value="1">01</option>
<option value="2">02</option>
<option value="3">03</option>
<option value="4">04</option>
<option value="5">05</option>
<option value="6">06</option>
<option value="7">07</option>
<option value="8">08</option>
<option value="9">09</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>
/ /
<input type="text" name="cc_year_exp" placeholder="YYYY" autocomplete="cc-exp-year"></div> <input type="text" name="cc_year_exp" placeholder="YYYY" autocomplete="cc-exp-year"></div>
<div>CVC: <input name="cc_cvc" autocomplete="cc-csc"></div> <div>CVC: <input name="cc_cvc" autocomplete="cc-csc"></div>
<hr> <hr>
Test Dropdown Field: <select id="test_dropdown">
<option value="dropdown_1">Test Option 1</option>
<option value="dropdown_2">Test Option 2</option>
<option value="dropdown_3">Test Option 3</option>
<option value="dropdown_4">Test Option 4</option>
</select>
<hr>
<button id="fill_form" type="button">Fill entire form with default (MasterCard) values</button> <button id="fill_form" type="button">Fill entire form with default (MasterCard) values</button>
<button id="fill_form_delay" type="button">Fill out the name field after 3 seconds</button> <button id="fill_form_delay" type="button">Fill out the name field after 3 seconds</button>
<button id="fill_invalid_cvc" type="button">Fill the CVC field with an invalid value</button> <button id="fill_invalid_cvc" type="button">Fill the CVC field with an invalid value</button>
......
...@@ -79,15 +79,15 @@ const char kTestPageUrl[] = ...@@ -79,15 +79,15 @@ const char kTestPageUrl[] =
base::DictionaryValue selectDict = base::DictionaryValue(); base::DictionaryValue selectDict = base::DictionaryValue();
selectDict.SetKey("type", base::Value("select")); selectDict.SetKey("type", base::Value("select"));
selectDict.SetKey("selector", base::Value("//*[@id=\"test_dropdown\"]")); selectDict.SetKey("selector", base::Value("//*[@name=\"cc_month_exp\"]"));
selectDict.SetKey("index", base::Value(1)); selectDict.SetKey("index", base::Value(5));
AutomationAction* selectAction = AutomationAction* selectAction =
[AutomationAction actionWithValueDictionary:selectDict]; [AutomationAction actionWithValueDictionary:selectDict];
[selectAction execute]; [selectAction execute];
NSError* error; NSError* error;
id result = chrome_test_util::ExecuteJavaScript( id result = chrome_test_util::ExecuteJavaScript(
@"document.getElementById(\"test_dropdown\").value == \"dropdown_2\"", @"document.getElementsByName(\"cc_month_exp\")[0].value == \"6\"",
&error); &error);
GREYAssert([result boolValue] && !error, GREYAssert([result boolValue] && !error,
@"Select automation action did not change the dropdown."); @"Select automation action did not change the dropdown.");
......
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