summaryrefslogtreecommitdiffstats
path: root/browser/extensions/formautofill/test/browser/heuristics/third_party
diff options
context:
space:
mode:
Diffstat (limited to 'browser/extensions/formautofill/test/browser/heuristics/third_party')
-rw-r--r--browser/extensions/formautofill/test/browser/heuristics/third_party/browser.ini22
-rw-r--r--browser/extensions/formautofill/test/browser/heuristics/third_party/browser_BestBuy.js82
-rw-r--r--browser/extensions/formautofill/test/browser/heuristics/third_party/browser_CDW.js71
-rw-r--r--browser/extensions/formautofill/test/browser/heuristics/third_party/browser_CostCo.js170
-rw-r--r--browser/extensions/formautofill/test/browser/heuristics/third_party/browser_DirectAsda.js25
-rw-r--r--browser/extensions/formautofill/test/browser/heuristics/third_party/browser_Ebay.js25
-rw-r--r--browser/extensions/formautofill/test/browser/heuristics/third_party/browser_GlobalDirectAsda.js24
-rw-r--r--browser/extensions/formautofill/test/browser/heuristics/third_party/browser_HomeDepot.js77
-rw-r--r--browser/extensions/formautofill/test/browser/heuristics/third_party/browser_Lufthansa.js28
-rw-r--r--browser/extensions/formautofill/test/browser/heuristics/third_party/browser_Lush.js31
-rw-r--r--browser/extensions/formautofill/test/browser/heuristics/third_party/browser_Macys.js88
-rw-r--r--browser/extensions/formautofill/test/browser/heuristics/third_party/browser_NewEgg.js109
-rw-r--r--browser/extensions/formautofill/test/browser/heuristics/third_party/browser_OfficeDepot.js83
-rw-r--r--browser/extensions/formautofill/test/browser/heuristics/third_party/browser_QVC.js96
-rw-r--r--browser/extensions/formautofill/test/browser/heuristics/third_party/browser_Sears.js81
-rw-r--r--browser/extensions/formautofill/test/browser/heuristics/third_party/browser_Staples.js78
-rw-r--r--browser/extensions/formautofill/test/browser/heuristics/third_party/browser_Walmart.js93
17 files changed, 1183 insertions, 0 deletions
diff --git a/browser/extensions/formautofill/test/browser/heuristics/third_party/browser.ini b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser.ini
new file mode 100644
index 0000000000..6519ce9ae8
--- /dev/null
+++ b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser.ini
@@ -0,0 +1,22 @@
+[DEFAULT]
+skip-if = toolkit == 'android' # bug 1730213
+support-files =
+ ../../head.js
+ ../../../fixtures/**
+
+[browser_BestBuy.js]
+[browser_CDW.js]
+[browser_CostCo.js]
+[browser_DirectAsda.js]
+[browser_Ebay.js]
+[browser_GlobalDirectAsda.js]
+[browser_HomeDepot.js]
+[browser_Lufthansa.js]
+[browser_Lush.js]
+[browser_Macys.js]
+[browser_NewEgg.js]
+[browser_OfficeDepot.js]
+[browser_QVC.js]
+[browser_Sears.js]
+[browser_Staples.js]
+[browser_Walmart.js]
diff --git a/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_BestBuy.js b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_BestBuy.js
new file mode 100644
index 0000000000..e91c19de45
--- /dev/null
+++ b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_BestBuy.js
@@ -0,0 +1,82 @@
+/* global add_heuristic_tests */
+
+"use strict";
+
+add_heuristic_tests(
+ [
+ {
+ fixturePath: "Checkout_ShippingAddress.html",
+ expectedResult: [
+ {
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ { fieldName: "given-name" },
+ { fieldName: "family-name" },
+ { fieldName: "street-address" },
+ { fieldName: "address-level2" }, // city
+ { fieldName: "address-level1" }, // state
+ { fieldName: "postal-code" },
+ ],
+ },
+ {
+ invalid: true,
+ fields: [
+ { fieldName: "email", reason: "regex-heuristic" }, // sign-up
+ ],
+ },
+ {
+ invalid: true,
+ fields: [
+ { fieldName: "email", reason: "regex-heuristic" },
+ { fieldName: "tel", reason: "regex-heuristic" },
+ ],
+ },
+ ],
+ },
+ {
+ fixturePath: "Checkout_Payment.html",
+ expectedResult: [
+ {
+ invalid: true,
+ fields: [
+ { fieldName: "email", reason: "regex-heuristic" },
+ ],
+ },
+ {
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ { fieldName: "given-name" },
+ { fieldName: "family-name" },
+ { fieldName: "street-address" },
+ { fieldName: "address-level2" }, // city
+ { fieldName: "address-level1" }, // state
+ { fieldName: "postal-code" },
+ ],
+ },
+ {
+ invalid: true,
+ fields: [
+ { fieldName: "email", reason: "regex-heuristic" },
+ { fieldName: "tel", reason: "regex-heuristic" },
+ ],
+ },
+ ],
+ },
+ {
+ fixturePath: "SignIn.html",
+ expectedResult: [
+ {
+ invalid: true,
+ fields: [
+ { fieldName: "email", reason: "regex-heuristic" }, // sign-in
+ ],
+ },
+ ],
+ },
+ ],
+ "fixtures/third_party/BestBuy/"
+);
diff --git a/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_CDW.js b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_CDW.js
new file mode 100644
index 0000000000..feae321cb2
--- /dev/null
+++ b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_CDW.js
@@ -0,0 +1,71 @@
+/* global add_heuristic_tests */
+
+"use strict";
+
+add_heuristic_tests(
+ [
+ {
+ fixturePath: "Checkout_ShippingInfo.html",
+ expectedResult: [
+ {
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ { fieldName: "given-name" },
+ { fieldName: "family-name" },
+ { fieldName: "organization" },
+ { fieldName: "address-line1" },
+ { fieldName: "address-line2" },
+ { fieldName: "address-level2" }, // city
+ { fieldName: "address-level1" }, // state
+ { fieldName: "postal-code" },
+ { fieldName: "postal-code" }, // EXt
+ { fieldName: "email" },
+ { fieldName: "tel" },
+ { fieldName: "tel-extension" },
+ ],
+ },
+ ],
+ },
+ {
+ fixturePath: "Checkout_BillingPaymentInfo.html",
+ expectedResult: [
+ {
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ { fieldName: "given-name" },
+ { fieldName: "family-name" },
+ { fieldName: "organization" },
+ { fieldName: "address-line1" },
+ { fieldName: "address-line2" },
+ { fieldName: "address-level2" }, // city
+ { fieldName: "address-level1" }, // state
+ { fieldName: "postal-code" },
+ { fieldName: "postal-code" }, // Ext
+ ],
+ },
+ {
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ { fieldName: "cc-type" }, // ac-off
+ { fieldName: "cc-number", reason: "fathom" }, // ac-off
+ { fieldName: "cc-exp-month" },
+ { fieldName: "cc-exp-year" },
+ // {fieldName: "cc-csc"},
+ ],
+ },
+ ],
+ },
+ {
+ fixturePath: "Checkout_Logon.html",
+ expectedResult: [
+ ],
+ },
+ ],
+ "fixtures/third_party/CDW/"
+);
diff --git a/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_CostCo.js b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_CostCo.js
new file mode 100644
index 0000000000..c83973b3c9
--- /dev/null
+++ b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_CostCo.js
@@ -0,0 +1,170 @@
+/* global add_heuristic_tests */
+
+"use strict";
+
+add_heuristic_tests(
+ [
+ {
+ fixturePath: "ShippingAddress.html",
+ expectedResult: [
+ {
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ { fieldName: "given-name" },
+ { fieldName: "additional-name" }, // middle-name initial
+ { fieldName: "family-name" },
+ { fieldName: "organization" },
+ { fieldName: "country" },
+ { fieldName: "address-line1" },
+ { fieldName: "address-line2" },
+ { fieldName: "address-level2" }, // city
+ { fieldName: "address-level1" }, // state
+ { fieldName: "postal-code" },
+ { fieldName: "tel" },
+ { fieldName: "email" },
+ ],
+ },
+ {
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ { fieldName: "given-name" },
+ { fieldName: "additional-name" }, // middle-name initial
+ { fieldName: "family-name" },
+ { fieldName: "organization" },
+ { fieldName: "country" },
+ { fieldName: "address-line1" },
+ { fieldName: "address-line2" },
+ { fieldName: "address-level2" }, // city
+ { fieldName: "address-level1" }, // state
+ { fieldName: "postal-code" },
+ { fieldName: "tel" },
+ { fieldName: "email" },
+ ],
+ },
+ {
+ invalid: true,
+ fields: [
+ { fieldName: "email", reason: "regex-heuristic" },
+ ],
+ },
+ ],
+ },
+ {
+ fixturePath: "Payment.html",
+ expectedResult: [
+ {
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ { fieldName: "cc-type" }, // ac-off
+ { fieldName: "cc-number", reason: "fathom" }, // ac-off
+ { fieldName: "cc-exp-month" },
+ { fieldName: "cc-exp-year" },
+ // { fieldName: "cc-csc"}, // ac-off
+ { fieldName: "cc-name", reason: "fathom" }, // ac-off
+ ],
+ },
+ {
+ invalid: true, // confidence is not high enough
+ fields: [
+ { fieldName: "cc-number", reason: "fathom" }, // ac-off
+ ],
+ },
+ {
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ { fieldName: "given-name" },
+ { fieldName: "additional-name" }, // middle-name initial
+ { fieldName: "family-name" },
+ { fieldName: "organization" },
+ { fieldName: "country" },
+ { fieldName: "address-line1" },
+ { fieldName: "address-line2" },
+ { fieldName: "address-level2" }, // city
+ { fieldName: "address-level1" }, // state
+ { fieldName: "postal-code" },
+ { fieldName: "tel" },
+ { fieldName: "email" },
+ ],
+ },
+ {
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ { fieldName: "given-name" },
+ { fieldName: "additional-name" }, // middle-name initial
+ { fieldName: "family-name" },
+ { fieldName: "organization" },
+ { fieldName: "country" },
+ { fieldName: "address-line1" },
+ { fieldName: "address-line2" },
+ { fieldName: "address-level2" },
+ { fieldName: "address-level1" }, // state
+ { fieldName: "postal-code" },
+ { fieldName: "tel" },
+ { fieldName: "email" },
+ ],
+ },
+ {
+ invalid: true,
+ fields: [
+ { fieldName: "email", reason: "regex-heuristic" },
+ ],
+ },
+ ],
+ },
+ {
+ fixturePath: "SignIn.html",
+ expectedResult: [
+ {
+ invalid: true,
+ fields: [
+ { fieldName: "email", reason: "regex-heuristic" },
+ ],
+ },
+ {
+ invalid: true,
+ fields: [
+ // Forgot password
+ { fieldName: "email", reason: "regex-heuristic" },
+ ],
+ },
+ {
+ invalid: true,
+ fields: [
+ { fieldName: "email", reason: "regex-heuristic" },
+ ],
+ },
+ {
+ invalid: true,
+ fields: [
+ { fieldName: "email", reason: "regex-heuristic" },
+ // {fieldName: "password"},
+ ],
+ },
+ {
+ invalid: true,
+ fields: [
+ // Sign up
+ { fieldName: "email", reason: "regex-heuristic" },
+ ],
+ },
+ {
+ invalid: true,
+ fields: [
+ { fieldName: "email", reason: "regex-heuristic" },
+ ],
+ }
+ ],
+ },
+ ],
+ "fixtures/third_party/CostCo/"
+);
diff --git a/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_DirectAsda.js b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_DirectAsda.js
new file mode 100644
index 0000000000..6cb7979173
--- /dev/null
+++ b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_DirectAsda.js
@@ -0,0 +1,25 @@
+/* global add_heuristic_tests */
+
+"use strict";
+
+add_heuristic_tests(
+ [
+ {
+ fixturePath: "Payment.html",
+ expectedResult: [
+ {
+ default: {
+ reason: "fathom",
+ },
+ fields: [
+ { fieldName: "cc-number" },
+ { fieldName: "cc-name" },
+ { fieldName: "cc-exp-month", reason: "regex-heuristic" },
+ { fieldName: "cc-exp-year", reason: "regex-heuristic" },
+ ],
+ },
+ ],
+ },
+ ],
+ "fixtures/third_party/DirectAsda/"
+)
diff --git a/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_Ebay.js b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_Ebay.js
new file mode 100644
index 0000000000..db6047718f
--- /dev/null
+++ b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_Ebay.js
@@ -0,0 +1,25 @@
+/* global add_heuristic_tests */
+
+"use strict";
+
+add_heuristic_tests(
+ [
+ {
+ fixturePath: "Checkout_Payment_FR.html",
+ expectedResult: [
+ {
+ default: {
+ reason: "autocomplete",
+ },
+ fields: [
+ { fieldName: "cc-number" },
+ { fieldName: "cc-exp" },
+ { fieldName: "cc-given-name" },
+ { fieldName: "cc-family-name" },
+ ],
+ },
+ ],
+ },
+ ],
+ "fixtures/third_party/Ebay/"
+)
diff --git a/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_GlobalDirectAsda.js b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_GlobalDirectAsda.js
new file mode 100644
index 0000000000..7b82009032
--- /dev/null
+++ b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_GlobalDirectAsda.js
@@ -0,0 +1,24 @@
+/* global add_heuristic_tests */
+
+"use strict";
+
+add_heuristic_tests(
+ [
+ {
+ fixturePath: "Payment.html",
+ expectedResult: [
+ {
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ { fieldName: "cc-number", reason: "fathom" },
+ { fieldName: "cc-exp-month" },
+ { fieldName: "cc-exp-year" },
+ ],
+ },
+ ],
+ },
+ ],
+ "fixtures/third_party/GlobalDirectAsda/"
+)
diff --git a/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_HomeDepot.js b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_HomeDepot.js
new file mode 100644
index 0000000000..8aac002b2d
--- /dev/null
+++ b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_HomeDepot.js
@@ -0,0 +1,77 @@
+/* global add_heuristic_tests */
+
+"use strict";
+
+add_heuristic_tests(
+ [
+ {
+ fixturePath: "Checkout_ShippingPayment.html",
+ expectedResult: [
+ {
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ { fieldName: "given-name" },
+ { fieldName: "family-name" },
+ { fieldName: "email" },
+ { fieldName: "tel" },
+ { fieldName: "street-address" },
+ { fieldName: "postal-code" },
+ ],
+ },
+ {
+ invalid: true,
+ fields: [
+ {
+ fieldName: "street-address",
+ reason: "autocomplete",
+ addressType: "billing",
+ },
+ ],
+ },
+ // THis should be fixed by visibility check
+ {
+ default: {
+ reason: "autocomplete",
+ },
+ fields: [
+ // FIXME: bug 1392944 - the uncommented cc-exp-month and cc-exp-year are
+ // both invisible <input> elements, and the following two <select>
+ // elements are the correct ones. BTW, they are both applied
+ // autocomplete attr.
+ { fieldName: "cc-exp-month" },
+ { fieldName: "cc-exp-year" },
+ { fieldName: "cc-number", reason: "fathom" },
+ ],
+ },
+ {
+ invalid: true,
+ fields: [
+ { fieldName: "cc-exp-month", reason: "regex-heuristic"},
+ { fieldName: "cc-exp-year", reason: "regex-heuristic"},
+ // {fieldName: "cc-csc"},
+ ],
+ },
+ ],
+ },
+ {
+ fixturePath: "SignIn.html",
+ expectedResult: [
+ {
+ invalid: true,
+ fields: [
+ { fieldName: "email",reason: "regex-heuristic" },
+ ],
+ },
+ {
+ invalid: true,
+ fields: [
+ { fieldName: "email",reason: "regex-heuristic" },
+ ],
+ },
+ ],
+ },
+ ],
+ "fixtures/third_party/HomeDepot/"
+);
diff --git a/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_Lufthansa.js b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_Lufthansa.js
new file mode 100644
index 0000000000..801dbf66be
--- /dev/null
+++ b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_Lufthansa.js
@@ -0,0 +1,28 @@
+/* global add_heuristic_tests */
+
+"use strict";
+
+add_heuristic_tests(
+ [
+ {
+ fixturePath: "Checkout_Payment.html",
+ expectedResult: [
+ {
+ default: {
+ reason: "fathom",
+ },
+ fields: [
+ { fieldName: "cc-type", reason: "regex-heuristic" },
+ { fieldName: "cc-number" },
+ { fieldName: "cc-number" },
+ { fieldName: "cc-number" },
+ { fieldName: "cc-number" },
+ { fieldName: "cc-exp-month", reason: "regex-heuristic" },
+ { fieldName: "cc-exp-year", reason: "regex-heuristic" },
+ ],
+ },
+ ],
+ },
+ ],
+ "fixtures/third_party/Lufthansa/"
+);
diff --git a/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_Lush.js b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_Lush.js
new file mode 100644
index 0000000000..a59fc966e5
--- /dev/null
+++ b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_Lush.js
@@ -0,0 +1,31 @@
+/* global add_heuristic_tests */
+
+"use strict";
+
+add_heuristic_tests(
+ [
+ {
+ fixturePath: "index.html",
+ expectedResult: [
+ {
+ default: {
+ reason: "fathom",
+ },
+ fields: [
+ { fieldName: "cc-name" },
+ { fieldName: "cc-number" },
+ ],
+ },
+ {
+ fields: [
+ { fieldName: "cc-number", reason: "autocomplete" },
+ { fieldName: "cc-name", reason: "fathom" },
+ { fieldName: "cc-exp-month", reason: "regex-heuristic" },
+ { fieldName: "cc-exp-year", reason: "regex-heuristic" },
+ ],
+ },
+ ],
+ },
+ ],
+ "fixtures/third_party/Lush/"
+);
diff --git a/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_Macys.js b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_Macys.js
new file mode 100644
index 0000000000..e02996b565
--- /dev/null
+++ b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_Macys.js
@@ -0,0 +1,88 @@
+/* global add_heuristic_tests */
+
+"use strict";
+
+add_heuristic_tests(
+ [
+ {
+ fixturePath: "Checkout_ShippingAddress.html",
+ expectedResult: [
+ {
+ default: {
+ reason: "autocomplete",
+ },
+ fields: [
+ { fieldName: "given-name" },
+ { fieldName: "family-name" },
+ { fieldName: "address-line1" },
+ { fieldName: "address-line2" },
+ { fieldName: "address-level2" }, // city
+ { fieldName: "address-level1" }, // state
+ { fieldName: "postal-code" },
+ { fieldName: "tel" },
+ ],
+ },
+ ],
+ },
+ {
+ fixturePath: "Checkout_Payment.html",
+ expectedResult: [
+ {
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ { fieldName: "cc-type" }, // ac-off
+ { fieldName: "cc-number", reason: "fathom" }, // ac-off
+ { fieldName: "cc-exp-month" }, // ac-off
+ { fieldName: "cc-exp-year" }, // ac-off
+ // {fieldName: "cc-csc"}, // ac-off
+ ],
+ },
+ {
+ default: {
+ reason: "autocomplete",
+ },
+ fields: [
+ { fieldName: "given-name" },
+ { fieldName: "family-name" },
+ { fieldName: "address-line1" },
+ { fieldName: "address-line2" },
+ { fieldName: "address-level2" }, // city
+ { fieldName: "address-level1" }, // state
+ { fieldName: "postal-code" },
+ { fieldName: "tel" },
+ { fieldName: "email" },
+ ],
+ },
+ ],
+ },
+ {
+ fixturePath: "SignIn.html",
+ expectedResult: [
+ {
+ invalid: true,
+ fields: [
+ // Sign in
+ { fieldName: "email", reason: "regex-heuristic"},
+ // {fieldName: "password"},
+ ],
+ },
+ {
+ invalid: true,
+ fields: [
+ // Forgot password
+ { fieldName: "email", reason: "regex-heuristic"},
+ ],
+ },
+ {
+ invalid: true,
+ fields: [
+ { fieldName: "email", reason: "regex-heuristic"},
+ ],
+ },
+ ],
+ },
+ ],
+ "fixtures/third_party/Macys/"
+);
diff --git a/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_NewEgg.js b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_NewEgg.js
new file mode 100644
index 0000000000..d914f02890
--- /dev/null
+++ b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_NewEgg.js
@@ -0,0 +1,109 @@
+/* global add_heuristic_tests */
+
+"use strict";
+
+add_heuristic_tests(
+ [
+ {
+ fixturePath: "ShippingInfo.html",
+ expectedResult: [
+ {
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ { fieldName: "given-name" },
+ { fieldName: "family-name" },
+ { fieldName: "country" },
+ { fieldName: "address-line1" },
+ { fieldName: "address-line2" },
+ { fieldName: "address-level2" },
+ { fieldName: "address-level1" }, // state
+ { fieldName: "postal-code" },
+ { fieldName: "tel" },
+ { fieldName: "email" },
+ ],
+ },
+ ],
+ },
+ {
+ fixturePath: "BillingInfo.html",
+ expectedResult: [
+ {
+ default: {
+ reason: "fathom",
+ },
+ fields: [
+ { fieldName: "cc-name" },
+ { fieldName: "cc-number" }, // ac-off
+ ],
+ },
+ {
+ default: {
+ reason: "fathom",
+ },
+ fields: [
+ { fieldName: "cc-name" },
+ { fieldName: "cc-number" }, // ac-off
+ { fieldName: "cc-exp-month", reason: "regex-heuristic" },
+ { fieldName: "cc-exp-year", reason: "regex-heuristic" },
+ // { fieldName: "cc-csc"},
+ ],
+ },
+ {
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ { fieldName: "country" },
+ { fieldName: "address-line1" },
+ { fieldName: "address-line2" },
+ { fieldName: "address-level2" },
+ { fieldName: "address-level1" }, // state
+ { fieldName: "postal-code" },
+ { fieldName: "tel" },
+ ],
+ },
+ {
+ default: {
+ reason: "fathom",
+ },
+ fields: [
+ { fieldName: "cc-name" },
+ { fieldName: "cc-number" }, // ac-off
+ { fieldName: "cc-exp-month", reason: "regex-heuristic" },
+ { fieldName: "cc-exp-year", reason: "regex-heuristic" },
+ ],
+ },
+ {
+ default: {
+ reason: "fathom",
+ },
+ fields: [
+ { fieldName: "cc-name" },
+ { fieldName: "cc-number" }, // ac-off
+ ],
+ },
+ ],
+ },
+ {
+ fixturePath: "Login.html",
+ expectedResult: [
+ {
+ invalid: true,
+ fields: [
+ { fieldName: "email", reason: "regex-heuristic" },
+ ],
+ },
+ {
+ invalid: true,
+ fields: [
+ { fieldName: "email", reason: "regex-heuristic" }, // Email Address
+ { fieldName: "email", reason: "regex-heuristic" }, // Confirm Email Address
+ ],
+ },
+ ],
+ },
+ ],
+ "fixtures/third_party/NewEgg/"
+);
diff --git a/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_OfficeDepot.js b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_OfficeDepot.js
new file mode 100644
index 0000000000..8c44104cb6
--- /dev/null
+++ b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_OfficeDepot.js
@@ -0,0 +1,83 @@
+/* global add_heuristic_tests */
+
+"use strict";
+
+add_heuristic_tests(
+ [
+ {
+ fixturePath: "ShippingAddress.html",
+ expectedResult: [
+ {
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ { fieldName: "given-name" },
+ { fieldName: "family-name" },
+ { fieldName: "organization" },
+ { fieldName: "address-line1" },
+ { fieldName: "address-line2" },
+ { fieldName: "postal-code" },
+ { fieldName: "address-level2" }, // City & State
+ { fieldName: "address-level2" }, // City
+ { fieldName: "address-level1" }, // State
+ { fieldName: "tel-area-code" },
+ { fieldName: "tel-local-prefix" },
+ { fieldName: "tel-local-suffix" },
+ { fieldName: "tel-extension" },
+ { fieldName: "email" },
+ ],
+ },
+ ],
+ },
+ {
+ fixturePath: "Payment.html",
+ expectedResult: [
+ {
+ invalid: true, // because non of them is identified by fathom
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ { fieldName: "cc-exp-month" },
+ { fieldName: "cc-exp-year" },
+ { fieldName: "cc-number" },
+ ],
+ },
+ {
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ { fieldName: "given-name" },
+ { fieldName: "family-name" },
+ { fieldName: "organization" },
+ { fieldName: "address-line1" },
+ { fieldName: "address-line2" },
+ { fieldName: "postal-code" },
+ { fieldName: "address-level2" }, // City & State
+ { fieldName: "address-level2" }, // City
+ { fieldName: "address-level1" }, // state
+ { fieldName: "tel-area-code" },
+ { fieldName: "tel-local-prefix" },
+ { fieldName: "tel-local-suffix" },
+ { fieldName: "tel-extension" },
+ { fieldName: "email" },
+ ],
+ },
+ ],
+ },
+ {
+ fixturePath: "SignIn.html",
+ expectedResult: [
+ {
+ invalid: true,
+ fields: [
+ { fieldName: "email", reason: "regex-heuristic" },
+ ],
+ },
+ ],
+ },
+ ],
+ "fixtures/third_party/OfficeDepot/"
+);
diff --git a/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_QVC.js b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_QVC.js
new file mode 100644
index 0000000000..bc0504e726
--- /dev/null
+++ b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_QVC.js
@@ -0,0 +1,96 @@
+/* global add_heuristic_tests */
+
+"use strict";
+
+add_heuristic_tests(
+ [
+ {
+ fixturePath: "YourInformation.html",
+ expectedResult: [
+ {
+ invalid: true,
+ fields: [
+ { fieldName: "tel", reason: "regex-heuristic" },
+ { fieldName: "email", reason: "regex-heuristic" },
+ // { fieldName: "bday-month"}, // select
+ // { fieldName: "bday-day"}, // select
+ // { fieldName: "bday-year"},
+ ],
+ },
+ {
+ fields: [
+ { fieldName: "cc-type", reason: "regex-heuristic" },
+ { fieldName: "cc-number", reason: "fathom" },
+ { fieldName: "cc-exp", reason: "regex-heuristic" },
+ // { fieldName: "cc-csc"},
+ ],
+ },
+ {
+ invalid: true,
+ fields: [
+ { fieldName: "cc-number", reason: "regex-heuristic" }, // txtQvcGiftCardNumber
+ ],
+ },
+ {
+ invalid: true,
+ fields: [
+ { fieldName: "email", reason: "regex-heuristic" },
+ { fieldName: "email", reason: "regex-heuristic" },
+ ],
+ },
+ ],
+ },
+ {
+ fixturePath: "PaymentMethod.html",
+ expectedResult: [
+ {
+ invalid: true,
+ fields: [
+ { fieldName: "tel", reason: "regex-heuristic" },
+ { fieldName: "email", reason: "regex-heuristic" },
+ // { fieldName: "bday-month"}, // select
+ // { fieldName: "bday-day"}, // select
+ // { fieldName: "bday-year"}, // select
+ ],
+ },
+ {
+ default: {
+ reason: "fathom",
+ },
+ fields: [
+ { fieldName: "cc-type", reason: "regex-heuristic" }, // ac-off
+ { fieldName: "cc-number" }, // ac-off
+ { fieldName: "cc-exp", reason: "regex-heuristic" },
+ // { fieldName: "cc-csc"},
+ ],
+ },
+ {
+ invalid: true,
+ fields: [
+ { fieldName: "cc-number", reason: "regex-heuristic" }, // txtQvcGiftCardNumbe, ac-off
+ ],
+ },
+ {
+ invalid: true,
+ fields: [
+ { fieldName: "email", reason: "regex-heuristic" },
+ { fieldName: "email", reason: "regex-heuristic" },
+ ],
+ },
+ ],
+ },
+ {
+ fixturePath: "SignIn.html",
+ expectedResult: [
+ {
+ // Sign in
+ invalid: true,
+ fields: [
+ { fieldName: "email", reason: "regex-heuristic" },
+ ],
+ },
+ ],
+ },
+ ],
+ "fixtures/third_party/QVC/"
+);
diff --git a/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_Sears.js b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_Sears.js
new file mode 100644
index 0000000000..4c668ddad1
--- /dev/null
+++ b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_Sears.js
@@ -0,0 +1,81 @@
+/* global add_heuristic_tests */
+
+"use strict";
+
+add_heuristic_tests(
+ [
+ {
+ fixturePath: "ShippingAddress.html",
+ expectedResult: [
+ {
+ invalid: true,
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ { fieldName: "email" },
+ ]
+ },
+ {
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ // check-out, ac-off
+ { fieldName: "given-name" },
+ { fieldName: "family-name" },
+ { fieldName: "address-line1" },
+ { fieldName: "address-line2" },
+ { fieldName: "address-level2" },
+ { fieldName: "address-level1" },
+ { fieldName: "postal-code" },
+ { fieldName: "tel" },
+ { fieldName: "tel-extension" },
+ { fieldName: "email" },
+ { fieldName: "email" },
+ ],
+ },
+ {
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ // ac-off
+ // { fieldName: "email"},
+ { fieldName: "given-name" },
+ { fieldName: "family-name" },
+ { fieldName: "address-line1" },
+ { fieldName: "address-line2" },
+ { fieldName: "address-level2" },
+ { fieldName: "address-level1" },
+ { fieldName: "postal-code" },
+ { fieldName: "tel" },
+ { fieldName: "tel-extension" },
+ // { fieldName: "new-password"},
+ ],
+ },
+ {
+ invalid: true,
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ // ac-off
+ { fieldName: "email" },
+ ]
+ },
+ {
+ invalid: true,
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ // ac-off
+ { fieldName: "email" },
+ ]
+ },
+ ],
+ },
+ ],
+ "fixtures/third_party/Sears/"
+);
diff --git a/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_Staples.js b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_Staples.js
new file mode 100644
index 0000000000..4b03fe2338
--- /dev/null
+++ b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_Staples.js
@@ -0,0 +1,78 @@
+/* global add_heuristic_tests */
+
+"use strict";
+
+add_heuristic_tests(
+ [
+ {
+ fixturePath: "Basic.html",
+ expectedResult: [
+ {
+ // ac-off
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ { fieldName: "given-name" },
+ { fieldName: "family-name" },
+ { fieldName: "address-line1" },
+ { fieldName: "email" },
+ { fieldName: "tel" },
+ { fieldName: "tel" }, // Extension
+ { fieldName: "organization" },
+ ]
+ },
+ ],
+ },
+ {
+ fixturePath: "Basic_ac_on.html",
+ expectedResult: [
+ {
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ { fieldName: "given-name" },
+ { fieldName: "family-name" },
+ { fieldName: "address-line1" },
+ { fieldName: "email" },
+ { fieldName: "tel" },
+ { fieldName: "tel" }, // Extension
+ { fieldName: "organization" },
+ ],
+ },
+ ],
+ },
+ {
+ fixturePath: "PaymentBilling.html",
+ expectedResult: [
+ {
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ { fieldName: "cc-number", reason: "fathom" },
+ { fieldName: "cc-exp" },
+ // {fieldName: "cc-csc"},
+ ],
+ },
+ ],
+ },
+ {
+ fixturePath: "PaymentBilling_ac_on.html",
+ expectedResult: [
+ {
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ { fieldName: "cc-number", reason: "fathom" },
+ { fieldName: "cc-exp" },
+ // { fieldName: "cc-csc"},
+ ],
+ },
+ ],
+ },
+ ],
+ "fixtures/third_party/Staples/"
+);
diff --git a/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_Walmart.js b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_Walmart.js
new file mode 100644
index 0000000000..f2896bd9ac
--- /dev/null
+++ b/browser/extensions/formautofill/test/browser/heuristics/third_party/browser_Walmart.js
@@ -0,0 +1,93 @@
+/* global add_heuristic_tests */
+
+"use strict";
+
+add_heuristic_tests(
+ [
+ {
+ fixturePath: "Checkout.html",
+ expectedResult: [
+ {
+ invalid: true,
+ fields: [
+ { fieldName: "postal-code", reason: "regex-heuristic" },
+ ],
+ },
+ {
+ invalid: true,
+ fields: [
+ { fieldName: "email", reason: "regex-heuristic" },
+ // { fieldName: "password"}, // ac-off
+ ],
+ },
+ {
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ { fieldName: "given-name" },
+ { fieldName: "family-name" },
+ { fieldName: "email" }, // ac-off
+ // { fieldName: "password"},
+ // { fieldName: "password"}, // ac-off
+ ],
+ },
+ ],
+ },
+ {
+ fixturePath: "Payment.html",
+ expectedResult: [
+ {
+ default: {
+ reason: "autocomplete",
+ section: "section-payment",
+ },
+ fields: [
+ { fieldName: "given-name" },
+ { fieldName: "family-name" },
+ { fieldName: "tel" },
+ ],
+ },
+ {
+ default: {
+ reason: "autocomplete",
+ section: "section-payment",
+ },
+ fields: [
+ { fieldName: "cc-number" },
+ { fieldName: "cc-exp-month" },
+ { fieldName: "cc-exp-year" },
+ // { fieldName: "cc-csc"},
+ ],
+ },
+ ],
+ },
+ {
+ fixturePath: "Shipping.html",
+ expectedResult: [
+ {
+ invalid: true,
+ fields: [
+ { fieldName: "postal-code", reason: "regex-heuristic" },
+ ],
+ },
+ {
+ default: {
+ reason: "regex-heuristic",
+ },
+ fields: [
+ { fieldName: "given-name" },
+ { fieldName: "family-name" },
+ { fieldName: "tel" },
+ { fieldName: "address-line1" },
+ { fieldName: "address-line2" },
+ { fieldName: "address-level2" }, // city
+ { fieldName: "address-level1" }, // state
+ { fieldName: "postal-code" },
+ ],
+ },
+ ],
+ },
+ ],
+ "fixtures/third_party/Walmart/"
+);