diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml
index da570f9ed99b0..3c44a8f1898ad 100644
--- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml
@@ -19,6 +19,14 @@
+
+
+
+
+
+
+
+
@@ -96,6 +104,9 @@
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml
index 46329dde278bc..86158aba68f82 100644
--- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeActionGroup.xml
@@ -65,6 +65,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml
index 2914ecc470220..019d103a31cf2 100644
--- a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductAttributeSetActionGroup.xml
@@ -45,6 +45,9 @@
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/AdminMenuData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/AdminMenuData.xml
new file mode 100644
index 0000000000000..24e1fe9cf5ecd
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Data/AdminMenuData.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+ Catalog
+ Catalog
+ magento-catalog-catalog
+
+
+ Default Category (ID: 2)
+ Categories
+ magento-catalog-catalog-categories
+
+
+ Products
+ Products
+ magento-catalog-catalog-products
+
+
+ Attribute Sets
+ Attribute Set
+ magento-catalog-catalog-attributes-sets
+
+
+ Product Attributes
+ Product
+ magento-catalog-catalog-attributes-attributes
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml
index 134abcaa50354..817dd637f81dd 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeData.xml
@@ -73,6 +73,20 @@
false
ProductAttributeFrontendLabel
+
+ false
+ false
+ false
+ false
+ false
+ false
+ false
+ false
+ false
+ false
+ false
+ false
+
attribute
select
diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeSetData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeSetData.xml
index 713c453bb7ad4..6d4314a6d865f 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeSetData.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductAttributeSetData.xml
@@ -20,4 +20,10 @@
7
1
+
+
+ 0
+ 0
+ 0
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
index ba4a623e35def..3492dffd7cc7d 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
@@ -940,6 +940,19 @@
13
0
+
+ AAA Product
+
+
+ BBB Product
+
+
+ Product "!@#$%^&*()+:;\|}{][?=~`
+ |}{][?=~`
+
+
+ ProductWith128Chars 1234567891123456789112345678911234567891123456789112345678911234567891123456789112345678 endnums
+
sku_simple_product_
simple
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormAttributeSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormAttributeSection.xml
index e159a4ce5c0b6..a2a349ed67611 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormAttributeSection.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormAttributeSection.xml
@@ -17,8 +17,23 @@
-
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml
index da282d06145aa..f515171e835db 100644
--- a/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml
+++ b/app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormSection.xml
@@ -203,7 +203,9 @@
\ No newline at end of file
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCatalogCategoriesNavigateMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCatalogCategoriesNavigateMenuTest.xml
new file mode 100644
index 0000000000000..a51df86d0327a
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCatalogCategoriesNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminCatalogProductsNavigateMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCatalogProductsNavigateMenuTest.xml
new file mode 100644
index 0000000000000..1d9400bf81e4d
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminCatalogProductsNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminStoresAttributeSetNavigateMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminStoresAttributeSetNavigateMenuTest.xml
new file mode 100644
index 0000000000000..ed29c281b804c
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminStoresAttributeSetNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/AdminStoresProductNavigateMenuTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/AdminStoresProductNavigateMenuTest.xml
new file mode 100644
index 0000000000000..28a33c4f20c01
--- /dev/null
+++ b/app/code/Magento/Catalog/Test/Mftf/Test/AdminStoresProductNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Data/AdminMenuData.xml b/app/code/Magento/CatalogRule/Test/Mftf/Data/AdminMenuData.xml
new file mode 100644
index 0000000000000..eb9cac1401c36
--- /dev/null
+++ b/app/code/Magento/CatalogRule/Test/Mftf/Data/AdminMenuData.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+ Marketing
+ Marketing
+ magento-backend-marketing
+
+
+ Catalog Price Rule
+ Catalog Price Rule
+ magento-catalogrule-promo-catalog
+
+
diff --git a/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminMarketingCatalogPriceRuleNavigateMenuTest.xml b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminMarketingCatalogPriceRuleNavigateMenuTest.xml
new file mode 100644
index 0000000000000..0fe35419aaf3e
--- /dev/null
+++ b/app/code/Magento/CatalogRule/Test/Mftf/Test/AdminMarketingCatalogPriceRuleNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchActionGroup.xml b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchActionGroup.xml
index 4b52b2c669edf..067d76821d687 100644
--- a/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchActionGroup.xml
+++ b/app/code/Magento/CatalogSearch/Test/Mftf/ActionGroup/StorefrontCatalogSearchActionGroup.xml
@@ -20,6 +20,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Data/AdminMenuData.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Data/AdminMenuData.xml
new file mode 100644
index 0000000000000..df1c3db6e5661
--- /dev/null
+++ b/app/code/Magento/CatalogSearch/Test/Mftf/Data/AdminMenuData.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+ Search Terms
+ Search Terms
+ magento-search-search-terms
+
+
+ Search Terms Report
+ Search Terms
+ magento-search-report-search-term
+
+
diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminMarketingSearchTermsNavigateMenuTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminMarketingSearchTermsNavigateMenuTest.xml
new file mode 100644
index 0000000000000..bc255020d98b3
--- /dev/null
+++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminMarketingSearchTermsNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminReportsSearchTermsNavigateMenuTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminReportsSearchTermsNavigateMenuTest.xml
new file mode 100644
index 0000000000000..85cf0e3ba90ed
--- /dev/null
+++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/AdminReportsSearchTermsNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml
new file mode 100644
index 0000000000000..19db201e91f40
--- /dev/null
+++ b/app/code/Magento/CatalogSearch/Test/Mftf/Test/SearchEntityResultsTest.xml
@@ -0,0 +1,629 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 10
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $attributeSet.attribute_set_id$
+
+
+
+
+
+
+
+ $attributeSet.attribute_set_id$
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml
index 0206c18b819c2..cbe71e9cffa60 100644
--- a/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml
+++ b/app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml
@@ -54,5 +54,6 @@
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/Section/StorefrontCheckoutPaymentMethodSection.xml b/app/code/Magento/Checkout/Test/Mftf/Section/StorefrontCheckoutPaymentMethodSection.xml
index 55c4385706ba9..9d9a96d2ea5e6 100644
--- a/app/code/Magento/Checkout/Test/Mftf/Section/StorefrontCheckoutPaymentMethodSection.xml
+++ b/app/code/Magento/Checkout/Test/Mftf/Section/StorefrontCheckoutPaymentMethodSection.xml
@@ -12,5 +12,6 @@
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml
new file mode 100644
index 0000000000000..166f5022d5aeb
--- /dev/null
+++ b/app/code/Magento/Checkout/Test/Mftf/Test/DefaultBillingAddressShouldBeCheckedOnPaymentPageTest.xml
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest.xml
index e7c2ad3dd28a4..fadc9ec50ad8d 100644
--- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest.xml
+++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerCheckoutTest.xml
@@ -186,20 +186,20 @@
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
+
@@ -216,16 +216,18 @@
-
-
+
+
+
-
-
-
+
+
+
+
@@ -253,16 +255,18 @@
-
-
-
-
-
+
+
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml
index 8537e10ce5a03..651c5bd8d4375 100644
--- a/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml
+++ b/app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCustomerPlaceOrderWithNewAddressesThatWasEditedTest.xml
@@ -71,6 +71,7 @@
+
@@ -89,7 +90,7 @@
-
diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/checkout-data-resolver.js b/app/code/Magento/Checkout/view/frontend/web/js/model/checkout-data-resolver.js
index 9cc60a3645d58..e54f464f24d02 100644
--- a/app/code/Magento/Checkout/view/frontend/web/js/model/checkout-data-resolver.js
+++ b/app/code/Magento/Checkout/view/frontend/web/js/model/checkout-data-resolver.js
@@ -243,7 +243,7 @@ define([
return;
}
- if (quote.isVirtual()) {
+ if (quote.isVirtual() || !quote.billingAddress()) {
isBillingAddressInitialized = addressList.some(function (addrs) {
if (addrs.isDefaultBilling()) {
selectBillingAddress(addrs);
diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Data/AdminModuleData.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Data/AdminModuleData.xml
new file mode 100644
index 0000000000000..d42c2c8139425
--- /dev/null
+++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Data/AdminModuleData.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ Terms and Conditions
+ Terms and Conditions
+ magento-checkoutagreements-sales-checkoutagreement
+
+
diff --git a/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminStoresTermsAndConditionsNavigateMenuTest.xml b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminStoresTermsAndConditionsNavigateMenuTest.xml
new file mode 100644
index 0000000000000..d2d4cb9138bd5
--- /dev/null
+++ b/app/code/Magento/CheckoutAgreements/Test/Mftf/Test/AdminStoresTermsAndConditionsNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Cms/Test/Mftf/Data/AdminMenuData.xml b/app/code/Magento/Cms/Test/Mftf/Data/AdminMenuData.xml
new file mode 100644
index 0000000000000..3e227df56c909
--- /dev/null
+++ b/app/code/Magento/Cms/Test/Mftf/Data/AdminMenuData.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+ Content
+ Content
+ magento-backend-content
+
+
+ Pages
+ Pages
+ magento-cms-cms-page
+
+
+ Blocks
+ Blocks
+ magento-cms-cms-block
+
+
diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminContentBlocksNavigateMenuTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminContentBlocksNavigateMenuTest.xml
new file mode 100644
index 0000000000000..19f501d6aa209
--- /dev/null
+++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminContentBlocksNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Cms/Test/Mftf/Test/AdminContentPagesNavigateMenuTest.xml b/app/code/Magento/Cms/Test/Mftf/Test/AdminContentPagesNavigateMenuTest.xml
new file mode 100644
index 0000000000000..323a1de7b9a4e
--- /dev/null
+++ b/app/code/Magento/Cms/Test/Mftf/Test/AdminContentPagesNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Config/Test/Mftf/Section/AdminConfigSection.xml b/app/code/Magento/Config/Test/Mftf/Section/AdminConfigSection.xml
index 8a56c2777084e..b5bfe9cc2ea05 100644
--- a/app/code/Magento/Config/Test/Mftf/Section/AdminConfigSection.xml
+++ b/app/code/Magento/Config/Test/Mftf/Section/AdminConfigSection.xml
@@ -11,5 +11,7 @@
+
+
-
+
\ No newline at end of file
diff --git a/app/code/Magento/ConfigurableProduct/Setup/Patch/Data/InstallInitialConfigurableAttributes.php b/app/code/Magento/ConfigurableProduct/Setup/Patch/Data/InstallInitialConfigurableAttributes.php
index f69d8529fb801..c6b173453f5ec 100644
--- a/app/code/Magento/ConfigurableProduct/Setup/Patch/Data/InstallInitialConfigurableAttributes.php
+++ b/app/code/Magento/ConfigurableProduct/Setup/Patch/Data/InstallInitialConfigurableAttributes.php
@@ -6,16 +6,16 @@
namespace Magento\ConfigurableProduct\Setup\Patch\Data;
+use Magento\ConfigurableProduct\Model\Product\Type\Configurable;
use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
-use Magento\Framework\App\ResourceConnection;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\Patch\DataPatchInterface;
use Magento\Framework\Setup\Patch\PatchVersionInterface;
-use Magento\ConfigurableProduct\Model\Product\Type\Configurable;
/**
* Class InstallInitialConfigurableAttributes
+ *
* @package Magento\ConfigurableProduct\Setup\Patch
*/
class InstallInitialConfigurableAttributes implements DataPatchInterface, PatchVersionInterface
@@ -24,6 +24,7 @@ class InstallInitialConfigurableAttributes implements DataPatchInterface, PatchV
* @var ModuleDataSetupInterface
*/
private $moduleDataSetup;
+
/**
* @var EavSetupFactory
*/
@@ -43,7 +44,7 @@ public function __construct(
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function apply()
{
@@ -64,24 +65,27 @@ public function apply()
'color'
];
foreach ($attributes as $attributeCode) {
- $relatedProductTypes = explode(
- ',',
- $eavSetup->getAttribute(\Magento\Catalog\Model\Product::ENTITY, $attributeCode, 'apply_to')
- );
- if (!in_array(Configurable::TYPE_CODE, $relatedProductTypes)) {
- $relatedProductTypes[] = Configurable::TYPE_CODE;
- $eavSetup->updateAttribute(
- \Magento\Catalog\Model\Product::ENTITY,
- $attributeCode,
- 'apply_to',
- implode(',', $relatedProductTypes)
+ $attribute = $eavSetup->getAttribute(\Magento\Catalog\Model\Product::ENTITY, $attributeCode, 'apply_to');
+ if ($attribute) {
+ $relatedProductTypes = explode(
+ ',',
+ $attribute
);
+ if (!in_array(Configurable::TYPE_CODE, $relatedProductTypes)) {
+ $relatedProductTypes[] = Configurable::TYPE_CODE;
+ $eavSetup->updateAttribute(
+ \Magento\Catalog\Model\Product::ENTITY,
+ $attributeCode,
+ 'apply_to',
+ implode(',', $relatedProductTypes)
+ );
+ }
}
}
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public static function getDependencies()
{
@@ -89,7 +93,7 @@ public static function getDependencies()
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public static function getVersion()
{
@@ -97,7 +101,7 @@ public static function getVersion()
}
/**
- * {@inheritdoc}
+ * @inheritdoc
*/
public function getAliases()
{
diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml
index 51bb041b66089..a56c6e23b6d8f 100644
--- a/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml
+++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/ActionGroup/StorefrontProductActionGroup.xml
@@ -34,6 +34,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Data/ConfigurableProductOptionData.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Data/ConfigurableProductOptionData.xml
index f231d74b70dad..a1a499f33eda0 100644
--- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Data/ConfigurableProductOptionData.xml
+++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Data/ConfigurableProductOptionData.xml
@@ -8,6 +8,11 @@
+
+
+ option
+ ValueIndex1
+
option
diff --git a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/StorefrontProductInfoMainSection.xml b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/StorefrontProductInfoMainSection.xml
index 09de3cc302903..24cd9262b6742 100644
--- a/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/StorefrontProductInfoMainSection.xml
+++ b/app/code/Magento/ConfigurableProduct/Test/Mftf/Section/StorefrontProductInfoMainSection.xml
@@ -18,6 +18,7 @@
+
diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Data/AdminMenuData.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Data/AdminMenuData.xml
new file mode 100644
index 0000000000000..9166c8745c9e1
--- /dev/null
+++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Data/AdminMenuData.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+ Currency Rates
+ Currency Rates
+ magento-currencysymbol-system-currency-rates
+
+
+ Currency Symbols
+ Currency Symbols
+ magento-currencysymbol-system-currency-symbols
+
+
diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminStoresCurrencyRatesNavigateMenuTest.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminStoresCurrencyRatesNavigateMenuTest.xml
new file mode 100644
index 0000000000000..4a33d40d2a35f
--- /dev/null
+++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminStoresCurrencyRatesNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminStoresCurrencySymbolsNavigateMenuTest.xml b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminStoresCurrencySymbolsNavigateMenuTest.xml
new file mode 100644
index 0000000000000..978917772f2dd
--- /dev/null
+++ b/app/code/Magento/CurrencySymbol/Test/Mftf/Test/AdminStoresCurrencySymbolsNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Customer/Model/AccountManagement.php b/app/code/Magento/Customer/Model/AccountManagement.php
index 673300369fe06..250d190f8fae7 100644
--- a/app/code/Magento/Customer/Model/AccountManagement.php
+++ b/app/code/Magento/Customer/Model/AccountManagement.php
@@ -624,7 +624,6 @@ public function initiatePasswordReset($email, $template, $websiteId = null)
* @param string $rpToken
* @throws ExpiredException
* @throws NoSuchEntityException
- *
* @return CustomerInterface
* @throws LocalizedException
*/
@@ -703,7 +702,12 @@ public function resetPassword($email, $resetToken, $newPassword)
$customerSecure->setRpTokenCreatedAt(null);
$customerSecure->setPasswordHash($this->createPasswordHash($newPassword));
$this->destroyCustomerSessions($customer->getId());
- $this->sessionManager->destroy();
+ if ($this->sessionManager->isSessionExists()) {
+ //delete old session and move data to the new session
+ //use this instead of $this->sessionManager->regenerateId because last one doesn't delete old session
+ // phpcs:ignore Magento2.Functions.DiscouragedFunction
+ session_regenerate_id(true);
+ }
$this->customerRepository->save($customer);
return true;
@@ -1564,6 +1568,7 @@ private function getEmailNotification()
/**
* Destroy all active customer sessions by customer id (current session will not be destroyed).
+ *
* Customer sessions which should be deleted are collecting from the "customer_visitor" table considering
* configured session lifetime.
*
diff --git a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerActionGroup.xml b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerActionGroup.xml
index fc5c1b881752e..c3b92b1af7f82 100644
--- a/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerActionGroup.xml
+++ b/app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerActionGroup.xml
@@ -9,8 +9,8 @@
-
diff --git a/app/code/Magento/Customer/Test/Mftf/Data/AdminMenuData.xml b/app/code/Magento/Customer/Test/Mftf/Data/AdminMenuData.xml
new file mode 100644
index 0000000000000..4e433c76b3ddb
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/Data/AdminMenuData.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+ Customers
+ Customers
+ magento-customer-customer
+
+
+ Customers
+ All Customers
+ magento-customer-customer-manage
+
+
+ Customer Groups
+ Customer Groups
+ magento-customer-customer-group
+
+
+ Customers Now Online
+ Now Online
+ magento-customer-customer-online
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontPanelHeaderSection.xml b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontPanelHeaderSection.xml
index dab298f6b416b..3610532c5356b 100644
--- a/app/code/Magento/Customer/Test/Mftf/Section/StorefrontPanelHeaderSection.xml
+++ b/app/code/Magento/Customer/Test/Mftf/Section/StorefrontPanelHeaderSection.xml
@@ -15,8 +15,8 @@
-
-
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomersAllCustomersNavigateMenuTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomersAllCustomersNavigateMenuTest.xml
new file mode 100644
index 0000000000000..76e4407675e4c
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomersAllCustomersNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomersCustomerGroupsNavigateMenuTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomersCustomerGroupsNavigateMenuTest.xml
new file mode 100644
index 0000000000000..13a4b1c714337
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomersCustomerGroupsNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomersNowOnlineNavigateMenuTest.xml b/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomersNowOnlineNavigateMenuTest.xml
new file mode 100644
index 0000000000000..e9eb7803e01ea
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Mftf/Test/AdminCustomersNowOnlineNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php b/app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php
index 22c9d90c086dc..209a9b077a307 100644
--- a/app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php
+++ b/app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php
@@ -1238,8 +1238,7 @@ public function testInitiatePasswordResetEmailReminder()
$storeId = 1;
- mt_srand(mt_rand() + (100000000 * (float)microtime()) % PHP_INT_MAX);
- $hash = md5(uniqid(microtime() . mt_rand(0, mt_getrandmax()), true));
+ $hash = hash('sha256', microtime() . random_int(PHP_INT_MIN, PHP_INT_MAX));
$this->emailNotificationMock->expects($this->once())
->method('passwordReminder')
@@ -1263,8 +1262,7 @@ public function testInitiatePasswordResetEmailReset()
$templateIdentifier = 'Template Identifier';
$sender = 'Sender';
- mt_srand(mt_rand() + (100000000 * (float)microtime()) % PHP_INT_MAX);
- $hash = md5(uniqid(microtime() . mt_rand(0, mt_getrandmax()), true));
+ $hash = hash('sha256', microtime() . random_int(PHP_INT_MIN, PHP_INT_MAX));
$this->emailNotificationMock->expects($this->once())
->method('passwordResetConfirmation')
@@ -1288,8 +1286,7 @@ public function testInitiatePasswordResetNoTemplate()
$templateIdentifier = 'Template Identifier';
$sender = 'Sender';
- mt_srand(mt_rand() + (100000000 * (float)microtime()) % PHP_INT_MAX);
- $hash = md5(uniqid(microtime() . mt_rand(0, mt_getrandmax()), true));
+ $hash = hash('sha256', microtime() . random_int(PHP_INT_MIN, PHP_INT_MAX));
$this->prepareInitiatePasswordReset($email, $templateIdentifier, $sender, $storeId, $customerId, $hash);
@@ -1610,7 +1607,7 @@ function ($string) {
$this->customerSecure->expects($this->once())->method('setRpTokenCreatedAt')->with(null);
$this->customerSecure->expects($this->any())->method('setPasswordHash')->willReturn(null);
- $this->sessionManager->expects($this->atLeastOnce())->method('destroy');
+ $this->sessionManager->method('isSessionExists')->willReturn(false);
$this->sessionManager->expects($this->atLeastOnce())->method('getSessionId');
$visitor = $this->getMockBuilder(\Magento\Customer\Model\Visitor::class)
->disableOriginalConstructor()
diff --git a/app/code/Magento/Customer/view/frontend/templates/account/customer.phtml b/app/code/Magento/Customer/view/frontend/templates/account/customer.phtml
index 2bdb6ac044a92..b7b8796142de8 100644
--- a/app/code/Magento/Customer/view/frontend/templates/account/customer.phtml
+++ b/app/code/Magento/Customer/view/frontend/templates/account/customer.phtml
@@ -16,7 +16,6 @@
data-toggle="dropdown"
data-trigger-keypress-button="true"
data-bind="scope: 'customer'">
-
+
+ downloadableproduct
+ downloadable
+ 4
+ DownloadableProduct
+ 50.99
+ 100
+ 0
+ 1
+ downloadableproduct
+ 4
+ EavStockItem
+ CustomAttributeCategoryIds
+ downloadableLink1
+
downloadableproduct
downloadable
diff --git a/app/code/Magento/Email/Test/Mftf/Data/AdminMenuData.xml b/app/code/Magento/Email/Test/Mftf/Data/AdminMenuData.xml
new file mode 100644
index 0000000000000..5086d74efa606
--- /dev/null
+++ b/app/code/Magento/Email/Test/Mftf/Data/AdminMenuData.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ Email Templates
+ Email Templates
+ magento-email-template
+
+
diff --git a/app/code/Magento/Email/Test/Mftf/Test/AdminMarketingEmailTemplatesNavigateMenuTest.xml b/app/code/Magento/Email/Test/Mftf/Test/AdminMarketingEmailTemplatesNavigateMenuTest.xml
new file mode 100644
index 0000000000000..d512fc263ef2c
--- /dev/null
+++ b/app/code/Magento/Email/Test/Mftf/Test/AdminMarketingEmailTemplatesNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/ImportExport/Test/Mftf/Data/AdminMenuData.xml b/app/code/Magento/ImportExport/Test/Mftf/Data/AdminMenuData.xml
new file mode 100644
index 0000000000000..c09cd192d05c7
--- /dev/null
+++ b/app/code/Magento/ImportExport/Test/Mftf/Data/AdminMenuData.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+ Export
+ Export
+ magento-importexport-system-convert-export
+
+
+ Import
+ Import
+ magento-importexport-system-convert-import
+
+
diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminExportPageNavigateMenuTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminExportPageNavigateMenuTest.xml
new file mode 100644
index 0000000000000..e8fb12ca521c2
--- /dev/null
+++ b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminExportPageNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/ImportExport/Test/Mftf/Test/AdminSystemImportNavigateMenuTest.xml b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminSystemImportNavigateMenuTest.xml
new file mode 100644
index 0000000000000..9913933d857a8
--- /dev/null
+++ b/app/code/Magento/ImportExport/Test/Mftf/Test/AdminSystemImportNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Indexer/Test/Mftf/Data/AdminMenuData.xml b/app/code/Magento/Indexer/Test/Mftf/Data/AdminMenuData.xml
new file mode 100644
index 0000000000000..b74d521f2cb36
--- /dev/null
+++ b/app/code/Magento/Indexer/Test/Mftf/Data/AdminMenuData.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ Index Management
+ Index Management
+ magento-indexer-system-index
+
+
diff --git a/app/code/Magento/Indexer/Test/Mftf/Test/AdminSystemIndexManagementNavigateMenuTest.xml b/app/code/Magento/Indexer/Test/Mftf/Test/AdminSystemIndexManagementNavigateMenuTest.xml
new file mode 100644
index 0000000000000..140c93f7f2b48
--- /dev/null
+++ b/app/code/Magento/Indexer/Test/Mftf/Test/AdminSystemIndexManagementNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Integration/Test/Mftf/Data/AdminMenuData.xml b/app/code/Magento/Integration/Test/Mftf/Data/AdminMenuData.xml
new file mode 100644
index 0000000000000..be5b3f16ad3c5
--- /dev/null
+++ b/app/code/Magento/Integration/Test/Mftf/Data/AdminMenuData.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ Integrations
+ Integrations
+ magento-integration-system-integrations
+
+
diff --git a/app/code/Magento/Integration/Test/Mftf/Test/AdminSystemIntegrationsNavigateMenuTest.xml b/app/code/Magento/Integration/Test/Mftf/Test/AdminSystemIntegrationsNavigateMenuTest.xml
new file mode 100644
index 0000000000000..3bd149d222c0e
--- /dev/null
+++ b/app/code/Magento/Integration/Test/Mftf/Test/AdminSystemIntegrationsNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/NewRelicReporting/Model/Module/Collect.php b/app/code/Magento/NewRelicReporting/Model/Module/Collect.php
index 7e381762f5d27..fe5389e258aa5 100644
--- a/app/code/Magento/NewRelicReporting/Model/Module/Collect.php
+++ b/app/code/Magento/NewRelicReporting/Model/Module/Collect.php
@@ -11,6 +11,9 @@
use Magento\NewRelicReporting\Model\Config;
use Magento\NewRelicReporting\Model\Module;
+/**
+ * Class for collecting data for the report
+ */
class Collect
{
/**
@@ -92,7 +95,6 @@ protected function getAllModules()
* @param string $active
* @param string $setupVersion
* @param string $state
- *
* @return array
*/
protected function getNewModuleChanges($moduleName, $active, $setupVersion, $state)
@@ -277,9 +279,7 @@ public function getModuleData($refresh = true)
$changes = array_diff($module, $changeTest);
$changesCleanArray = $this->getCleanChangesArray($changes);
- if (count($changesCleanArray) > 0 ||
- ($this->moduleManager->isOutputEnabled($changeTest['name']) &&
- $module['setup_version'] != null)) {
+ if (!empty($changesCleanArray)) {
$data = [
'entity_id' => $changeTest['entity_id'],
'name' => $changeTest['name'],
diff --git a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Module/CollectTest.php b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Module/CollectTest.php
index 8d8e6255ab8d3..4286406d6e9ab 100644
--- a/app/code/Magento/NewRelicReporting/Test/Unit/Model/Module/CollectTest.php
+++ b/app/code/Magento/NewRelicReporting/Test/Unit/Model/Module/CollectTest.php
@@ -162,10 +162,6 @@ public function testGetModuleDataWithoutRefresh()
->method('getNames')
->willReturn($enabledModulesMockArray);
- $this->moduleManagerMock->expects($this->any())->method('isOutputEnabled')->will(
- $this->returnValue(false)
- );
-
$this->assertInternalType(
'array',
$this->model->getModuleData()
@@ -256,10 +252,6 @@ public function testGetModuleDataRefresh($data)
->method('getNames')
->willReturn($enabledModulesMockArray);
- $this->moduleManagerMock->expects($this->any())->method('isOutputEnabled')->will(
- $this->returnValue(true)
- );
-
$this->assertInternalType(
'array',
$this->model->getModuleData()
@@ -350,10 +342,6 @@ public function testGetModuleDataRefreshOrStatement($data)
->method('getNames')
->willReturn($enabledModulesMockArray);
- $this->moduleManagerMock->expects($this->any())->method('isOutputEnabled')->will(
- $this->returnValue(true)
- );
-
$this->assertInternalType(
'array',
$this->model->getModuleData()
diff --git a/app/code/Magento/Newsletter/Test/Mftf/Data/AdminMenuData.xml b/app/code/Magento/Newsletter/Test/Mftf/Data/AdminMenuData.xml
new file mode 100644
index 0000000000000..1df1cd5f8dae8
--- /dev/null
+++ b/app/code/Magento/Newsletter/Test/Mftf/Data/AdminMenuData.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+ Newsletter Queue
+ Newsletter Queue
+ magento-newsletter-newsletter-queue
+
+
+ Newsletter Subscribers
+ Newsletter Subscribers
+ magento-newsletter-newsletter-subscriber
+
+
+ Newsletter Template
+ Newsletter Template
+ magento-newsletter-newsletter-template
+
+
+ Newsletter Problems Report
+ Newsletter Problem Reports
+ magento-newsletter-newsletter-problem
+
+
diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminMarketingNewsletterQueueNavigateMenuTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminMarketingNewsletterQueueNavigateMenuTest.xml
new file mode 100644
index 0000000000000..31da588250a0a
--- /dev/null
+++ b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminMarketingNewsletterQueueNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminMarketingNewsletterSubscribersNavigateMenuTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminMarketingNewsletterSubscribersNavigateMenuTest.xml
new file mode 100644
index 0000000000000..8ced2690322f8
--- /dev/null
+++ b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminMarketingNewsletterSubscribersNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminMarketingNewsletterTemplateNavigateMenuTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminMarketingNewsletterTemplateNavigateMenuTest.xml
new file mode 100644
index 0000000000000..ca994aa1d6269
--- /dev/null
+++ b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminMarketingNewsletterTemplateNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Newsletter/Test/Mftf/Test/AdminReportsNewsletterProblemReportsNavigateMenuTest.xml b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminReportsNewsletterProblemReportsNavigateMenuTest.xml
new file mode 100644
index 0000000000000..3891b90536a17
--- /dev/null
+++ b/app/code/Magento/Newsletter/Test/Mftf/Test/AdminReportsNewsletterProblemReportsNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Paypal/Test/Mftf/Data/AdminMenuData.xml b/app/code/Magento/Paypal/Test/Mftf/Data/AdminMenuData.xml
new file mode 100644
index 0000000000000..207bf62abf3ce
--- /dev/null
+++ b/app/code/Magento/Paypal/Test/Mftf/Data/AdminMenuData.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+ PayPal Settlement Reports
+ PayPal Settlement
+ magento-paypal-report-salesroot-paypal-settlement-reports
+
+
+ Sales
+ Sales
+ magento-sales-sales
+
+
+ Billing Agreements
+ Billing Agreements
+ magento-paypal-paypal-billing-agreement
+
+
diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/AdminReportsPayPalSettlementNavigateMenuTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/AdminReportsPayPalSettlementNavigateMenuTest.xml
new file mode 100644
index 0000000000000..03f0167230e9f
--- /dev/null
+++ b/app/code/Magento/Paypal/Test/Mftf/Test/AdminReportsPayPalSettlementNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Paypal/Test/Mftf/Test/AdminSalesBillingAgreementsNavigateMenuTest.xml b/app/code/Magento/Paypal/Test/Mftf/Test/AdminSalesBillingAgreementsNavigateMenuTest.xml
new file mode 100644
index 0000000000000..8c3735fcbd253
--- /dev/null
+++ b/app/code/Magento/Paypal/Test/Mftf/Test/AdminSalesBillingAgreementsNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Persistent/Model/QuoteManager.php b/app/code/Magento/Persistent/Model/QuoteManager.php
index 35c2c70be30dc..8ae22e4c26c6f 100644
--- a/app/code/Magento/Persistent/Model/QuoteManager.php
+++ b/app/code/Magento/Persistent/Model/QuoteManager.php
@@ -7,6 +7,8 @@
/**
* Class QuoteManager
+ *
+ * @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
*/
class QuoteManager
{
@@ -87,6 +89,7 @@ public function setGuest($checkQuote = false)
->setCustomerLastname(null)
->setCustomerGroupId(\Magento\Customer\Api\Data\GroupInterface::NOT_LOGGED_IN_ID)
->setIsPersistent(false)
+ ->setCustomerIsGuest(true)
->removeAllAddresses();
//Create guest addresses
$quote->getShippingAddress();
diff --git a/app/code/Magento/Persistent/Observer/CheckExpirePersistentQuoteObserver.php b/app/code/Magento/Persistent/Observer/CheckExpirePersistentQuoteObserver.php
index f3720960ca6e5..79fdf44c3c551 100644
--- a/app/code/Magento/Persistent/Observer/CheckExpirePersistentQuoteObserver.php
+++ b/app/code/Magento/Persistent/Observer/CheckExpirePersistentQuoteObserver.php
@@ -1,6 +1,5 @@
_persistentSession->isPersistent() &&
!$this->_customerSession->isLoggedIn() &&
$this->_checkoutSession->getQuoteId() &&
- !$this->isRequestFromCheckoutPage($this->request)
+ !$this->isRequestFromCheckoutPage($this->request) &&
// persistent session does not expire on onepage checkout page
+ (
+ $this->_checkoutSession->getQuote()->getIsPersistent() ||
+ $this->_checkoutSession->getQuote()->getCustomerIsGuest()
+ )
) {
$this->_eventManager->dispatch('persistent_session_expired');
$this->quoteManager->expire();
diff --git a/app/code/Magento/Persistent/Observer/SetQuotePersistentDataObserver.php b/app/code/Magento/Persistent/Observer/SetQuotePersistentDataObserver.php
index db6b6d1ee370d..2803bc998dcbe 100644
--- a/app/code/Magento/Persistent/Observer/SetQuotePersistentDataObserver.php
+++ b/app/code/Magento/Persistent/Observer/SetQuotePersistentDataObserver.php
@@ -1,6 +1,5 @@
_persistentSession->isPersistent() && !$this->_customerSession->isLoggedIn())
- && !$this->_persistentData->isShoppingCartPersist()
+ ($this->_persistentSession->isPersistent())
+ && $this->_persistentData->isShoppingCartPersist()
)
&& $this->quoteManager->isPersistent()
) {
diff --git a/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml b/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml
new file mode 100644
index 0000000000000..e5c77ee414362
--- /dev/null
+++ b/app/code/Magento/Persistent/Test/Mftf/Test/ShippingQuotePersistedForGuestTest.xml
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 150
+
+
+
+ John1
+ Doe1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{US_Address_CA.postcode}}
+ grabTextPostCode
+
+
+
diff --git a/app/code/Magento/Persistent/Test/Unit/Observer/CheckExpirePersistentQuoteObserverTest.php b/app/code/Magento/Persistent/Test/Unit/Observer/CheckExpirePersistentQuoteObserverTest.php
index 46dda1be365d4..b096dd2317a33 100644
--- a/app/code/Magento/Persistent/Test/Unit/Observer/CheckExpirePersistentQuoteObserverTest.php
+++ b/app/code/Magento/Persistent/Test/Unit/Observer/CheckExpirePersistentQuoteObserverTest.php
@@ -1,12 +1,16 @@
checkoutSessionMock,
$this->requestMock
);
+ $this->quoteMock = $this->getMockBuilder(Quote::class)
+ ->setMethods(['getCustomerIsGuest', 'getIsPersistent'])
+ ->disableOriginalConstructor()
+ ->getMock();
}
public function testExecuteWhenCanNotApplyPersistentData()
@@ -133,6 +146,11 @@ public function testExecuteWhenPersistentIsEnabled(
->willReturn(true);
$this->persistentHelperMock->expects($this->once())->method('isEnabled')->willReturn(true);
$this->sessionMock->expects($this->once())->method('isPersistent')->willReturn(false);
+ $this->checkoutSessionMock
+ ->method('getQuote')
+ ->willReturn($this->quoteMock);
+ $this->quoteMock->method('getCustomerIsGuest')->willReturn(true);
+ $this->quoteMock->method('getIsPersistent')->willReturn(true);
$this->customerSessionMock
->expects($this->atLeastOnce())
->method('isLoggedIn')
diff --git a/app/code/Magento/Persistent/Test/Unit/Observer/SetQuotePersistentDataObserverTest.php b/app/code/Magento/Persistent/Test/Unit/Observer/SetQuotePersistentDataObserverTest.php
index 6724743789cea..ffa829e8456cc 100644
--- a/app/code/Magento/Persistent/Test/Unit/Observer/SetQuotePersistentDataObserverTest.php
+++ b/app/code/Magento/Persistent/Test/Unit/Observer/SetQuotePersistentDataObserverTest.php
@@ -7,6 +7,9 @@
namespace Magento\Persistent\Test\Unit\Observer;
+/**
+ * Observer test for setting "is_persistent" value to quote
+ */
class SetQuotePersistentDataObserverTest extends \PHPUnit\Framework\TestCase
{
/**
@@ -83,7 +86,6 @@ public function testExecuteWhenQuoteNotExist()
->method('getEvent')
->will($this->returnValue($this->eventManagerMock));
$this->eventManagerMock->expects($this->once())->method('getQuote');
- $this->customerSessionMock->expects($this->never())->method('isLoggedIn');
$this->model->execute($this->observerMock);
}
@@ -98,8 +100,7 @@ public function testExecuteWhenSessionIsPersistent()
->expects($this->once())
->method('getQuote')
->will($this->returnValue($this->quoteMock));
- $this->customerSessionMock->expects($this->once())->method('isLoggedIn')->will($this->returnValue(false));
- $this->helperMock->expects($this->once())->method('isShoppingCartPersist')->will($this->returnValue(false));
+ $this->helperMock->expects($this->once())->method('isShoppingCartPersist')->will($this->returnValue(true));
$this->quoteManagerMock->expects($this->once())->method('isPersistent')->will($this->returnValue(true));
$this->quoteMock->expects($this->once())->method('setIsPersistent')->with(true);
$this->model->execute($this->observerMock);
diff --git a/app/code/Magento/Quote/Model/Quote/Item/Compare.php b/app/code/Magento/Quote/Model/Quote/Item/Compare.php
index ddaa636ef32b3..76ba324518dc1 100644
--- a/app/code/Magento/Quote/Model/Quote/Item/Compare.php
+++ b/app/code/Magento/Quote/Model/Quote/Item/Compare.php
@@ -50,7 +50,7 @@ protected function getOptionValues($value)
if (is_string($value) && $this->jsonValidator->isValid($value)) {
$value = $this->serializer->unserialize($value);
if (is_array($value)) {
- unset($value['qty'], $value['uenc']);
+ unset($value['qty'], $value['uenc'], $value['related_product'], $value['item']);
$value = array_filter($value, function ($optionValue) {
return !empty($optionValue);
});
diff --git a/app/code/Magento/Quote/Observer/Frontend/Quote/Address/CollectTotalsObserver.php b/app/code/Magento/Quote/Observer/Frontend/Quote/Address/CollectTotalsObserver.php
index 76c9a49b290c5..77dfec9603a5c 100644
--- a/app/code/Magento/Quote/Observer/Frontend/Quote/Address/CollectTotalsObserver.php
+++ b/app/code/Magento/Quote/Observer/Frontend/Quote/Address/CollectTotalsObserver.php
@@ -7,6 +7,11 @@
use Magento\Framework\Event\ObserverInterface;
+/**
+ * Handle customer VAT number on collect_totals_before event of quote address.
+ *
+ * @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
+ */
class CollectTotalsObserver implements ObserverInterface
{
/**
@@ -124,7 +129,7 @@ public function execute(\Magento\Framework\Event\Observer $observer)
);
}
- if ($groupId) {
+ if ($groupId !== null) {
$address->setPrevQuoteCustomerGroupId($quote->getCustomerGroupId());
$quote->setCustomerGroupId($groupId);
$this->customerSession->setCustomerGroupId($groupId);
diff --git a/app/code/Magento/Quote/Test/Unit/Observer/Frontend/Quote/Address/CollectTotalsObserverTest.php b/app/code/Magento/Quote/Test/Unit/Observer/Frontend/Quote/Address/CollectTotalsObserverTest.php
index f3357f8aacd31..4ea067c9be8f6 100644
--- a/app/code/Magento/Quote/Test/Unit/Observer/Frontend/Quote/Address/CollectTotalsObserverTest.php
+++ b/app/code/Magento/Quote/Test/Unit/Observer/Frontend/Quote/Address/CollectTotalsObserverTest.php
@@ -199,7 +199,7 @@ public function testDispatchWithCustomerCountryNotInEUAndNotLoggedCustomerInGrou
->method('getNotLoggedInGroup')
->will($this->returnValue($this->groupInterfaceMock));
$this->groupInterfaceMock->expects($this->once())
- ->method('getId')->will($this->returnValue(0));
+ ->method('getId')->will($this->returnValue(null));
$this->vatValidatorMock->expects($this->once())
->method('isEnabled')
->with($this->quoteAddressMock, $this->storeId)
@@ -220,9 +220,6 @@ public function testDispatchWithCustomerCountryNotInEUAndNotLoggedCustomerInGrou
$this->returnValue(false)
);
- $groupMock = $this->getMockBuilder(\Magento\Customer\Api\Data\GroupInterface::class)
- ->disableOriginalConstructor()
- ->getMock();
$this->customerMock->expects($this->once())->method('getId')->will($this->returnValue(null));
/** Assertions */
diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartEmail.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartEmail.php
new file mode 100644
index 0000000000000..8d0cb114d8315
--- /dev/null
+++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartEmail.php
@@ -0,0 +1,49 @@
+getCartForUser = $getCartForUser;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null)
+ {
+ if (!isset($value['model'])) {
+ throw new LocalizedException(__('"model" value should be specified'));
+ }
+ /** @var Quote $cart */
+ $cart = $value['model'];
+
+ return $cart->getCustomerEmail();
+ }
+}
diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/CartPrices.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartPrices.php
new file mode 100644
index 0000000000000..7a9bdd926764c
--- /dev/null
+++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/CartPrices.php
@@ -0,0 +1,87 @@
+totalsCollector = $totalsCollector;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null)
+ {
+ if (!isset($value['model'])) {
+ throw new LocalizedException(__('"model" value should be specified'));
+ }
+
+ /** @var Quote $quote */
+ $quote = $value['model'];
+ $cartTotals = $this->totalsCollector->collectQuoteTotals($quote);
+ $currency = $quote->getQuoteCurrencyCode();
+
+ return [
+ 'grand_total' => ['value' => $cartTotals->getGrandTotal(), 'currency' => $currency],
+ 'subtotal_including_tax' => ['value' => $cartTotals->getSubtotalInclTax(), 'currency' => $currency],
+ 'subtotal_excluding_tax' => ['value' => $cartTotals->getSubtotal(), 'currency' => $currency],
+ 'subtotal_with_discount_excluding_tax' => [
+ 'value' => $cartTotals->getSubtotalWithDiscount(), 'currency' => $currency
+ ],
+ 'applied_taxes' => $this->getAppliedTaxes($cartTotals, $currency),
+ 'model' => $quote
+ ];
+ }
+
+ /**
+ * Returns taxes applied to the current quote
+ *
+ * @param Total $total
+ * @param string $currency
+ * @return array
+ */
+ private function getAppliedTaxes(Total $total, string $currency): array
+ {
+ $appliedTaxesData = [];
+ $appliedTaxes = $total->getAppliedTaxes();
+
+ if (count($appliedTaxes) === 0) {
+ return $appliedTaxesData;
+ }
+
+ foreach ($appliedTaxes as $appliedTax) {
+ $appliedTaxesData[] = [
+ 'label' => $appliedTax['id'],
+ 'amount' => ['value' => $appliedTax['amount'], 'currency' => $currency]
+ ];
+ }
+ return $appliedTaxesData;
+ }
+}
diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/PlaceOrder.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/PlaceOrder.php
index 3bd46a664f2ab..1672474bb3ddd 100644
--- a/app/code/Magento/QuoteGraphQl/Model/Resolver/PlaceOrder.php
+++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/PlaceOrder.php
@@ -65,6 +65,13 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
$cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId());
+ if ($context->getUserId() === 0) {
+ if (!$cart->getCustomerEmail()) {
+ throw new GraphQlInputException(__("Guest email for cart is missing. Please enter"));
+ }
+ $cart->setCheckoutMethod(CartManagementInterface::METHOD_GUEST);
+ }
+
try {
$orderId = $this->cartManagement->placeOrder($cart->getId());
$order = $this->orderRepository->get($orderId);
diff --git a/app/code/Magento/QuoteGraphQl/Model/Resolver/SetGuestEmailOnCart.php b/app/code/Magento/QuoteGraphQl/Model/Resolver/SetGuestEmailOnCart.php
new file mode 100644
index 0000000000000..d621057348b54
--- /dev/null
+++ b/app/code/Magento/QuoteGraphQl/Model/Resolver/SetGuestEmailOnCart.php
@@ -0,0 +1,95 @@
+getCartForUser = $getCartForUser;
+ $this->cartRepository = $cartRepository;
+ $this->emailValidator = $emailValidator;
+ }
+
+ /**
+ * @inheritdoc
+ */
+ public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null)
+ {
+ if (!isset($args['input']['cart_id']) || empty($args['input']['cart_id'])) {
+ throw new GraphQlInputException(__('Required parameter "cart_id" is missing'));
+ }
+ $maskedCartId = $args['input']['cart_id'];
+
+ if (!isset($args['input']['email']) || empty($args['input']['email'])) {
+ throw new GraphQlInputException(__('Required parameter "email" is missing'));
+ }
+
+ if (false === $this->emailValidator->isValid($args['input']['email'])) {
+ throw new GraphQlInputException(__('Invalid email format'));
+ }
+ $email = $args['input']['email'];
+
+ $currentUserId = $context->getUserId();
+
+ if ($currentUserId !== 0) {
+ throw new GraphQlInputException(__('The request is not allowed for logged in customers'));
+ }
+
+ $cart = $this->getCartForUser->execute($maskedCartId, $currentUserId);
+ $cart->setCustomerEmail($email);
+
+ try {
+ $this->cartRepository->save($cart);
+ } catch (CouldNotSaveException $e) {
+ throw new LocalizedException(__($e->getMessage()), $e);
+ }
+
+ return [
+ 'cart' => [
+ 'model' => $cart,
+ ],
+ ];
+ }
+}
diff --git a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls
index 9ec3492f64531..711e6cbc7f5f6 100644
--- a/app/code/Magento/QuoteGraphQl/etc/schema.graphqls
+++ b/app/code/Magento/QuoteGraphQl/etc/schema.graphqls
@@ -17,6 +17,7 @@ type Mutation {
setBillingAddressOnCart(input: SetBillingAddressOnCartInput): SetBillingAddressOnCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetBillingAddressOnCart")
setShippingMethodsOnCart(input: SetShippingMethodsOnCartInput): SetShippingMethodsOnCartOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SetShippingMethodsOnCart")
setPaymentMethodOnCart(input: SetPaymentMethodOnCartInput): SetPaymentMethodOnCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\SetPaymentMethodOnCart")
+ setGuestEmailOnCart(input: SetGuestEmailOnCartInput): SetGuestEmailOnCartOutput @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\SetGuestEmailOnCart")
placeOrder(input: PlaceOrderInput): PlaceOrderOutput @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\PlaceOrder")
}
@@ -129,6 +130,24 @@ input PaymentMethodInput {
purchase_order_number: String @doc(description:"Purchase order number")
}
+input SetGuestEmailOnCartInput {
+ cart_id: String!
+ email: String!
+}
+
+type CartPrices {
+ grand_total: Money
+ subtotal_including_tax: Money
+ subtotal_excluding_tax: Money
+ subtotal_with_discount_excluding_tax: Money
+ applied_taxes: [CartTaxItem]
+}
+
+type CartTaxItem {
+ amount: Money!
+ label: String!
+}
+
type SetPaymentMethodOnCartOutput {
cart: Cart!
}
@@ -156,10 +175,12 @@ type PlaceOrderOutput {
type Cart {
items: [CartItemInterface] @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartItems")
applied_coupon: AppliedCoupon @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\AppliedCoupon")
+ email: String @resolver (class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartEmail")
shipping_addresses: [CartAddress]! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\ShippingAddresses")
billing_address: CartAddress! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\BillingAddress")
available_payment_methods: [AvailablePaymentMethod] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AvailablePaymentMethods") @doc(description: "Available payment methods")
selected_payment_method: SelectedPaymentMethod @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SelectedPaymentMethod")
+ prices: CartPrices @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartPrices")
}
type CartAddress {
@@ -258,6 +279,10 @@ type RemoveItemFromCartOutput {
cart: Cart!
}
+type SetGuestEmailOnCartOutput {
+ cart: Cart!
+}
+
type SimpleCartItem implements CartItemInterface @doc(description: "Simple Cart Item") {
customizable_options: [SelectedCustomizableOption] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\CustomizableOptions")
}
diff --git a/app/code/Magento/Reports/Test/Mftf/Data/AdminMenuData.xml b/app/code/Magento/Reports/Test/Mftf/Data/AdminMenuData.xml
new file mode 100644
index 0000000000000..e77e3ee8abd87
--- /dev/null
+++ b/app/code/Magento/Reports/Test/Mftf/Data/AdminMenuData.xml
@@ -0,0 +1,86 @@
+
+
+
+
+
+ Abandoned Carts
+ Abandoned Carts
+ magento-reports-report-shopcart-abandoned
+
+
+ Bestsellers Report
+ Bestsellers
+ magento-reports-report-products-bestsellers
+
+
+ Coupons Report
+ Coupons
+ magento-reports-report-salesroot-coupons
+
+
+ Downloads Report
+ Downloads
+ magento-downloadable-report-products-downloads
+
+
+ Invoice Report
+ Invoiced
+ magento-reports-report-salesroot-invoiced
+
+
+ Low Stock Report
+ Low Stock
+ magento-reports-report-products-lowstock
+
+
+ New Accounts Report
+ New
+ magento-reports-report-customers-accounts
+
+
+ Order Count Report
+ Order Count
+ magento-reports-report-customers-orders
+
+
+ Ordered Products Report
+ Ordered
+ magento-reports-report-products-sold
+
+
+ Orders Report
+ Orders
+ magento-reports-report-salesroot-sales
+
+
+ Order Total Report
+ Order Total
+ magento-reports-report-customers-totals
+
+
+ Products in Carts
+ Products in Cart
+ magento-reports-report-shopcart-product
+
+
+ Refresh Statistics
+ Refresh Statistics
+ magento-reports-report-statistics-refresh
+
+
+ Tax Report
+ Tax
+ magento-reports-report-salesroot-tax
+
+
+ Product Views Report
+ Views
+ magento-reports-report-products-viewed
+
+
diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsAbandonedCartsNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsAbandonedCartsNavigateMenuTest.xml
new file mode 100644
index 0000000000000..342955e0684b3
--- /dev/null
+++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsAbandonedCartsNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsBestsellersNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsBestsellersNavigateMenuTest.xml
new file mode 100644
index 0000000000000..259f2cde2786a
--- /dev/null
+++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsBestsellersNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsCouponsNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsCouponsNavigateMenuTest.xml
new file mode 100644
index 0000000000000..321f3078bc63f
--- /dev/null
+++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsCouponsNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsDownloadsNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsDownloadsNavigateMenuTest.xml
new file mode 100644
index 0000000000000..584c1af6683aa
--- /dev/null
+++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsDownloadsNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsInvoicedNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsInvoicedNavigateMenuTest.xml
new file mode 100644
index 0000000000000..34aec0620cad9
--- /dev/null
+++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsInvoicedNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsLowStockNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsLowStockNavigateMenuTest.xml
new file mode 100644
index 0000000000000..5d91d65a3a457
--- /dev/null
+++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsLowStockNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsNewNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsNewNavigateMenuTest.xml
new file mode 100644
index 0000000000000..aeb35ba65a380
--- /dev/null
+++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsNewNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderCountNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderCountNavigateMenuTest.xml
new file mode 100644
index 0000000000000..1bfbc654746e6
--- /dev/null
+++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderCountNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderTotalNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderTotalNavigateMenuTest.xml
new file mode 100644
index 0000000000000..88c94b53f5233
--- /dev/null
+++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderTotalNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderedNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderedNavigateMenuTest.xml
new file mode 100644
index 0000000000000..e81239539a5b5
--- /dev/null
+++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrderedNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrdersNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrdersNavigateMenuTest.xml
new file mode 100644
index 0000000000000..13fc8e7353139
--- /dev/null
+++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsOrdersNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsProductsInCartNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsProductsInCartNavigateMenuTest.xml
new file mode 100644
index 0000000000000..03877f8e58ecc
--- /dev/null
+++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsProductsInCartNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsRefreshStatisticsNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsRefreshStatisticsNavigateMenuTest.xml
new file mode 100644
index 0000000000000..d05fc091357df
--- /dev/null
+++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsRefreshStatisticsNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsTaxNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsTaxNavigateMenuTest.xml
new file mode 100644
index 0000000000000..11a065c933a3b
--- /dev/null
+++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsTaxNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsViewsNavigateMenuTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsViewsNavigateMenuTest.xml
new file mode 100644
index 0000000000000..9154b96c71e38
--- /dev/null
+++ b/app/code/Magento/Reports/Test/Mftf/Test/AdminReportsViewsNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Review/Test/Mftf/Data/AdminMenuData.xml b/app/code/Magento/Review/Test/Mftf/Data/AdminMenuData.xml
new file mode 100644
index 0000000000000..89882707f5ebd
--- /dev/null
+++ b/app/code/Magento/Review/Test/Mftf/Data/AdminMenuData.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+ Reviews
+ Reviews
+ magento-review-catalog-reviews-ratings-reviews-all
+
+
+ Customer Reviews Report
+ By Customers
+ magento-review-report-review-customer
+
+
+ Product Reviews Report
+ By Products
+ magento-review-report-review-product
+
+
+ Ratings
+ Rating
+ magento-review-catalog-reviews-ratings-ratings
+
+
diff --git a/app/code/Magento/Review/Test/Mftf/Test/AdminMarketingReviewsNavigateMenuTest.xml b/app/code/Magento/Review/Test/Mftf/Test/AdminMarketingReviewsNavigateMenuTest.xml
new file mode 100644
index 0000000000000..fade220d22100
--- /dev/null
+++ b/app/code/Magento/Review/Test/Mftf/Test/AdminMarketingReviewsNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Review/Test/Mftf/Test/AdminReportsByCustomersNavigateMenuTest.xml b/app/code/Magento/Review/Test/Mftf/Test/AdminReportsByCustomersNavigateMenuTest.xml
new file mode 100644
index 0000000000000..58492424e76f7
--- /dev/null
+++ b/app/code/Magento/Review/Test/Mftf/Test/AdminReportsByCustomersNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Review/Test/Mftf/Test/AdminReportsByProductsNavigateMenuTest.xml b/app/code/Magento/Review/Test/Mftf/Test/AdminReportsByProductsNavigateMenuTest.xml
new file mode 100644
index 0000000000000..e848aa4f22023
--- /dev/null
+++ b/app/code/Magento/Review/Test/Mftf/Test/AdminReportsByProductsNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Review/Test/Mftf/Test/AdminStoresRatingNavigateMenuTest.xml b/app/code/Magento/Review/Test/Mftf/Test/AdminStoresRatingNavigateMenuTest.xml
new file mode 100644
index 0000000000000..511ed5439dc3d
--- /dev/null
+++ b/app/code/Magento/Review/Test/Mftf/Test/AdminStoresRatingNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Sales/Model/Order/Creditmemo/Sender/EmailSender.php b/app/code/Magento/Sales/Model/Order/Creditmemo/Sender/EmailSender.php
index ecd5670a319e7..3d2c13cbaaaa9 100644
--- a/app/code/Magento/Sales/Model/Order/Creditmemo/Sender/EmailSender.php
+++ b/app/code/Magento/Sales/Model/Order/Creditmemo/Sender/EmailSender.php
@@ -89,6 +89,7 @@ public function __construct(
* @param bool $forceSyncMode
*
* @return bool
+ * @throws \Exception
*/
public function send(
\Magento\Sales\Api\Data\OrderInterface $order,
@@ -96,7 +97,7 @@ public function send(
\Magento\Sales\Api\Data\CreditmemoCommentCreationInterface $comment = null,
$forceSyncMode = false
) {
- $creditmemo->setSendEmail(true);
+ $creditmemo->setSendEmail($this->identityContainer->isEnabled());
if (!$this->globalConfig->getValue('sales_email/general/async_sending') || $forceSyncMode) {
$transport = [
@@ -145,6 +146,7 @@ public function send(
* @param \Magento\Sales\Api\Data\OrderInterface $order
*
* @return string
+ * @throws \Exception
*/
private function getPaymentHtml(\Magento\Sales\Api\Data\OrderInterface $order)
{
diff --git a/app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoSender.php b/app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoSender.php
index 8004483583114..126fe4f93f1e0 100644
--- a/app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoSender.php
+++ b/app/code/Magento/Sales/Model/Order/Email/Sender/CreditmemoSender.php
@@ -57,10 +57,10 @@ class CreditmemoSender extends Sender
* @param CreditmemoIdentity $identityContainer
* @param Order\Email\SenderBuilderFactory $senderBuilderFactory
* @param \Psr\Log\LoggerInterface $logger
+ * @param Renderer $addressRenderer
* @param PaymentHelper $paymentHelper
* @param CreditmemoResource $creditmemoResource
* @param \Magento\Framework\App\Config\ScopeConfigInterface $globalConfig
- * @param Renderer $addressRenderer
* @param ManagerInterface $eventManager
*/
public function __construct(
@@ -96,10 +96,11 @@ public function __construct(
* @param Creditmemo $creditmemo
* @param bool $forceSyncMode
* @return bool
+ * @throws \Exception
*/
public function send(Creditmemo $creditmemo, $forceSyncMode = false)
{
- $creditmemo->setSendEmail(true);
+ $creditmemo->setSendEmail($this->identityContainer->isEnabled());
if (!$this->globalConfig->getValue('sales_email/general/async_sending') || $forceSyncMode) {
$order = $creditmemo->getOrder();
@@ -146,6 +147,7 @@ public function send(Creditmemo $creditmemo, $forceSyncMode = false)
*
* @param Order $order
* @return string
+ * @throws \Exception
*/
protected function getPaymentHtml(Order $order)
{
diff --git a/app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceSender.php b/app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceSender.php
index 994fd79945cfd..ba3895cfa1524 100644
--- a/app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceSender.php
+++ b/app/code/Magento/Sales/Model/Order/Email/Sender/InvoiceSender.php
@@ -57,10 +57,10 @@ class InvoiceSender extends Sender
* @param InvoiceIdentity $identityContainer
* @param Order\Email\SenderBuilderFactory $senderBuilderFactory
* @param \Psr\Log\LoggerInterface $logger
+ * @param Renderer $addressRenderer
* @param PaymentHelper $paymentHelper
* @param InvoiceResource $invoiceResource
* @param \Magento\Framework\App\Config\ScopeConfigInterface $globalConfig
- * @param Renderer $addressRenderer
* @param ManagerInterface $eventManager
*/
public function __construct(
@@ -96,10 +96,11 @@ public function __construct(
* @param Invoice $invoice
* @param bool $forceSyncMode
* @return bool
+ * @throws \Exception
*/
public function send(Invoice $invoice, $forceSyncMode = false)
{
- $invoice->setSendEmail(true);
+ $invoice->setSendEmail($this->identityContainer->isEnabled());
if (!$this->globalConfig->getValue('sales_email/general/async_sending') || $forceSyncMode) {
$order = $invoice->getOrder();
@@ -146,6 +147,7 @@ public function send(Invoice $invoice, $forceSyncMode = false)
*
* @param Order $order
* @return string
+ * @throws \Exception
*/
protected function getPaymentHtml(Order $order)
{
diff --git a/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentSender.php b/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentSender.php
index 6729c746f5565..10e5e37a49394 100644
--- a/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentSender.php
+++ b/app/code/Magento/Sales/Model/Order/Email/Sender/ShipmentSender.php
@@ -57,10 +57,10 @@ class ShipmentSender extends Sender
* @param ShipmentIdentity $identityContainer
* @param Order\Email\SenderBuilderFactory $senderBuilderFactory
* @param \Psr\Log\LoggerInterface $logger
+ * @param Renderer $addressRenderer
* @param PaymentHelper $paymentHelper
* @param ShipmentResource $shipmentResource
* @param \Magento\Framework\App\Config\ScopeConfigInterface $globalConfig
- * @param Renderer $addressRenderer
* @param ManagerInterface $eventManager
*/
public function __construct(
@@ -96,10 +96,11 @@ public function __construct(
* @param Shipment $shipment
* @param bool $forceSyncMode
* @return bool
+ * @throws \Exception
*/
public function send(Shipment $shipment, $forceSyncMode = false)
{
- $shipment->setSendEmail(true);
+ $shipment->setSendEmail($this->identityContainer->isEnabled());
if (!$this->globalConfig->getValue('sales_email/general/async_sending') || $forceSyncMode) {
$order = $shipment->getOrder();
@@ -146,6 +147,7 @@ public function send(Shipment $shipment, $forceSyncMode = false)
*
* @param Order $order
* @return string
+ * @throws \Exception
*/
protected function getPaymentHtml(Order $order)
{
diff --git a/app/code/Magento/Sales/Model/Order/Invoice/Sender/EmailSender.php b/app/code/Magento/Sales/Model/Order/Invoice/Sender/EmailSender.php
index aa0687bee504f..5ae3306ddf75b 100644
--- a/app/code/Magento/Sales/Model/Order/Invoice/Sender/EmailSender.php
+++ b/app/code/Magento/Sales/Model/Order/Invoice/Sender/EmailSender.php
@@ -89,6 +89,7 @@ public function __construct(
* @param bool $forceSyncMode
*
* @return bool
+ * @throws \Exception
*/
public function send(
\Magento\Sales\Api\Data\OrderInterface $order,
@@ -96,7 +97,7 @@ public function send(
\Magento\Sales\Api\Data\InvoiceCommentCreationInterface $comment = null,
$forceSyncMode = false
) {
- $invoice->setSendEmail(true);
+ $invoice->setSendEmail($this->identityContainer->isEnabled());
if (!$this->globalConfig->getValue('sales_email/general/async_sending') || $forceSyncMode) {
$transport = [
@@ -145,6 +146,7 @@ public function send(
* @param \Magento\Sales\Api\Data\OrderInterface $order
*
* @return string
+ * @throws \Exception
*/
private function getPaymentHtml(\Magento\Sales\Api\Data\OrderInterface $order)
{
diff --git a/app/code/Magento/Sales/Model/Order/Shipment/Sender/EmailSender.php b/app/code/Magento/Sales/Model/Order/Shipment/Sender/EmailSender.php
index 0a393548069f5..3657f84d4445d 100644
--- a/app/code/Magento/Sales/Model/Order/Shipment/Sender/EmailSender.php
+++ b/app/code/Magento/Sales/Model/Order/Shipment/Sender/EmailSender.php
@@ -89,6 +89,7 @@ public function __construct(
* @param bool $forceSyncMode
*
* @return bool
+ * @throws \Exception
*/
public function send(
\Magento\Sales\Api\Data\OrderInterface $order,
@@ -96,7 +97,7 @@ public function send(
\Magento\Sales\Api\Data\ShipmentCommentCreationInterface $comment = null,
$forceSyncMode = false
) {
- $shipment->setSendEmail(true);
+ $shipment->setSendEmail($this->identityContainer->isEnabled());
if (!$this->globalConfig->getValue('sales_email/general/async_sending') || $forceSyncMode) {
$transport = [
@@ -145,6 +146,7 @@ public function send(
* @param \Magento\Sales\Api\Data\OrderInterface $order
*
* @return string
+ * @throws \Exception
*/
private function getPaymentHtml(\Magento\Sales\Api\Data\OrderInterface $order)
{
diff --git a/app/code/Magento/Sales/Test/Mftf/Data/AdminMenuData.xml b/app/code/Magento/Sales/Test/Mftf/Data/AdminMenuData.xml
new file mode 100644
index 0000000000000..4f6faccbb26d4
--- /dev/null
+++ b/app/code/Magento/Sales/Test/Mftf/Data/AdminMenuData.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+ Credit Memos
+ Credit Memos
+ magento-sales-sales-creditmemo
+
+
+ Invoices
+ Invoices
+ magento-sales-sales-invoice
+
+
+ Orders
+ Orders
+ magento-sales-sales-order
+
+
+ Shipments
+ Shipments
+ magento-sales-sales-shipment
+
+
+ Transactions
+ Transactions
+ magento-sales-sales-transactions
+
+
+ Order Status
+ Order Status
+ magento-sales-system-order-statuses
+
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesCreditMemosNavigateMenuTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesCreditMemosNavigateMenuTest.xml
new file mode 100644
index 0000000000000..af7cc1822d215
--- /dev/null
+++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesCreditMemosNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesInvoicesNavigateMenuTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesInvoicesNavigateMenuTest.xml
new file mode 100644
index 0000000000000..5a38a66d1f4b2
--- /dev/null
+++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesInvoicesNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesOrdersNavigateMenuTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesOrdersNavigateMenuTest.xml
new file mode 100644
index 0000000000000..8099254923a2c
--- /dev/null
+++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesOrdersNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesShipmentsNavigateMenuTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesShipmentsNavigateMenuTest.xml
new file mode 100644
index 0000000000000..5717c6c90fc17
--- /dev/null
+++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesShipmentsNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesTransactionsNavigateMenuTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesTransactionsNavigateMenuTest.xml
new file mode 100644
index 0000000000000..68933be92efe6
--- /dev/null
+++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSalesTransactionsNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminStoresOrderStatusNavigateMenuTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminStoresOrderStatusNavigateMenuTest.xml
new file mode 100644
index 0000000000000..d55cde1449033
--- /dev/null
+++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminStoresOrderStatusNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Sender/EmailSenderTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Sender/EmailSenderTest.php
index 9fd2a8b0d929f..467476c9bb406 100644
--- a/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Sender/EmailSenderTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Sender/EmailSenderTest.php
@@ -1,5 +1,4 @@
creditmemoMock->expects($this->once())
->method('setSendEmail')
- ->with(true);
+ ->with($emailSendingResult);
if (!$configValue || $forceSyncMode) {
$transport = [
@@ -279,7 +278,7 @@ public function testSend($configValue, $forceSyncMode, $isComment, $emailSending
->method('setTemplateVars')
->with($transport->getData());
- $this->identityContainerMock->expects($this->once())
+ $this->identityContainerMock->expects($this->exactly(2))
->method('isEnabled')
->willReturn($emailSendingResult);
diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/CreditmemoSenderTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/CreditmemoSenderTest.php
index 31bf846689230..1f074d7262f4d 100644
--- a/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/CreditmemoSenderTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/CreditmemoSenderTest.php
@@ -7,6 +7,9 @@
use Magento\Sales\Model\Order\Email\Sender\CreditmemoSender;
+/**
+ * Test for Magento\Sales\Model\Order\Email\Sender\CreditmemoSender class.
+ */
class CreditmemoSenderTest extends AbstractSenderTest
{
/**
@@ -90,7 +93,7 @@ public function testSend($configValue, $forceSyncMode, $customerNoteNotify, $ema
$this->creditmemoMock->expects($this->once())
->method('setSendEmail')
- ->with(true);
+ ->with($emailSendingResult);
$this->globalConfig->expects($this->once())
->method('getValue')
@@ -130,7 +133,7 @@ public function testSend($configValue, $forceSyncMode, $customerNoteNotify, $ema
]
);
- $this->identityContainerMock->expects($this->once())
+ $this->identityContainerMock->expects($this->exactly(2))
->method('isEnabled')
->willReturn($emailSendingResult);
@@ -197,6 +200,8 @@ public function sendDataProvider()
* @param bool $isVirtualOrder
* @param int $formatCallCount
* @param string|null $expectedShippingAddress
+ *
+ * @return void
* @dataProvider sendVirtualOrderDataProvider
*/
public function testSendVirtualOrder($isVirtualOrder, $formatCallCount, $expectedShippingAddress)
@@ -207,7 +212,7 @@ public function testSendVirtualOrder($isVirtualOrder, $formatCallCount, $expecte
$this->creditmemoMock->expects($this->once())
->method('setSendEmail')
- ->with(true);
+ ->with(false);
$this->globalConfig->expects($this->once())
->method('getValue')
@@ -242,7 +247,7 @@ public function testSendVirtualOrder($isVirtualOrder, $formatCallCount, $expecte
]
);
- $this->identityContainerMock->expects($this->once())
+ $this->identityContainerMock->expects($this->exactly(2))
->method('isEnabled')
->willReturn(false);
diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/InvoiceSenderTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/InvoiceSenderTest.php
index 9c54c716e4207..d1aa5af53da4d 100644
--- a/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/InvoiceSenderTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/InvoiceSenderTest.php
@@ -7,6 +7,9 @@
use Magento\Sales\Model\Order\Email\Sender\InvoiceSender;
+/**
+ * Test for Magento\Sales\Model\Order\Email\Sender\InvoiceSender class.
+ */
class InvoiceSenderTest extends AbstractSenderTest
{
/**
@@ -90,7 +93,7 @@ public function testSend($configValue, $forceSyncMode, $customerNoteNotify, $ema
$this->invoiceMock->expects($this->once())
->method('setSendEmail')
- ->with(true);
+ ->with($emailSendingResult);
$this->globalConfig->expects($this->once())
->method('getValue')
@@ -136,7 +139,7 @@ public function testSend($configValue, $forceSyncMode, $customerNoteNotify, $ema
]
);
- $this->identityContainerMock->expects($this->once())
+ $this->identityContainerMock->expects($this->exactly(2))
->method('isEnabled')
->willReturn($emailSendingResult);
@@ -212,7 +215,7 @@ public function testSendVirtualOrder($isVirtualOrder, $formatCallCount, $expecte
$this->invoiceMock->expects($this->once())
->method('setSendEmail')
- ->with(true);
+ ->with(false);
$this->globalConfig->expects($this->once())
->method('getValue')
@@ -247,7 +250,7 @@ public function testSendVirtualOrder($isVirtualOrder, $formatCallCount, $expecte
]
);
- $this->identityContainerMock->expects($this->once())
+ $this->identityContainerMock->expects($this->exactly(2))
->method('isEnabled')
->willReturn(false);
diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/ShipmentSenderTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/ShipmentSenderTest.php
index b1b18af63b590..2d7b42bccae5a 100644
--- a/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/ShipmentSenderTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Email/Sender/ShipmentSenderTest.php
@@ -7,6 +7,9 @@
use Magento\Sales\Model\Order\Email\Sender\ShipmentSender;
+/**
+ * Test for Magento\Sales\Model\Order\Email\Sender\ShipmentSender class.
+ */
class ShipmentSenderTest extends AbstractSenderTest
{
/**
@@ -90,7 +93,7 @@ public function testSend($configValue, $forceSyncMode, $customerNoteNotify, $ema
$this->shipmentMock->expects($this->once())
->method('setSendEmail')
- ->with(true);
+ ->with($emailSendingResult);
$this->globalConfig->expects($this->once())
->method('getValue')
@@ -136,7 +139,7 @@ public function testSend($configValue, $forceSyncMode, $customerNoteNotify, $ema
]
);
- $this->identityContainerMock->expects($this->once())
+ $this->identityContainerMock->expects($this->exactly(2))
->method('isEnabled')
->willReturn($emailSendingResult);
@@ -212,7 +215,7 @@ public function testSendVirtualOrder($isVirtualOrder, $formatCallCount, $expecte
$this->shipmentMock->expects($this->once())
->method('setSendEmail')
- ->with(true);
+ ->with(false);
$this->globalConfig->expects($this->once())
->method('getValue')
@@ -247,7 +250,7 @@ public function testSendVirtualOrder($isVirtualOrder, $formatCallCount, $expecte
]
);
- $this->identityContainerMock->expects($this->once())
+ $this->identityContainerMock->expects($this->exactly(2))
->method('isEnabled')
->willReturn(false);
$this->shipmentResourceMock->expects($this->once())
diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Sender/EmailSenderTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Sender/EmailSenderTest.php
index 8a4e2920ba207..dcf689cf7d53b 100644
--- a/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Sender/EmailSenderTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Invoice/Sender/EmailSenderTest.php
@@ -247,7 +247,7 @@ public function testSend($configValue, $forceSyncMode, $isComment, $emailSending
$this->invoiceMock->expects($this->once())
->method('setSendEmail')
- ->with(true);
+ ->with($emailSendingResult);
if (!$configValue || $forceSyncMode) {
$transport = [
@@ -277,7 +277,7 @@ public function testSend($configValue, $forceSyncMode, $isComment, $emailSending
->method('setTemplateVars')
->with($transport->getData());
- $this->identityContainerMock->expects($this->once())
+ $this->identityContainerMock->expects($this->exactly(2))
->method('isEnabled')
->willReturn($emailSendingResult);
diff --git a/app/code/Magento/Sales/Test/Unit/Model/Order/Shipment/Sender/EmailSenderTest.php b/app/code/Magento/Sales/Test/Unit/Model/Order/Shipment/Sender/EmailSenderTest.php
index 94347e8b32d54..391e99ba6f835 100644
--- a/app/code/Magento/Sales/Test/Unit/Model/Order/Shipment/Sender/EmailSenderTest.php
+++ b/app/code/Magento/Sales/Test/Unit/Model/Order/Shipment/Sender/EmailSenderTest.php
@@ -249,7 +249,7 @@ public function testSend($configValue, $forceSyncMode, $isComment, $emailSending
$this->shipmentMock->expects($this->once())
->method('setSendEmail')
- ->with(true);
+ ->with($emailSendingResult);
if (!$configValue || $forceSyncMode) {
$transport = [
@@ -279,7 +279,7 @@ public function testSend($configValue, $forceSyncMode, $isComment, $emailSending
->method('setTemplateVars')
->with($transport->getData());
- $this->identityContainerMock->expects($this->once())
+ $this->identityContainerMock->expects($this->exactly(2))
->method('isEnabled')
->willReturn($emailSendingResult);
diff --git a/app/code/Magento/SalesRule/Test/Mftf/Data/AdminMenuData.xml b/app/code/Magento/SalesRule/Test/Mftf/Data/AdminMenuData.xml
new file mode 100644
index 0000000000000..5a42980df1bbf
--- /dev/null
+++ b/app/code/Magento/SalesRule/Test/Mftf/Data/AdminMenuData.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ Cart Price Rules
+ Cart Price Rules
+ magento-salesrule-promo-quote
+
+
diff --git a/app/code/Magento/SalesRule/Test/Mftf/Test/AdminMarketingCartPriceRulesNavigateMenuTest.xml b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminMarketingCartPriceRulesNavigateMenuTest.xml
new file mode 100644
index 0000000000000..f281b0abf87a0
--- /dev/null
+++ b/app/code/Magento/SalesRule/Test/Mftf/Test/AdminMarketingCartPriceRulesNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Search/Test/Mftf/Section/StorefrontQuickSearchResultsSection.xml b/app/code/Magento/Search/Test/Mftf/Section/StorefrontQuickSearchResultsSection.xml
index ff9fce57c4524..0bb929d889351 100644
--- a/app/code/Magento/Search/Test/Mftf/Section/StorefrontQuickSearchResultsSection.xml
+++ b/app/code/Magento/Search/Test/Mftf/Section/StorefrontQuickSearchResultsSection.xml
@@ -11,11 +11,15 @@
diff --git a/app/code/Magento/Sitemap/Test/Mftf/Data/AdminMenuData.xml b/app/code/Magento/Sitemap/Test/Mftf/Data/AdminMenuData.xml
new file mode 100644
index 0000000000000..c8fd6a751cb22
--- /dev/null
+++ b/app/code/Magento/Sitemap/Test/Mftf/Data/AdminMenuData.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ Site Map
+ Site Map
+ magento-sitemap-catalog-sitemap
+
+
diff --git a/app/code/Magento/Sitemap/Test/Mftf/Test/AdminMarketingSiteMapNavigateMenuTest.xml b/app/code/Magento/Sitemap/Test/Mftf/Test/AdminMarketingSiteMapNavigateMenuTest.xml
new file mode 100644
index 0000000000000..54543fab8649d
--- /dev/null
+++ b/app/code/Magento/Sitemap/Test/Mftf/Test/AdminMarketingSiteMapNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateNewStoreGroupActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateNewStoreGroupActionGroup.xml
index 7f1a63d3db6f2..870b92d17e679 100644
--- a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateNewStoreGroupActionGroup.xml
+++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateNewStoreGroupActionGroup.xml
@@ -42,4 +42,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewActionGroup.xml
index 9b942109785d4..d5ebb9b79fe07 100644
--- a/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewActionGroup.xml
+++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AdminCreateStoreViewActionGroup.xml
@@ -62,4 +62,4 @@
-
+
\ No newline at end of file
diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreConfigurationBackendActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreConfigurationBackendActionGroup.xml
new file mode 100644
index 0000000000000..38030f59a7a33
--- /dev/null
+++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreConfigurationBackendActionGroup.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreFrontendActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreFrontendActionGroup.xml
new file mode 100644
index 0000000000000..afd64e33e8b36
--- /dev/null
+++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreFrontendActionGroup.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreGroupFormActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreGroupFormActionGroup.xml
new file mode 100644
index 0000000000000..a8b8b7bb6d07f
--- /dev/null
+++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreGroupFormActionGroup.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreGroupInGridActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreGroupInGridActionGroup.xml
new file mode 100644
index 0000000000000..fb36cbd0d1812
--- /dev/null
+++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreGroupInGridActionGroup.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreViewFormActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreViewFormActionGroup.xml
new file mode 100644
index 0000000000000..92ebbc3950131
--- /dev/null
+++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreViewFormActionGroup.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreViewInGridActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreViewInGridActionGroup.xml
new file mode 100644
index 0000000000000..fad8eec9990cc
--- /dev/null
+++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/AssertStoreViewInGridActionGroup.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/ChangeStoreInStoreViewActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/ChangeStoreInStoreViewActionGroup.xml
new file mode 100644
index 0000000000000..15784235d5918
--- /dev/null
+++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/ChangeStoreInStoreViewActionGroup.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Store/Test/Mftf/ActionGroup/EditCustomStoreGroupAcceptWarningMessageActionGroup.xml b/app/code/Magento/Store/Test/Mftf/ActionGroup/EditCustomStoreGroupAcceptWarningMessageActionGroup.xml
new file mode 100644
index 0000000000000..8889795c8acbf
--- /dev/null
+++ b/app/code/Magento/Store/Test/Mftf/ActionGroup/EditCustomStoreGroupAcceptWarningMessageActionGroup.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Store/Test/Mftf/Section/AdminStoreGroupActionsSection.xml b/app/code/Magento/Store/Test/Mftf/Section/AdminStoreGroupActionsSection.xml
index f79ea080ed1ca..9ad0f40cc4d01 100644
--- a/app/code/Magento/Store/Test/Mftf/Section/AdminStoreGroupActionsSection.xml
+++ b/app/code/Magento/Store/Test/Mftf/Section/AdminStoreGroupActionsSection.xml
@@ -8,5 +8,6 @@
diff --git a/app/code/Magento/Store/Test/Mftf/Section/AdminStoresGridSection.xml b/app/code/Magento/Store/Test/Mftf/Section/AdminStoresGridSection.xml
index d7006fd01b2ff..7e08fb999308a 100644
--- a/app/code/Magento/Store/Test/Mftf/Section/AdminStoresGridSection.xml
+++ b/app/code/Magento/Store/Test/Mftf/Section/AdminStoresGridSection.xml
@@ -21,6 +21,7 @@
+
diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithCustomWebsiteAndDefaultCategoryTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithCustomWebsiteAndDefaultCategoryTest.xml
new file mode 100644
index 0000000000000..8e8f31eaca865
--- /dev/null
+++ b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithCustomWebsiteAndDefaultCategoryTest.xml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithCustomWebsiteAndRootCategoryTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithCustomWebsiteAndRootCategoryTest.xml
new file mode 100644
index 0000000000000..18f9822145dec
--- /dev/null
+++ b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithCustomWebsiteAndRootCategoryTest.xml
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithDefaultWebsiteAndDefaultCategoryTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithDefaultWebsiteAndDefaultCategoryTest.xml
new file mode 100644
index 0000000000000..ddc5d061c1db2
--- /dev/null
+++ b/app/code/Magento/Store/Test/Mftf/Test/AdminCreateStoreGroupWithDefaultWebsiteAndDefaultCategoryTest.xml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminMoveStoreToOtherGroupSameWebsiteTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminMoveStoreToOtherGroupSameWebsiteTest.xml
new file mode 100644
index 0000000000000..b86b99936dbe2
--- /dev/null
+++ b/app/code/Magento/Store/Test/Mftf/Test/AdminMoveStoreToOtherGroupSameWebsiteTest.xml
@@ -0,0 +1,95 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreGroupAcceptAlertAndVerifyStoreViewFormTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreGroupAcceptAlertAndVerifyStoreViewFormTest.xml
new file mode 100644
index 0000000000000..9c84388d86f99
--- /dev/null
+++ b/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreGroupAcceptAlertAndVerifyStoreViewFormTest.xml
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreGroupAndVerifyStoreViewFormTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreGroupAndVerifyStoreViewFormTest.xml
new file mode 100644
index 0000000000000..3d85a34901434
--- /dev/null
+++ b/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreGroupAndVerifyStoreViewFormTest.xml
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreViewTest.xml b/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreViewTest.xml
new file mode 100644
index 0000000000000..054ee789fbdc5
--- /dev/null
+++ b/app/code/Magento/Store/Test/Mftf/Test/AdminUpdateStoreViewTest.xml
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/code/Magento/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php b/app/code/Magento/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php
index bff489ee50c2f..77b3cfa3a08bb 100644
--- a/app/code/Magento/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php
+++ b/app/code/Magento/Tax/Model/Sales/Total/Quote/CommonTaxCollector.php
@@ -348,7 +348,7 @@ public function mapItems(
$useBaseCurrency
) {
$items = $shippingAssignment->getItems();
- if (!count($items)) {
+ if (empty($items)) {
return [];
}
@@ -478,7 +478,7 @@ protected function prepareQuoteDetails(ShippingAssignmentInterface $shippingAssi
{
$items = $shippingAssignment->getItems();
$address = $shippingAssignment->getShipping()->getAddress();
- if (!count($items)) {
+ if (empty($items)) {
return $this->quoteDetailsDataObjectFactory->create();
}
@@ -688,6 +688,9 @@ public function updateItemTaxInfo($quoteItem, $itemTaxDetails, $baseItemTaxDetai
{
//The price should be base price
$quoteItem->setPrice($baseItemTaxDetails->getPrice());
+ if ($quoteItem->getCustomPrice() && $this->taxHelper->applyTaxOnCustomPrice()) {
+ $quoteItem->setCustomPrice($baseItemTaxDetails->getPrice());
+ }
$quoteItem->setConvertedPrice($itemTaxDetails->getPrice());
$quoteItem->setPriceInclTax($itemTaxDetails->getPriceInclTax());
$quoteItem->setRowTotal($itemTaxDetails->getRowTotal());
diff --git a/app/code/Magento/Tax/Test/Mftf/Data/AdminMenuData.xml b/app/code/Magento/Tax/Test/Mftf/Data/AdminMenuData.xml
new file mode 100644
index 0000000000000..2bed9b0d07918
--- /dev/null
+++ b/app/code/Magento/Tax/Test/Mftf/Data/AdminMenuData.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+ Tax Rules
+ Tax Rules
+ magento-tax-sales-tax-rules
+
+
+ Tax Zones and Rates
+ Tax Zones and Rates
+ magento-tax-sales-tax-rates
+
+
+ Import and Export Tax Rates
+ Import/Export Tax Rates
+ magento-taximportexport-system-convert-tax
+
+
diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminStoresTaxRulesNavigateMenuTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminStoresTaxRulesNavigateMenuTest.xml
new file mode 100644
index 0000000000000..1277d6e5f9fd2
--- /dev/null
+++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminStoresTaxRulesNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminStoresTaxZonesAndRatesNavigateMenuTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminStoresTaxZonesAndRatesNavigateMenuTest.xml
new file mode 100644
index 0000000000000..e0a4d5d9a4016
--- /dev/null
+++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminStoresTaxZonesAndRatesNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Tax/Test/Mftf/Test/AdminSystemImportExportTaxRatesNavigateMenuTest.xml b/app/code/Magento/Tax/Test/Mftf/Test/AdminSystemImportExportTaxRatesNavigateMenuTest.xml
new file mode 100644
index 0000000000000..a84ae61d66305
--- /dev/null
+++ b/app/code/Magento/Tax/Test/Mftf/Test/AdminSystemImportExportTaxRatesNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Tax/Test/Unit/Model/Sales/Total/Quote/CommonTaxCollectorTest.php b/app/code/Magento/Tax/Test/Unit/Model/Sales/Total/Quote/CommonTaxCollectorTest.php
index 9325ec10dc627..50d45ad662bd4 100644
--- a/app/code/Magento/Tax/Test/Unit/Model/Sales/Total/Quote/CommonTaxCollectorTest.php
+++ b/app/code/Magento/Tax/Test/Unit/Model/Sales/Total/Quote/CommonTaxCollectorTest.php
@@ -3,79 +3,106 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+declare(strict_types=1);
namespace Magento\Tax\Test\Unit\Model\Sales\Total\Quote;
-/**
- * Test class for \Magento\Tax\Model\Sales\Total\Quote\Tax
- */
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
+use Magento\Tax\Helper\Data as TaxHelper;
+use Magento\Tax\Api\Data\TaxDetailsItemInterface;
+use Magento\Quote\Model\Quote\Item as QuoteItem;
+use Magento\Store\Model\Store;
+use Magento\Tax\Model\Sales\Total\Quote\CommonTaxCollector;
+use Magento\Tax\Model\Config;
+use Magento\Quote\Model\Quote\Address as QuoteAddress;
+use Magento\Quote\Model\Quote;
+use Magento\Tax\Api\Data\QuoteDetailsItemInterface;
+use Magento\Tax\Api\Data\TaxClassKeyInterface;
+use Magento\Tax\Model\Sales\Quote\ItemDetails;
+use Magento\Tax\Model\TaxClass\Key as TaxClassKey;
+use Magento\Tax\Api\Data\QuoteDetailsItemInterfaceFactory;
+use Magento\Tax\Api\Data\TaxClassKeyInterfaceFactory;
+use Magento\Quote\Api\Data\ShippingAssignmentInterface;
+use Magento\Quote\Api\Data\ShippingInterface;
+use Magento\Quote\Model\Quote\Address\Total as QuoteAddressTotal;
+use PHPUnit\Framework\MockObject\MockObject;
+use PHPUnit\Framework\TestCase;
/**
+ * Common tax collector test
+ *
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
-class CommonTaxCollectorTest extends \PHPUnit\Framework\TestCase
+class CommonTaxCollectorTest extends TestCase
{
/**
- * @var \Magento\Tax\Model\Sales\Total\Quote\CommonTaxCollector
+ * @var CommonTaxCollector
*/
private $commonTaxCollector;
/**
- * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Tax\Model\Config
+ * @var MockObject|Config
*/
private $taxConfig;
/**
- * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Quote\Model\Quote\Address
+ * @var MockObject|QuoteAddress
*/
private $address;
/**
- * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Quote\Model\Quote
+ * @var MockObject|Quote
*/
private $quote;
/**
- * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Store\Model\Store
+ * @var MockObject|Store
*/
private $store;
/**
- * @var \PHPUnit_Framework_MockObject_MockObject|
+ * @var MockObject
*/
protected $taxClassKeyDataObjectFactoryMock;
/**
- * @var \PHPUnit_Framework_MockObject_MockObject|
+ * @var MockObject
*/
protected $quoteDetailsItemDataObjectFactoryMock;
/**
- * @var \Magento\Tax\Api\Data\QuoteDetailsItemInterface
+ * @var QuoteDetailsItemInterface
*/
protected $quoteDetailsItemDataObject;
/**
- * @var \Magento\Tax\Api\Data\TaxClassKeyInterface
+ * @var TaxClassKeyInterface
*/
protected $taxClassKeyDataObject;
+ /**
+ * @var TaxHelper
+ */
+ private $taxHelper;
+
+ /**
+ * {@inheritdoc}
+ */
protected function setUp()
{
$objectManager = new ObjectManager($this);
- $this->taxConfig = $this->getMockBuilder(\Magento\Tax\Model\Config::class)
+ $this->taxConfig = $this->getMockBuilder(Config::class)
->disableOriginalConstructor()
- ->setMethods(['getShippingTaxClass', 'shippingPriceIncludesTax'])
+ ->setMethods(['getShippingTaxClass', 'shippingPriceIncludesTax', 'discountTax'])
->getMock();
- $this->store = $this->getMockBuilder(\Magento\Store\Model\Store::class)
+ $this->store = $this->getMockBuilder(Store::class)
->disableOriginalConstructor()
->setMethods(['__wakeup'])
->getMock();
- $this->quote = $this->getMockBuilder(\Magento\Quote\Model\Quote::class)
+ $this->quote = $this->getMockBuilder(Quote::class)
->disableOriginalConstructor()
->setMethods(['__wakeup', 'getStore'])
->getMock();
@@ -84,7 +111,7 @@ protected function setUp()
->method('getStore')
->will($this->returnValue($this->store));
- $this->address = $this->getMockBuilder(\Magento\Quote\Model\Quote\Address::class)
+ $this->address = $this->getMockBuilder(QuoteAddress::class)
->disableOriginalConstructor()
->getMock();
@@ -92,35 +119,41 @@ protected function setUp()
->method('getQuote')
->will($this->returnValue($this->quote));
$methods = ['create'];
- $this->quoteDetailsItemDataObject = $objectManager->getObject(
- \Magento\Tax\Model\Sales\Quote\ItemDetails::class
- );
- $this->taxClassKeyDataObject = $objectManager->getObject(\Magento\Tax\Model\TaxClass\Key::class);
+ $this->quoteDetailsItemDataObject = $objectManager->getObject(ItemDetails::class);
+ $this->taxClassKeyDataObject = $objectManager->getObject(TaxClassKey::class);
$this->quoteDetailsItemDataObjectFactoryMock
- = $this->createPartialMock(\Magento\Tax\Api\Data\QuoteDetailsItemInterfaceFactory::class, $methods);
+ = $this->createPartialMock(QuoteDetailsItemInterfaceFactory::class, $methods);
$this->quoteDetailsItemDataObjectFactoryMock->expects($this->any())
->method('create')
->willReturn($this->quoteDetailsItemDataObject);
$this->taxClassKeyDataObjectFactoryMock =
- $this->createPartialMock(\Magento\Tax\Api\Data\TaxClassKeyInterfaceFactory::class, $methods);
+ $this->createPartialMock(TaxClassKeyInterfaceFactory::class, $methods);
$this->taxClassKeyDataObjectFactoryMock->expects($this->any())
->method('create')
->willReturn($this->taxClassKeyDataObject);
+ $this->taxHelper = $this->getMockBuilder(TaxHelper::class)
+ ->disableOriginalConstructor()
+ ->getMock();
$this->commonTaxCollector = $objectManager->getObject(
- \Magento\Tax\Model\Sales\Total\Quote\CommonTaxCollector::class,
+ CommonTaxCollector::class,
[
'taxConfig' => $this->taxConfig,
'quoteDetailsItemDataObjectFactory' => $this->quoteDetailsItemDataObjectFactoryMock,
- 'taxClassKeyDataObjectFactory' => $this->taxClassKeyDataObjectFactoryMock
+ 'taxClassKeyDataObjectFactory' => $this->taxClassKeyDataObjectFactoryMock,
+ 'taxHelper' => $this->taxHelper,
]
);
}
/**
+ * Test for GetShippingDataObject
+ *
* @param array $addressData
* @param bool $useBaseCurrency
* @param string $shippingTaxClass
* @param bool $shippingPriceInclTax
+ *
+ * @return void
* @dataProvider getShippingDataObjectDataProvider
*/
public function testGetShippingDataObject(
@@ -128,8 +161,8 @@ public function testGetShippingDataObject(
$useBaseCurrency,
$shippingTaxClass,
$shippingPriceInclTax
- ) {
- $shippingAssignmentMock = $this->createMock(\Magento\Quote\Api\Data\ShippingAssignmentInterface::class);
+ ): void {
+ $shippingAssignmentMock = $this->createMock(ShippingAssignmentInterface::class);
$methods = [
'getShippingDiscountAmount',
'getShippingTaxCalculationAmount',
@@ -139,8 +172,10 @@ public function testGetShippingDataObject(
'getBaseShippingAmount',
'getBaseShippingDiscountAmount'
];
- $totalsMock = $this->createPartialMock(\Magento\Quote\Model\Quote\Address\Total::class, $methods);
- $shippingMock = $this->createMock(\Magento\Quote\Api\Data\ShippingInterface::class);
+ /** @var MockObject|QuoteAddressTotal $totalsMock */
+ $totalsMock = $this->createPartialMock(QuoteAddressTotal::class, $methods);
+ $shippingMock = $this->createMock(ShippingInterface::class);
+ /** @var MockObject|ShippingAssignmentInterface $shippingAssignmentMock */
$shippingAssignmentMock->expects($this->once())->method('getShipping')->willReturn($shippingMock);
$shippingMock->expects($this->once())->method('getAddress')->willReturn($this->address);
$baseShippingAmount = $addressData['base_shipping_amount'];
@@ -184,9 +219,44 @@ public function testGetShippingDataObject(
}
/**
+ * Update item tax info
+ *
+ * @return void
+ */
+ public function testUpdateItemTaxInfo(): void
+ {
+ /** @var MockObject|QuoteItem $quoteItem */
+ $quoteItem = $this->getMockBuilder(QuoteItem::class)
+ ->disableOriginalConstructor()
+ ->setMethods(['getPrice', 'setPrice', 'getCustomPrice', 'setCustomPrice'])
+ ->getMock();
+ $this->taxHelper->method('applyTaxOnCustomPrice')->willReturn(true);
+ $quoteItem->method('getCustomPrice')->willReturn(true);
+ /** @var MockObject|TaxDetailsItemInterface $itemTaxDetails */
+ $itemTaxDetails = $this->getMockBuilder(TaxDetailsItemInterface::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ /** @var MockObject|TaxDetailsItemInterface $baseItemTaxDetails */
+ $baseItemTaxDetails = $this->getMockBuilder(TaxDetailsItemInterface::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $quoteItem->expects($this->once())->method('setCustomPrice');
+
+ $this->commonTaxCollector->updateItemTaxInfo(
+ $quoteItem,
+ $itemTaxDetails,
+ $baseItemTaxDetails,
+ $this->store
+ );
+ }
+
+ /**
+ * Data for testGetShippingDataObject
+ *
* @return array
*/
- public function getShippingDataObjectDataProvider()
+ public function getShippingDataObjectDataProvider(): array
{
$data = [
'free_shipping' => [
diff --git a/app/code/Magento/Theme/Test/Mftf/Data/AdminMenuData.xml b/app/code/Magento/Theme/Test/Mftf/Data/AdminMenuData.xml
new file mode 100644
index 0000000000000..e826651062562
--- /dev/null
+++ b/app/code/Magento/Theme/Test/Mftf/Data/AdminMenuData.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ Themes
+ Themes
+ magento-theme-system-design-theme
+
+
diff --git a/app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemesNavigateMenuTest.xml b/app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemesNavigateMenuTest.xml
new file mode 100644
index 0000000000000..8e7bfd71b07d3
--- /dev/null
+++ b/app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemesNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Data/AdminMenuData.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Data/AdminMenuData.xml
new file mode 100644
index 0000000000000..66eb3c9ba9f46
--- /dev/null
+++ b/app/code/Magento/UrlRewrite/Test/Mftf/Data/AdminMenuData.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ URL Rewrites
+ URL Rewrites
+ magento-urlrewrite-urlrewrite
+
+
diff --git a/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminMarketingUrlRewritesNavigateMenuTest.xml b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminMarketingUrlRewritesNavigateMenuTest.xml
new file mode 100644
index 0000000000000..443307b427b42
--- /dev/null
+++ b/app/code/Magento/UrlRewrite/Test/Mftf/Test/AdminMarketingUrlRewritesNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/User/Test/Mftf/Data/AdminMenuData.xml b/app/code/Magento/User/Test/Mftf/Data/AdminMenuData.xml
new file mode 100644
index 0000000000000..e8b7d2aa8e047
--- /dev/null
+++ b/app/code/Magento/User/Test/Mftf/Data/AdminMenuData.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+ Users
+ All Users
+ magento-user-system-acl-users
+
+
+ Locked Users
+ Locked Users
+ magento-user-system-acl-locks
+
+
+ Encryption Key
+ Manage Encryption Key
+ magento-encryptionkey-system-crypt-key
+
+
+ Roles
+ User Roles
+ magento-user-system-acl-roles
+
+
diff --git a/app/code/Magento/User/Test/Mftf/Test/AdminSystemAllUsersNavigateMenuTest.xml b/app/code/Magento/User/Test/Mftf/Test/AdminSystemAllUsersNavigateMenuTest.xml
new file mode 100644
index 0000000000000..b899320403d71
--- /dev/null
+++ b/app/code/Magento/User/Test/Mftf/Test/AdminSystemAllUsersNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/User/Test/Mftf/Test/AdminSystemLockedUsersNavigateMenuTest.xml b/app/code/Magento/User/Test/Mftf/Test/AdminSystemLockedUsersNavigateMenuTest.xml
new file mode 100644
index 0000000000000..aea46f3273157
--- /dev/null
+++ b/app/code/Magento/User/Test/Mftf/Test/AdminSystemLockedUsersNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/User/Test/Mftf/Test/AdminSystemManageEncryptionKeyNavigateMenuTest.xml b/app/code/Magento/User/Test/Mftf/Test/AdminSystemManageEncryptionKeyNavigateMenuTest.xml
new file mode 100644
index 0000000000000..f8013a54058c3
--- /dev/null
+++ b/app/code/Magento/User/Test/Mftf/Test/AdminSystemManageEncryptionKeyNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/User/Test/Mftf/Test/AdminSystemUserRolesNavigateMenuTest.xml b/app/code/Magento/User/Test/Mftf/Test/AdminSystemUserRolesNavigateMenuTest.xml
new file mode 100644
index 0000000000000..c4052a7f4219c
--- /dev/null
+++ b/app/code/Magento/User/Test/Mftf/Test/AdminSystemUserRolesNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_grid_block.xml b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_grid_block.xml
index a4bc9aa5ed48b..8289b3e730d5d 100644
--- a/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_grid_block.xml
+++ b/app/code/Magento/User/view/adminhtml/layout/adminhtml_user_grid_block.xml
@@ -16,6 +16,7 @@
username
asc
+
true
diff --git a/app/code/Magento/Variable/Test/Mftf/Data/AdminMenuData.xml b/app/code/Magento/Variable/Test/Mftf/Data/AdminMenuData.xml
new file mode 100644
index 0000000000000..e094239767486
--- /dev/null
+++ b/app/code/Magento/Variable/Test/Mftf/Data/AdminMenuData.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ Custom Variables
+ Custom Variables
+ magento-variable-system-variable
+
+
diff --git a/app/code/Magento/Variable/Test/Mftf/Test/AdminSystemCustomVariablesNavigateMenuTest.xml b/app/code/Magento/Variable/Test/Mftf/Test/AdminSystemCustomVariablesNavigateMenuTest.xml
new file mode 100644
index 0000000000000..74446cf601348
--- /dev/null
+++ b/app/code/Magento/Variable/Test/Mftf/Test/AdminSystemCustomVariablesNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/code/Magento/Widget/Test/Mftf/Data/AdminMenuData.xml b/app/code/Magento/Widget/Test/Mftf/Data/AdminMenuData.xml
new file mode 100644
index 0000000000000..8fa652b8f73eb
--- /dev/null
+++ b/app/code/Magento/Widget/Test/Mftf/Data/AdminMenuData.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ Widgets
+ Widgets
+ magento-widget-cms-widget-instance
+
+
diff --git a/app/code/Magento/Widget/Test/Mftf/Test/AdminContentWidgetsNavigateMenuTest.xml b/app/code/Magento/Widget/Test/Mftf/Test/AdminContentWidgetsNavigateMenuTest.xml
new file mode 100644
index 0000000000000..f5af024ec1d51
--- /dev/null
+++ b/app/code/Magento/Widget/Test/Mftf/Test/AdminContentWidgetsNavigateMenuTest.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/design/adminhtml/Magento/backend/web/css/source/forms/_temp.less b/app/design/adminhtml/Magento/backend/web/css/source/forms/_temp.less
index 5d9bf80ce2255..71f57b765ff0e 100644
--- a/app/design/adminhtml/Magento/backend/web/css/source/forms/_temp.less
+++ b/app/design/adminhtml/Magento/backend/web/css/source/forms/_temp.less
@@ -470,8 +470,6 @@ label.mage-error {
}
.admin__data-grid-header-row {
- &:extend(.abs-cleafix);
-
.action-select-multiselect {
-webkit-appearance: menulist-button;
appearance: menulist-button;
diff --git a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_field-tooltips.less b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_field-tooltips.less
old mode 100644
new mode 100755
index 8184a5c4bb248..befd27fa57df6
--- a/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_field-tooltips.less
+++ b/app/design/adminhtml/Magento/backend/web/css/source/forms/fields/_field-tooltips.less
@@ -22,7 +22,7 @@
@field-tooltip-content__width: 32rem;
@field-tooltip-content__z-index: 1;
-@field-tooltip-action__margin-left: 2rem;
+@field-tooltip-action__margin-left: 0;
//
// Form Fields
diff --git a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_tooltip.less b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_tooltip.less
index 664726ddfd798..ddf33de6820e7 100644
--- a/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_tooltip.less
+++ b/app/design/frontend/Magento/blank/Magento_Checkout/web/css/source/module/checkout/_tooltip.less
@@ -173,10 +173,10 @@
width: 0;
}
.field-tooltip .field-tooltip-content::before {
- border-bottom-color: @color-gray40;
+ .lib-css(border-bottom-color, @checkout-tooltip-content__border-color);
}
.field-tooltip .field-tooltip-content::after {
- border-bottom-color: @color-gray-light01;
+ .lib-css(border-bottom-color, @checkout-tooltip-content__background-color);
top: 1px;
}
}
diff --git a/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less b/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less
index 1f1ea93d0b54a..dfcc51e0a0a26 100644
--- a/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less
+++ b/app/design/frontend/Magento/luma/Magento_Theme/web/css/source/_module.less
@@ -112,6 +112,10 @@
font-size: @font-size__base;
margin: 0 0 0 15px;
+ &.customer-welcome {
+ margin: 0 0 0 5px;
+ }
+
> a {
.lib-link(
@_link-color: @header-panel__text-color,
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/AddProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/AddProductToCartTest.php
index 6616b40257f7d..99f1dc004c50f 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/AddProductToCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory/AddProductToCartTest.php
@@ -7,31 +7,19 @@
namespace Magento\GraphQl\CatalogInventory;
+use Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId;
use Magento\TestFramework\Helper\Bootstrap;
use Magento\TestFramework\TestCase\GraphQlAbstract;
-use Magento\Quote\Model\QuoteFactory;
-use Magento\Quote\Model\QuoteIdToMaskedQuoteIdInterface;
-use Magento\Quote\Model\ResourceModel\Quote as QuoteResource;
/**
- * Test for adding products to cart
+ * Add simple product to cart testcases related to inventory
*/
class AddProductToCartTest extends GraphQlAbstract
{
/**
- * @var QuoteResource
+ * @var GetMaskedQuoteIdByReservedOrderId
*/
- private $quoteResource;
-
- /**
- * @var QuoteFactory
- */
- private $quoteFactory;
-
- /**
- * @var QuoteIdToMaskedQuoteIdInterface
- */
- private $quoteIdToMaskedId;
+ private $getMaskedQuoteIdByReservedOrderId;
/**
* @inheritdoc
@@ -39,9 +27,7 @@ class AddProductToCartTest extends GraphQlAbstract
protected function setUp()
{
$objectManager = Bootstrap::getObjectManager();
- $this->quoteResource = $objectManager->get(QuoteResource::class);
- $this->quoteFactory = $objectManager->get(QuoteFactory::class);
- $this->quoteIdToMaskedId = $objectManager->get(QuoteIdToMaskedQuoteIdInterface::class);
+ $this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
}
/**
@@ -54,11 +40,10 @@ public function testAddProductIfQuantityIsNotAvailable()
{
$sku = 'simple';
$qty = 200;
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1');
- $maskedQuoteId = $this->getMaskedQuoteId();
- $query = $this->getAddSimpleProductQuery($maskedQuoteId, $sku, $qty);
+ $query = $this->getQuery($maskedQuoteId, $sku, $qty);
$this->graphQlMutation($query);
- self::fail('Should be "The requested qty is not available" error message.');
}
/**
@@ -74,22 +59,26 @@ public function testAddMoreProductsThatAllowed()
$sku = 'custom-design-simple-product';
$qty = 7;
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1');
- $maskedQuoteId = $this->getMaskedQuoteId();
- $query = $this->getAddSimpleProductQuery($maskedQuoteId, $sku, $qty);
+ $query = $this->getQuery($maskedQuoteId, $sku, $qty);
$this->graphQlMutation($query);
- self::fail('Should be "The most you may purchase is 5." error message.');
}
/**
- * @return string
+ * @magentoApiDataFixture Magento/Catalog/_files/products.php
+ * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php
+ * @expectedException \Exception
+ * @expectedExceptionMessage Please enter a number greater than 0 in this field.
*/
- public function getMaskedQuoteId() : string
+ public function testAddSimpleProductToCartWithNegativeQty()
{
- $quote = $this->quoteFactory->create();
- $this->quoteResource->load($quote, 'test_order_1', 'reserved_order_id');
+ $sku = 'simple';
+ $qty = -2;
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1');
- return $this->quoteIdToMaskedId->execute((int)$quote->getId());
+ $query = $this->getQuery($maskedQuoteId, $sku, $qty);
+ $this->graphQlMutation($query);
}
/**
@@ -98,7 +87,7 @@ public function getMaskedQuoteId() : string
* @param int $qty
* @return string
*/
- public function getAddSimpleProductQuery(string $maskedQuoteId, string $sku, int $qty) : string
+ private function getQuery(string $maskedQuoteId, string $sku, int $qty) : string
{
return <<quoteResource = $objectManager->get(QuoteResource::class);
- $this->quote = $objectManager->create(Quote::class);
- $this->quoteIdToMaskedId = $objectManager->get(QuoteIdToMaskedQuoteIdInterface::class);
+ $this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
}
/**
@@ -52,12 +38,11 @@ public function testAddConfigurableProductToCart()
{
$variantSku = 'simple_41';
$qty = 2;
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1');
- $maskedQuoteId = $this->getMaskedQuoteId();
-
- $query = $this->getAddConfigurableProductMutationQuery($maskedQuoteId, $variantSku, $qty);
-
+ $query = $this->getQuery($maskedQuoteId, $variantSku, $qty);
$response = $this->graphQlMutation($query);
+
$cartItems = $response['addConfigurableProductsToCart']['cart']['items'];
self::assertEquals($qty, $cartItems[0]['qty']);
self::assertEquals($variantSku, $cartItems[0]['product']['sku']);
@@ -73,10 +58,9 @@ public function testAddProductIfQuantityIsNotAvailable()
{
$variantSku = 'simple_41';
$qty = 200;
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1');
- $maskedQuoteId = $this->getMaskedQuoteId();
- $query = $this->getAddConfigurableProductMutationQuery($maskedQuoteId, $variantSku, $qty);
-
+ $query = $this->getQuery($maskedQuoteId, $variantSku, $qty);
$this->graphQlMutation($query);
}
@@ -90,35 +74,19 @@ public function testAddOutOfStockProduct()
{
$variantSku = 'simple_1010';
$qty = 1;
- $maskedQuoteId = $this->getMaskedQuoteId();
- $query = $this->getAddConfigurableProductMutationQuery($maskedQuoteId, $variantSku, $qty);
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1');
+ $query = $this->getQuery($maskedQuoteId, $variantSku, $qty);
$this->graphQlMutation($query);
}
- /**
- * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php
- * @return string
- * @throws \Magento\Framework\Exception\NoSuchEntityException
- */
- private function getMaskedQuoteId()
- {
- $this->quoteResource->load(
- $this->quote,
- 'test_order_1',
- 'reserved_order_id'
- );
- return $this->quoteIdToMaskedId->execute((int)$this->quote->getId());
- }
-
/**
* @param string $maskedQuoteId
- * @param string $sku
+ * @param string $variantSku
* @param int $qty
- *
* @return string
*/
- private function getAddConfigurableProductMutationQuery(string $maskedQuoteId, string $variantSku, int $qty): string
+ private function getQuery(string $maskedQuoteId, string $variantSku, int $qty): string
{
return <<quoteResource = $objectManager->get(QuoteResource::class);
- $this->quoteFactory = $objectManager->get(QuoteFactory::class);
- $this->quoteIdToMaskedId = $objectManager->get(QuoteIdToMaskedQuoteIdInterface::class);
- }
-
- /**
- * @magentoApiDataFixture Magento/Catalog/_files/products.php
- * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php
- */
- public function testAddSimpleProductToCart()
- {
- $sku = 'simple';
- $qty = 2;
- $maskedQuoteId = $this->getMaskedQuoteId();
-
- $query = $this->getAddSimpleProductQuery($maskedQuoteId, $sku, $qty);
- $response = $this->graphQlMutation($query);
- self::assertArrayHasKey('cart', $response['addSimpleProductsToCart']);
-
- self::assertEquals($qty, $response['addSimpleProductsToCart']['cart']['items'][0]['qty']);
- self::assertEquals($sku, $response['addSimpleProductsToCart']['cart']['items'][0]['product']['sku']);
- }
-
- /**
- * @magentoApiDataFixture Magento/Catalog/_files/products.php
- * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php
- * @expectedException \Exception
- * @expectedExceptionMessage Please enter a number greater than 0 in this field.
- */
- public function testAddSimpleProductToCartWithNegativeQty()
- {
- $sku = 'simple';
- $qty = -2;
- $maskedQuoteId = $this->getMaskedQuoteId();
-
- $query = $this->getAddSimpleProductQuery($maskedQuoteId, $sku, $qty);
- $this->graphQlMutation($query);
- }
-
- /**
- * @return string
- */
- public function getMaskedQuoteId() : string
- {
- $quote = $this->quoteFactory->create();
- $this->quoteResource->load($quote, 'test_order_1', 'reserved_order_id');
-
- return $this->quoteIdToMaskedId->execute((int)$quote->getId());
- }
-
- /**
- * @param string $maskedQuoteId
- * @param string $sku
- * @param int $qty
- * @return string
- */
- public function getAddSimpleProductQuery(string $maskedQuoteId, string $sku, int $qty): string
- {
- return <<graphQlMutation($query);
- }
-}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddSimpleProductWithCustomOptionsToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddSimpleProductWithCustomOptionsToCartTest.php
new file mode 100644
index 0000000000000..f33ccce82fcb7
--- /dev/null
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddSimpleProductWithCustomOptionsToCartTest.php
@@ -0,0 +1,184 @@
+getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
+ $this->productCustomOptionsRepository = $objectManager->get(ProductCustomOptionRepositoryInterface::class);
+ }
+
+ /**
+ * Test adding a simple product to the shopping cart with all supported
+ * customizable options assigned
+ *
+ * @magentoApiDataFixture Magento/Catalog/_files/product_simple_with_options.php
+ * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php
+ */
+ public function testAddSimpleProductWithOptions()
+ {
+ $sku = 'simple';
+ $qty = 1;
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1');
+
+ $customOptionsValues = $this->getCustomOptionsValuesForQuery($sku);
+
+ /* Generate customizable options fragment for GraphQl request */
+ $queryCustomizableOptions = preg_replace('/"([^"]+)"\s*:\s*/', '$1:', json_encode($customOptionsValues));
+
+ $query = <<graphQlMutation($query);
+
+ self::assertArrayHasKey('items', $response['addSimpleProductsToCart']['cart']);
+ self::assertCount(1, $response['addSimpleProductsToCart']['cart']);
+
+ $customizableOptionsOutput = $response['addSimpleProductsToCart']['cart']['items'][0]['customizable_options'];
+ $assignedOptionsCount = count($customOptionsValues);
+ for ($counter = 0; $counter < $assignedOptionsCount; $counter++) {
+ self::assertEquals(
+ $customOptionsValues[$counter]['value'],
+ $customizableOptionsOutput[$counter]['values'][0]['value']
+ );
+ }
+ }
+
+ /**
+ * Test adding a simple product with empty values for required options
+ *
+ * @magentoApiDataFixture Magento/Catalog/_files/product_simple_with_options.php
+ * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php
+ */
+ public function testAddSimpleProductWithNoRequiredOptionsSet()
+ {
+ $sku = 'simple';
+ $qty = 1;
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1');
+
+ $query = <<graphQlMutation($query);
+ }
+
+ /**
+ * Generate an array with test values for customizable options
+ * based on the option type
+ *
+ * @param string $sku
+ * @return array
+ */
+ private function getCustomOptionsValuesForQuery(string $sku): array
+ {
+ $customOptions = $this->productCustomOptionsRepository->getList($sku);
+ $customOptionsValues = [];
+
+ foreach ($customOptions as $customOption) {
+ $optionType = $customOption->getType();
+ if ($optionType == 'field' || $optionType == 'area') {
+ $customOptionsValues[] = [
+ 'id' => (int) $customOption->getOptionId(),
+ 'value' => 'test'
+ ];
+ } elseif ($optionType == 'drop_down') {
+ $optionSelectValues = $customOption->getValues();
+ $customOptionsValues[] = [
+ 'id' => (int) $customOption->getOptionId(),
+ 'value' => reset($optionSelectValues)->getOptionTypeId()
+ ];
+ }
+ }
+
+ return $customOptionsValues;
+ }
+}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddVirtualProductWithCustomOptionsToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddVirtualProductWithCustomOptionsToCartTest.php
new file mode 100644
index 0000000000000..ffd52bcf7fb15
--- /dev/null
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/AddVirtualProductWithCustomOptionsToCartTest.php
@@ -0,0 +1,184 @@
+getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
+ $this->productCustomOptionsRepository = $objectManager->get(ProductCustomOptionRepositoryInterface::class);
+ }
+
+ /**
+ * Test adding a virtual product to the shopping cart with all supported
+ * customizable options assigned
+ *
+ * @magentoApiDataFixture Magento/Catalog/_files/product_virtual_with_options.php
+ * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php
+ */
+ public function testAddVirtualProductWithOptions()
+ {
+ $sku = 'virtual';
+ $qty = 1;
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1');
+
+ $customOptionsValues = $this->getCustomOptionsValuesForQuery($sku);
+
+ /* Generate customizable options fragment for GraphQl request */
+ $queryCustomizableOptions = preg_replace('/"([^"]+)"\s*:\s*/', '$1:', json_encode($customOptionsValues));
+
+ $query = <<graphQlMutation($query);
+
+ self::assertArrayHasKey('items', $response['addVirtualProductsToCart']['cart']);
+ self::assertCount(1, $response['addVirtualProductsToCart']['cart']);
+
+ $customizableOptionsOutput = $response['addVirtualProductsToCart']['cart']['items'][0]['customizable_options'];
+ $assignedOptionsCount = count($customOptionsValues);
+ for ($counter = 0; $counter < $assignedOptionsCount; $counter++) {
+ self::assertEquals(
+ $customOptionsValues[$counter]['value'],
+ $customizableOptionsOutput[$counter]['values'][0]['value']
+ );
+ }
+ }
+
+ /**
+ * Test adding a virtual product with empty values for required options
+ *
+ * @magentoApiDataFixture Magento/Catalog/_files/product_virtual_with_options.php
+ * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php
+ */
+ public function testAddVirtualProductWithNoRequiredOptionsSet()
+ {
+ $sku = 'virtual';
+ $qty = 1;
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1');
+
+ $query = <<graphQlMutation($query);
+ }
+
+ /**
+ * Generate an array with test values for customizable options
+ * based on the option type
+ *
+ * @param string $sku
+ * @return array
+ */
+ private function getCustomOptionsValuesForQuery(string $sku): array
+ {
+ $customOptions = $this->productCustomOptionsRepository->getList($sku);
+ $customOptionsValues = [];
+
+ foreach ($customOptions as $customOption) {
+ $optionType = $customOption->getType();
+ if ($optionType == 'field' || $optionType == 'area') {
+ $customOptionsValues[] = [
+ 'id' => (int) $customOption->getOptionId(),
+ 'value' => 'test'
+ ];
+ } elseif ($optionType == 'drop_down') {
+ $optionSelectValues = $customOption->getValues();
+ $customOptionsValues[] = [
+ 'id' => (int) $customOption->getOptionId(),
+ 'value' => reset($optionSelectValues)->getOptionTypeId()
+ ];
+ }
+ }
+
+ return $customOptionsValues;
+ }
+}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/CartTotalsTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/CartTotalsTest.php
new file mode 100644
index 0000000000000..bb8acfce629ff
--- /dev/null
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/CartTotalsTest.php
@@ -0,0 +1,208 @@
+getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
+ $this->customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
+ * @magentoApiDataFixture Magento/GraphQl/Tax/_files/tax_rule_for_region_1.php
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/apply_tax_for_simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php
+ */
+ public function testGetCartTotalsWithTaxApplied()
+ {
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
+ $query = $this->getQuery($maskedQuoteId);
+ $response = $this->graphQlQuery($query, [], '', $this->getHeaderMap());
+
+ self::assertArrayHasKey('prices', $response['cart']);
+ $pricesResponse = $response['cart']['prices'];
+ self::assertEquals(21.5, $pricesResponse['grand_total']['value']);
+ self::assertEquals(21.5, $pricesResponse['subtotal_including_tax']['value']);
+ self::assertEquals(20, $pricesResponse['subtotal_excluding_tax']['value']);
+ self::assertEquals(20, $pricesResponse['subtotal_with_discount_excluding_tax']['value']);
+
+ $appliedTaxesResponse = $pricesResponse['applied_taxes'];
+
+ self::assertEquals('US-TEST-*-Rate-1', $appliedTaxesResponse[0]['label']);
+ self::assertEquals(1.5, $appliedTaxesResponse[0]['amount']['value']);
+ self::assertEquals('USD', $appliedTaxesResponse[0]['amount']['currency']);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php
+ */
+ public function testGetTotalsWithNoTaxApplied()
+ {
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
+ $query = $this->getQuery($maskedQuoteId);
+ $response = $this->graphQlQuery($query, [], '', $this->getHeaderMap());
+
+ $pricesResponse = $response['cart']['prices'];
+ self::assertEquals(20, $pricesResponse['grand_total']['value']);
+ self::assertEquals(20, $pricesResponse['subtotal_including_tax']['value']);
+ self::assertEquals(20, $pricesResponse['subtotal_excluding_tax']['value']);
+ self::assertEquals(20, $pricesResponse['subtotal_with_discount_excluding_tax']['value']);
+ self::assertEmpty($pricesResponse['applied_taxes']);
+ }
+
+ /**
+ * The totals calculation is based on quote address.
+ * But the totals should be calculated even if no address is set
+ *
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
+ */
+ public function testGetCartTotalsWithNoAddressSet()
+ {
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
+ $query = $this->getQuery($maskedQuoteId);
+ $response = $this->graphQlQuery($query, [], '', $this->getHeaderMap());
+
+ $pricesResponse = $response['cart']['prices'];
+ self::assertEquals(20, $pricesResponse['grand_total']['value']);
+ self::assertEquals(20, $pricesResponse['subtotal_including_tax']['value']);
+ self::assertEquals(20, $pricesResponse['subtotal_excluding_tax']['value']);
+ self::assertEquals(20, $pricesResponse['subtotal_with_discount_excluding_tax']['value']);
+ self::assertEmpty($pricesResponse['applied_taxes']);
+ }
+
+ /**
+ * _security
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
+ * @magentoApiDataFixture Magento/GraphQl/Tax/_files/tax_rule_for_region_1.php
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/apply_tax_for_simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php
+ */
+ public function testGetTotalsFromGuestCart()
+ {
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
+ $query = $this->getQuery($maskedQuoteId);
+
+ $this->expectExceptionMessage(
+ "The current user cannot perform operations on cart \"$maskedQuoteId\""
+ );
+ $this->graphQlQuery($query, [], '', $this->getHeaderMap());
+ }
+
+ /**
+ * _security
+ * @magentoApiDataFixture Magento/Customer/_files/three_customers.php
+ * @magentoApiDataFixture Magento/GraphQl/Tax/_files/tax_rule_for_region_1.php
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/apply_tax_for_simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php
+ */
+ public function testGetTotalsFromAnotherCustomerCart()
+ {
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
+ $query = $this->getQuery($maskedQuoteId);
+
+ $this->expectExceptionMessage(
+ "The current user cannot perform operations on cart \"$maskedQuoteId\""
+ );
+ $this->graphQlQuery($query, [], '', $this->getHeaderMap('customer3@search.example.com'));
+ }
+
+ /**
+ * Generates GraphQl query for retrieving cart totals
+ *
+ * @param string $maskedQuoteId
+ * @return string
+ */
+ private function getQuery(string $maskedQuoteId): string
+ {
+ return <<customerTokenService->createCustomerAccessToken($username, $password);
+ $headerMap = ['Authorization' => 'Bearer ' . $customerToken];
+ return $headerMap;
+ }
+}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetCartEmailTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetCartEmailTest.php
new file mode 100644
index 0000000000000..951fe08db5e3d
--- /dev/null
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetCartEmailTest.php
@@ -0,0 +1,125 @@
+getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
+ $this->customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
+ */
+ public function testGetCartEmail()
+ {
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
+
+ $query = $this->getQuery($maskedQuoteId);
+ $response = $this->graphQlQuery($query, [], '', $this->getHeaderMap());
+
+ $this->assertArrayHasKey('cart', $response);
+ $this->assertArrayHasKey('email', $response['cart']);
+ $this->assertEquals('customer@example.com', $response['cart']['email']);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
+ * @expectedException \Exception
+ * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
+ */
+ public function testGetCartEmailFromNonExistentCart()
+ {
+ $maskedQuoteId = 'non_existent_masked_id';
+ $query = $this->getQuery($maskedQuoteId);
+
+ $this->graphQlQuery($query, [], '', $this->getHeaderMap());
+ }
+
+ /**
+ * _security
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/set_guest_email.php
+ */
+ public function testGetEmailFromGuestCart()
+ {
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
+ $query = $this->getQuery($maskedQuoteId);
+
+ $this->expectExceptionMessage(
+ "The current user cannot perform operations on cart \"{$maskedQuoteId}\""
+ );
+ $this->graphQlQuery($query, [], '', $this->getHeaderMap());
+ }
+
+ /**
+ * _security
+ * @magentoApiDataFixture Magento/Customer/_files/three_customers.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
+ */
+ public function testGetEmailFromAnotherCustomerCart()
+ {
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
+ $query = $this->getQuery($maskedQuoteId);
+
+ $this->expectExceptionMessage(
+ "The current user cannot perform operations on cart \"{$maskedQuoteId}\""
+ );
+ $this->graphQlMutation($query, [], '', $this->getHeaderMap('customer3@search.example.com'));
+ }
+
+ /**
+ * @param string $maskedQuoteId
+ * @return string
+ */
+ private function getQuery(string $maskedQuoteId): string
+ {
+ return <<customerTokenService->createCustomerAccessToken($username, $password);
+ $headerMap = ['Authorization' => 'Bearer ' . $customerToken];
+ return $headerMap;
+ }
+}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php
index 553408880baa0..6b15f947a2477 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetBillingAddressOnCartTest.php
@@ -493,6 +493,24 @@ public function testSetBillingAddressWithoutRequiredParameters(string $input, st
$this->graphQlMutation($query);
}
+ /**
+ * @return array
+ */
+ public function dataProviderSetWithoutRequiredParameters(): array
+ {
+ return [
+ 'missed_billing_address' => [
+ 'cart_id: "cart_id_value"',
+ 'Field SetBillingAddressOnCartInput.billing_address of required type BillingAddressInput!'
+ . ' was not provided.',
+ ],
+ 'missed_cart_id' => [
+ 'billing_address: {}',
+ 'Required parameter "cart_id" is missing'
+ ]
+ ];
+ }
+
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
@@ -536,24 +554,6 @@ public function testSetNewBillingAddressWithRedundantStreetLine()
$this->graphQlMutation($query, [], '', $this->getHeaderMap());
}
- /**
- * @return array
- */
- public function dataProviderSetWithoutRequiredParameters(): array
- {
- return [
- 'missed_billing_address' => [
- 'cart_id: "cart_id_value"',
- 'Field SetBillingAddressOnCartInput.billing_address of required type BillingAddressInput!'
- . ' was not provided.',
- ],
- 'missed_cart_id' => [
- 'billing_address: {}',
- 'Required parameter "cart_id" is missing'
- ]
- ];
- }
-
/**
* Verify the all the whitelisted fields for a New Address Object
*
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetGuestEmailOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetGuestEmailOnCartTest.php
new file mode 100644
index 0000000000000..a4a84c2f8c740
--- /dev/null
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetGuestEmailOnCartTest.php
@@ -0,0 +1,104 @@
+getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
+ $this->customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
+ *
+ * @expectedException \Exception
+ * @expectedExceptionMessage The request is not allowed for logged in customers
+ */
+ public function testSetGuestEmailOnCartForLoggedInCustomer()
+ {
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
+ $email = 'some@user.com';
+
+ $query = $this->getQuery($maskedQuoteId, $email);
+ $this->graphQlMutation($query, [], '', $this->getHeaderMap());
+ }
+
+ /**
+ * _security
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
+ *
+ * @expectedException \Exception
+ * @expectedExceptionMessage The request is not allowed for logged in customers
+ */
+ public function testSetGuestEmailOnGuestCart()
+ {
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
+ $email = 'some@user.com';
+
+ $query = $this->getQuery($maskedQuoteId, $email);
+ $this->graphQlMutation($query, [], '', $this->getHeaderMap());
+ }
+
+ /**
+ * Returns GraphQl mutation query for setting email address for a guest
+ *
+ * @param string $maskedQuoteId
+ * @param string $email
+ * @return string
+ */
+ private function getQuery(string $maskedQuoteId, string $email): string
+ {
+ return <<customerTokenService->createCustomerAccessToken($username, $password);
+ $headerMap = ['Authorization' => 'Bearer ' . $customerToken];
+ return $headerMap;
+ }
+}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodOnCartTest.php
index 0f6f371177f92..2604ec5f0a0f9 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodOnCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetPaymentMethodOnCartTest.php
@@ -7,10 +7,12 @@
namespace Magento\GraphQl\Quote\Customer;
+use Exception;
use Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId;
use Magento\Integration\Api\CustomerTokenServiceInterface;
use Magento\OfflinePayments\Model\Cashondelivery;
use Magento\OfflinePayments\Model\Checkmo;
+use Magento\OfflinePayments\Model\Purchaseorder;
use Magento\TestFramework\Helper\Bootstrap;
use Magento\TestFramework\TestCase\GraphQlAbstract;
@@ -66,7 +68,7 @@ public function testSetPaymentOnCartWithSimpleProduct()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
*
- * @expectedException \Exception
+ * @expectedException Exception
* @expectedExceptionMessage The shipping address is missing. Set the address and try again.
*/
public function testSetPaymentOnCartWithSimpleProductAndWithoutAddress()
@@ -105,7 +107,7 @@ public function testSetPaymentOnCartWithVirtualProduct()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
*
- * @expectedException \Exception
+ * @expectedException Exception
* @expectedExceptionMessage The requested Payment Method is not available.
*/
public function testSetNonExistentPaymentMethod()
@@ -120,7 +122,7 @@ public function testSetNonExistentPaymentMethod()
/**
* @magentoApiDataFixture Magento/Customer/_files/customer.php
*
- * @expectedException \Exception
+ * @expectedException Exception
* @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
*/
public function testSetPaymentOnNonExistentCart()
@@ -180,7 +182,7 @@ public function testSetPaymentMethodToAnotherCustomerCart()
*
* @param string $input
* @param string $message
- * @throws \Exception
+ * @throws Exception
* @dataProvider dataProviderSetPaymentMethodWithoutRequiredParameters
*/
public function testSetPaymentMethodWithoutRequiredParameters(string $input, string $message)
@@ -204,6 +206,24 @@ public function testSetPaymentMethodWithoutRequiredParameters(string $input, str
$this->graphQlMutation($query, [], '', $this->getHeaderMap());
}
+ /**
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
+ * @expectedException Exception
+ * @expectedExceptionMessage The requested Payment Method is not available.
+ */
+ public function testSetDisabledPaymentOnCart()
+ {
+ $methodCode = Purchaseorder::PAYMENT_METHOD_PURCHASEORDER_CODE;
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
+
+ $query = $this->getQuery($maskedQuoteId, $methodCode);
+ $this->graphQlMutation($query, [], '', $this->getHeaderMap());
+ }
+
/**
* @return array
*/
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingMethodsOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingMethodsOnCartTest.php
index ecad31a8bd123..0fc52443e86b9 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingMethodsOnCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetShippingMethodsOnCartTest.php
@@ -7,6 +7,7 @@
namespace Magento\GraphQl\Quote\Customer;
+use Exception;
use Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId;
use Magento\GraphQl\Quote\GetQuoteShippingAddressIdByReservedQuoteId;
use Magento\Integration\Api\CustomerTokenServiceInterface;
@@ -132,7 +133,7 @@ public function testReSetShippingMethod()
* @param string $input
* @param string $message
* @dataProvider dataProviderSetShippingMethodWithWrongParameters
- * @throws \Exception
+ * @throws Exception
*/
public function testSetShippingMethodWithWrongParameters(string $input, string $message)
{
@@ -251,6 +252,14 @@ public function dataProviderSetShippingMethodWithWrongParameters(): array
}]',
'Could not find a cart with ID "non_existent_masked_id"'
],
+ 'disabled_shipping_method' => [
+ 'cart_id: "cart_id_value", shipping_methods: [{
+ cart_address_id: cart_address_id_value
+ carrier_code: "freeshipping"
+ method_code: "freeshipping"
+ }]',
+ 'Carrier with such method not found: freeshipping, freeshipping'
+ ]
];
}
@@ -261,7 +270,7 @@ public function dataProviderSetShippingMethodWithWrongParameters(): array
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
- * @expectedException \Exception
+ * @expectedException Exception
* @expectedExceptionMessage You cannot specify multiple shipping methods.
*/
public function testSetMultipleShippingMethods()
@@ -307,7 +316,7 @@ public function testSetMultipleShippingMethods()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
*
- * @expectedException \Exception
+ * @expectedException Exception
*/
public function testSetShippingMethodToGuestCart()
{
@@ -336,7 +345,7 @@ public function testSetShippingMethodToGuestCart()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
*
- * @expectedException \Exception
+ * @expectedException Exception
*/
public function testSetShippingMethodToAnotherCustomerCart()
{
@@ -422,6 +431,30 @@ private function getQuery(
QUERY;
}
+ /**
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
+ *
+ * @expectedException Exception
+ * @expectedExceptionMessage The shipping method can't be set for an empty cart. Add an item to cart and try again.
+ */
+ public function testSetShippingMethodOnAnEmptyCart()
+ {
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
+ $carrierCode = 'flatrate';
+ $methodCode = 'flatrate';
+ $quoteAddressId = $this->getQuoteShippingAddressIdByReservedQuoteId->execute('test_quote');
+
+ $query = $this->getQuery(
+ $maskedQuoteId,
+ $methodCode,
+ $carrierCode,
+ $quoteAddressId
+ );
+ $this->graphQlMutation($query, [], '', $this->getHeaderMap());
+ }
+
/**
* @param string $username
* @param string $password
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddSimpleProductToCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddSimpleProductToCartTest.php
new file mode 100644
index 0000000000000..25221b628e7fb
--- /dev/null
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/AddSimpleProductToCartTest.php
@@ -0,0 +1,102 @@
+getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/Catalog/_files/products.php
+ * @magentoApiDataFixture Magento/Checkout/_files/active_quote.php
+ */
+ public function testAddSimpleProductToCart()
+ {
+ $sku = 'simple';
+ $qty = 2;
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_order_1');
+
+ $query = $this->getQuery($maskedQuoteId, $sku, $qty);
+ $response = $this->graphQlMutation($query);
+ self::assertArrayHasKey('cart', $response['addSimpleProductsToCart']);
+
+ self::assertEquals($qty, $response['addSimpleProductsToCart']['cart']['items'][0]['qty']);
+ self::assertEquals($sku, $response['addSimpleProductsToCart']['cart']['items'][0]['product']['sku']);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/Catalog/_files/products.php
+ *
+ * @expectedException \Exception
+ * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
+ */
+ public function testAddProductToNonExistentCart()
+ {
+ $sku = 'simple';
+ $qty = 1;
+ $maskedQuoteId = 'non_existent_masked_id';
+
+ $query = $this->getQuery($maskedQuoteId, $sku, $qty);
+ $this->graphQlMutation($query);
+ }
+
+ /**
+ * @param string $maskedQuoteId
+ * @param string $sku
+ * @param int $qty
+ * @return string
+ */
+ private function getQuery(string $maskedQuoteId, string $sku, int $qty): string
+ {
+ return <<getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/GraphQl/Tax/_files/tax_rule_for_region_1.php
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/apply_tax_for_simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php
+ */
+ public function testGetCartTotalsWithTaxApplied()
+ {
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
+ $query = $this->getQuery($maskedQuoteId);
+ $response = $this->graphQlQuery($query);
+
+ self::assertArrayHasKey('prices', $response['cart']);
+ $pricesResponse = $response['cart']['prices'];
+ self::assertEquals(21.5, $pricesResponse['grand_total']['value']);
+ self::assertEquals(21.5, $pricesResponse['subtotal_including_tax']['value']);
+ self::assertEquals(20, $pricesResponse['subtotal_excluding_tax']['value']);
+ self::assertEquals(20, $pricesResponse['subtotal_with_discount_excluding_tax']['value']);
+
+ $appliedTaxesResponse = $pricesResponse['applied_taxes'];
+
+ self::assertEquals('US-TEST-*-Rate-1', $appliedTaxesResponse[0]['label']);
+ self::assertEquals(1.5, $appliedTaxesResponse[0]['amount']['value']);
+ self::assertEquals('USD', $appliedTaxesResponse[0]['amount']['currency']);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php
+ */
+ public function testGetTotalsWithNoTaxApplied()
+ {
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
+ $query = $this->getQuery($maskedQuoteId);
+ $response = $this->graphQlQuery($query);
+
+ $pricesResponse = $response['cart']['prices'];
+ self::assertEquals(20, $pricesResponse['grand_total']['value']);
+ self::assertEquals(20, $pricesResponse['subtotal_including_tax']['value']);
+ self::assertEquals(20, $pricesResponse['subtotal_excluding_tax']['value']);
+ self::assertEquals(20, $pricesResponse['subtotal_with_discount_excluding_tax']['value']);
+ self::assertEmpty($pricesResponse['applied_taxes']);
+ }
+
+ /**
+ * The totals calculation is based on quote address.
+ * But the totals should be calculated even if no address is set
+ *
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
+ * @group recent
+ */
+ public function testGetCartTotalsWithNoAddressSet()
+ {
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
+ $query = $this->getQuery($maskedQuoteId);
+ $response = $this->graphQlQuery($query);
+
+ $pricesResponse = $response['cart']['prices'];
+ self::assertEquals(20, $pricesResponse['grand_total']['value']);
+ self::assertEquals(20, $pricesResponse['subtotal_including_tax']['value']);
+ self::assertEquals(20, $pricesResponse['subtotal_excluding_tax']['value']);
+ self::assertEquals(20, $pricesResponse['subtotal_with_discount_excluding_tax']['value']);
+ self::assertEmpty($pricesResponse['applied_taxes']);
+ }
+
+ /**
+ * _security
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
+ * @magentoApiDataFixture Magento/GraphQl/Tax/_files/tax_rule_for_region_1.php
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/apply_tax_for_simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php
+ */
+ public function testGetSelectedShippingMethodFromCustomerCart()
+ {
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
+ $query = $this->getQuery($maskedQuoteId);
+
+ $this->expectExceptionMessage(
+ "The current user cannot perform operations on cart \"$maskedQuoteId\""
+ );
+ $this->graphQlQuery($query);
+ }
+
+ /**
+ * Generates GraphQl query for retrieving cart totals
+ *
+ * @param string $maskedQuoteId
+ * @return string
+ */
+ private function getQuery(string $maskedQuoteId): string
+ {
+ return <<getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/set_guest_email.php
+ */
+ public function testGetCartEmail()
+ {
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
+
+ $query = $this->getQuery($maskedQuoteId);
+ $response = $this->graphQlQuery($query);
+
+ $this->assertArrayHasKey('cart', $response);
+ $this->assertArrayHasKey('email', $response['cart']);
+ $this->assertEquals('guest@example.com', $response['cart']['email']);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
+ */
+ public function testGetCartEmailFromNonExistentCart()
+ {
+ $maskedQuoteId = 'non_existent_masked_id';
+ $query = $this->getQuery($maskedQuoteId);
+
+ $this->graphQlQuery($query);
+ }
+
+ /**
+ * _security
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
+ */
+ public function testGetCartEmailFromCustomerCart()
+ {
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
+ $query = $this->getQuery($maskedQuoteId);
+
+ $this->expectExceptionMessage(
+ "The current user cannot perform operations on cart \"{$maskedQuoteId}\""
+ );
+ $this->graphQlQuery($query);
+ }
+
+ /**
+ * @param string $maskedQuoteId
+ * @return string
+ */
+ private function getQuery(string $maskedQuoteId): string
+ {
+ return <<getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
+ $this->orderCollectionFactory = $objectManager->get(CollectionFactory::class);
+ $this->orderRepository = $objectManager->get(OrderRepositoryInterface::class);
+ $this->registry = Bootstrap::getObjectManager()->get(Registry::class);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/set_guest_email.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_flatrate_shipping_method.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_checkmo_payment_method.php
+ */
+ public function testPlaceOrder()
+ {
+ $reservedOrderId = 'test_quote';
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId);
+
+ $query = $this->getQuery($maskedQuoteId);
+ $response = $this->graphQlMutation($query);
+
+ self::assertArrayHasKey('placeOrder', $response);
+ self::assertArrayHasKey('order_id', $response['placeOrder']['order']);
+ self::assertEquals($reservedOrderId, $response['placeOrder']['order']['order_id']);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_flatrate_shipping_method.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_checkmo_payment_method.php
+ */
+ public function testPlaceOrderWithNoEmail()
+ {
+ $reservedOrderId = 'test_quote';
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId);
+ $query = $this->getQuery($maskedQuoteId);
+
+ self::expectExceptionMessage("Guest email for cart is missing. Please enter");
+ $this->graphQlMutation($query);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/set_guest_email.php
+ */
+ public function testPlaceOrderWithNoItemsInCart()
+ {
+ $reservedOrderId = 'test_quote';
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId);
+ $query = $this->getQuery($maskedQuoteId);
+
+ self::expectExceptionMessage(
+ 'Unable to place order: A server error stopped your order from being placed. ' .
+ 'Please try to place your order again'
+ );
+ $this->graphQlMutation($query);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/set_guest_email.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
+ */
+ public function testPlaceOrderWithNoShippingAddress()
+ {
+ $reservedOrderId = 'test_quote';
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId);
+ $query = $this->getQuery($maskedQuoteId);
+
+ self::expectExceptionMessage(
+ 'Unable to place order: Some addresses can\'t be used due to the configurations for specific countries'
+ );
+ $this->graphQlMutation($query);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/set_guest_email.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
+ */
+ public function testPlaceOrderWithNoShippingMethod()
+ {
+ $reservedOrderId = 'test_quote';
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId);
+ $query = $this->getQuery($maskedQuoteId);
+
+ self::expectExceptionMessage(
+ 'Unable to place order: The shipping method is missing. Select the shipping method and try again'
+ );
+ $this->graphQlMutation($query);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/set_guest_email.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_flatrate_shipping_method.php
+ */
+ public function testPlaceOrderWithNoBillingAddress()
+ {
+ $reservedOrderId = 'test_quote';
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId);
+ $query = $this->getQuery($maskedQuoteId);
+
+ self::expectExceptionMessageRegExp(
+ '/Unable to place order: Please check the billing address information*/'
+ );
+ $this->graphQlMutation($query);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/set_guest_email.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_flatrate_shipping_method.php
+ */
+ public function testPlaceOrderWithNoPaymentMethod()
+ {
+ $reservedOrderId = 'test_quote';
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId);
+ $query = $this->getQuery($maskedQuoteId);
+
+ self::expectExceptionMessage('Unable to place order: Enter a valid payment method and try again');
+ $this->graphQlMutation($query);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/set_guest_email.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_flatrate_shipping_method.php
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/set_simple_product_out_of_stock.php
+ */
+ public function testPlaceOrderWithOutOfStockProduct()
+ {
+ $reservedOrderId = 'test_quote';
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId);
+ $query = $this->getQuery($maskedQuoteId);
+
+ self::expectExceptionMessage('Unable to place order: Some of the products are out of stock');
+ $this->graphQlMutation($query);
+ }
+
+ /**
+ * _security
+ * @magentoApiDataFixture Magento/Customer/_files/three_customers.php
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_payment_methods.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_billing_address.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_flatrate_shipping_method.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_checkmo_payment_method.php
+ */
+ public function testPlaceOrderOfCustomerCart()
+ {
+ $reservedOrderId = 'test_quote';
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($reservedOrderId);
+ $query = $this->getQuery($maskedQuoteId);
+
+ self::expectExceptionMessageRegExp('/The current user cannot perform operations on cart*/');
+ $this->graphQlMutation($query);
+ }
+
+ /**
+ * @param string $maskedQuoteId
+ * @return string
+ */
+ private function getQuery(string $maskedQuoteId): string
+ {
+ return <<registry->unregister('isSecureArea');
+ $this->registry->register('isSecureArea', true);
+
+ $orderCollection = $this->orderCollectionFactory->create();
+ foreach ($orderCollection as $order) {
+ $this->orderRepository->delete($order);
+ }
+ $this->registry->unregister('isSecureArea');
+ $this->registry->register('isSecureArea', false);
+
+ parent::tearDown();
+ }
+}
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php
index 5b0e4cfdb6c52..d2d53220f0042 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetBillingAddressOnCartTest.php
@@ -313,6 +313,24 @@ public function testSetBillingAddressWithoutRequiredParameters(string $input, st
$this->graphQlMutation($query);
}
+ /**
+ * @return array
+ */
+ public function dataProviderSetWithoutRequiredParameters(): array
+ {
+ return [
+ 'missed_billing_address' => [
+ 'cart_id: "cart_id_value"',
+ 'Field SetBillingAddressOnCartInput.billing_address of required type BillingAddressInput!'
+ . ' was not provided.',
+ ],
+ 'missed_cart_id' => [
+ 'billing_address: {}',
+ 'Required parameter "cart_id" is missing'
+ ]
+ ];
+ }
+
/**
* @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
@@ -356,24 +374,6 @@ public function testSetNewBillingAddressRedundantStreetLine()
$this->graphQlMutation($query);
}
- /**
- * @return array
- */
- public function dataProviderSetWithoutRequiredParameters(): array
- {
- return [
- 'missed_billing_address' => [
- 'cart_id: "cart_id_value"',
- 'Field SetBillingAddressOnCartInput.billing_address of required type BillingAddressInput!'
- . ' was not provided.',
- ],
- 'missed_cart_id' => [
- 'billing_address: {}',
- 'Required parameter "cart_id" is missing'
- ]
- ];
- }
-
/**
* Verify the all the whitelisted fields for a New Address Object
*
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetGuestEmailOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetGuestEmailOnCartTest.php
new file mode 100644
index 0000000000000..b877dccdeba37
--- /dev/null
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetGuestEmailOnCartTest.php
@@ -0,0 +1,141 @@
+getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
+ */
+ public function testSetGuestEmailOnCart()
+ {
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
+ $email = 'some@user.com';
+
+ $query = $this->getQuery($maskedQuoteId, $email);
+ $response = $this->graphQlMutation($query);
+
+ $this->assertArrayHasKey('setGuestEmailOnCart', $response);
+ $this->assertArrayHasKey('cart', $response['setGuestEmailOnCart']);
+ $this->assertEquals($email, $response['setGuestEmailOnCart']['cart']['email']);
+ }
+
+ /**
+ * _security
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
+ */
+ public function testSetGuestEmailOnCustomerCart()
+ {
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
+ $email = 'some@user.com';
+
+ $query = $this->getQuery($maskedQuoteId, $email);
+
+ $this->expectExceptionMessage(
+ "The current user cannot perform operations on cart \"$maskedQuoteId\""
+ );
+ $this->graphQlMutation($query);
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
+ *
+ * @dataProvider incorrectEmailDataProvider
+ * @param string $email
+ * @param string $exceptionMessage
+ */
+ public function testSetGuestEmailOnCartWithIncorrectEmail(
+ string $email,
+ string $exceptionMessage
+ ) {
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
+
+ $query = $this->getQuery($maskedQuoteId, $email);
+ $this->expectExceptionMessage($exceptionMessage);
+ $this->graphQlMutation($query);
+ }
+
+ /**
+ * @return array
+ */
+ public function incorrectEmailDataProvider(): array
+ {
+ return [
+ 'wrong_email' => ['some', 'Invalid email format'],
+ 'no_email' => ['', 'Required parameter "email" is missing'],
+ ];
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage Could not find a cart with ID "non_existent_masked_id"
+ */
+ public function testSetGuestEmailOnNonExistentCart()
+ {
+ $maskedQuoteId = 'non_existent_masked_id';
+ $email = 'some@user.com';
+
+ $query = $this->getQuery($maskedQuoteId, $email);
+ $this->graphQlMutation($query);
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage Required parameter "cart_id" is missing
+ */
+ public function testSetGuestEmailWithEmptyCartId()
+ {
+ $maskedQuoteId = '';
+ $email = 'some@user.com';
+
+ $query = $this->getQuery($maskedQuoteId, $email);
+ $this->graphQlMutation($query);
+ }
+
+ /**
+ * Returns GraphQl mutation query for setting email address for a guest
+ *
+ * @param string $maskedQuoteId
+ * @param string $email
+ * @return string
+ */
+ private function getQuery(string $maskedQuoteId, string $email): string
+ {
+ return <<getMaskedQuoteIdByReservedOrderId->execute('test_quote');
+
+ $query = $this->getQuery($maskedQuoteId, $methodCode);
+ $this->graphQlMutation($query);
+ }
+
/**
* @param string $maskedQuoteId
* @param string $methodCode
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingMethodsOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingMethodsOnCartTest.php
index 2f3c109b99523..59f53d2ad6856 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingMethodsOnCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetShippingMethodsOnCartTest.php
@@ -7,6 +7,7 @@
namespace Magento\GraphQl\Quote\Guest;
+use Exception;
use Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId;
use Magento\GraphQl\Quote\GetQuoteShippingAddressIdByReservedQuoteId;
use Magento\TestFramework\Helper\Bootstrap;
@@ -85,7 +86,7 @@ public function testSetShippingMethodOnCartWithSimpleProduct()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_virtual_product.php
*
- * @expectedException \Exception
+ * @expectedException Exception
* @expectedExceptionMessage The shipping address is missing. Set the address and try again.
*/
public function testSetShippingMethodOnCartWithSimpleProductAndWithoutAddress()
@@ -151,7 +152,7 @@ public function testReSetShippingMethod()
* @param string $input
* @param string $message
* @dataProvider dataProviderSetShippingMethodWithWrongParameters
- * @throws \Exception
+ * @throws Exception
*/
public function testSetShippingMethodWithWrongParameters(string $input, string $message)
{
@@ -270,6 +271,14 @@ public function dataProviderSetShippingMethodWithWrongParameters(): array
}]',
'Could not find a cart with ID "non_existent_masked_id"'
],
+ 'disabled_shipping_method' => [
+ 'cart_id: "cart_id_value", shipping_methods: [{
+ cart_address_id: cart_address_id_value
+ carrier_code: "freeshipping"
+ method_code: "freeshipping"
+ }]',
+ 'Carrier with such method not found: freeshipping, freeshipping'
+ ],
];
}
@@ -279,7 +288,7 @@ public function dataProviderSetShippingMethodWithWrongParameters(): array
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
- * @expectedException \Exception
+ * @expectedException Exception
* @expectedExceptionMessage You cannot specify multiple shipping methods.
*/
public function testSetMultipleShippingMethods()
@@ -325,7 +334,7 @@ public function testSetMultipleShippingMethods()
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
* @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
*
- * @expectedException \Exception
+ * @expectedException Exception
*/
public function testSetShippingMethodToCustomerCart()
{
@@ -373,6 +382,30 @@ public function testSetShippingMethodIfGuestIsNotOwnerOfAddress()
$this->graphQlMutation($query);
}
+ /**
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/quote_with_address.php
+ *
+ * @expectedException Exception
+ * @expectedExceptionMessage The shipping method can't be set for an empty cart. Add an item to cart and try again.
+ */
+ public function testSetShippingMethodOnAnEmptyCart()
+ {
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote');
+ $carrierCode = 'flatrate';
+ $methodCode = 'flatrate';
+ $quoteAddressId = $this->getQuoteShippingAddressIdByReservedQuoteId->execute('test_quote');
+
+ $query = $this->getQuery(
+ $maskedQuoteId,
+ $methodCode,
+ $carrierCode,
+ $quoteAddressId
+ );
+ $this->graphQlMutation($query);
+ }
+
/**
* @param string $maskedQuoteId
* @param string $shippingMethodCode
diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Ups/SetUpsShippingMethodsOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Ups/SetUpsShippingMethodsOnCartTest.php
index 6861bb8dbb240..fb0c205c86a2c 100644
--- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Ups/SetUpsShippingMethodsOnCartTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Ups/SetUpsShippingMethodsOnCartTest.php
@@ -7,32 +7,56 @@
namespace Magento\GraphQl\Ups;
+use Magento\GraphQl\Quote\GetMaskedQuoteIdByReservedOrderId;
+use Magento\GraphQl\Quote\GetQuoteShippingAddressIdByReservedQuoteId;
use Magento\Integration\Api\CustomerTokenServiceInterface;
-use Magento\Quote\Model\QuoteFactory;
-use Magento\Quote\Model\QuoteIdToMaskedQuoteIdInterface;
-use Magento\Quote\Model\ResourceModel\Quote as QuoteResource;
use Magento\TestFramework\Helper\Bootstrap;
use Magento\TestFramework\TestCase\GraphQlAbstract;
/**
- * Test for setting "UPS" shipping method on cart
+ * Test for setting "UPS" shipping method on cart. Current class covers the next UPS shipping methods:
+ *
+ * | Code | Label
+ * --------------------------------------
+ * | 1DM | Next Day Air Early AM
+ * | 1DA | Next Day Air
+ * | 2DA | 2nd Day Air
+ * | 3DS | 3 Day Select
+ * | GND | Ground
+ * | STD | Canada Standard
+ * | XPR | Worldwide Express
+ * | WXS | Worldwide Express Saver
+ * | XDM | Worldwide Express Plus
+ * | XPD | Worldwide Expedited
+ *
+ * Current class does not cover these UPS shipping methods (depends on address and sandbox settings)
+ *
+ * | Code | Label
+ * --------------------------------------
+ * | 1DML | Next Day Air Early AM Letter
+ * | 1DAL | Next Day Air Letter
+ * | 1DAPI | Next Day Air Intra (Puerto Rico)
+ * | 1DP | Next Day Air Saver
+ * | 1DPL | Next Day Air Saver Letter
+ * | 2DM | 2nd Day Air AM
+ * | 2DML | 2nd Day Air AM Letter
+ * | 2DAL | 2nd Day Air Letter
+ * | GNDCOM | Ground Commercial
+ * | GNDRES | Ground Residential
+ * | XPRL | Worldwide Express Letter
+ * | XDML | Worldwide Express Plus Letter
*/
class SetUpsShippingMethodsOnCartTest extends GraphQlAbstract
{
/**
- * Defines carrier code for "UPS" shipping method
- */
- const CARRIER_CODE = 'ups';
-
- /**
- * Defines method code for the "Ground" UPS shipping
+ * Defines carrier label for "UPS" shipping method
*/
- const CARRIER_METHOD_CODE_GROUND = 'GND';
+ const CARRIER_LABEL = 'United Parcel Service';
/**
- * @var QuoteFactory
+ * Defines carrier code for "UPS" shipping method
*/
- private $quoteFactory;
+ const CARRIER_CODE = 'ups';
/**
* @var CustomerTokenServiceInterface
@@ -40,14 +64,14 @@ class SetUpsShippingMethodsOnCartTest extends GraphQlAbstract
private $customerTokenService;
/**
- * @var QuoteResource
+ * @var GetMaskedQuoteIdByReservedOrderId
*/
- private $quoteResource;
+ private $getMaskedQuoteIdByReservedOrderId;
/**
- * @var QuoteIdToMaskedQuoteIdInterface
+ * @var GetQuoteShippingAddressIdByReservedQuoteId
*/
- private $quoteIdToMaskedId;
+ private $getQuoteShippingAddressIdByReservedQuoteId;
/**
* @inheritdoc
@@ -55,38 +79,123 @@ class SetUpsShippingMethodsOnCartTest extends GraphQlAbstract
protected function setUp()
{
$objectManager = Bootstrap::getObjectManager();
- $this->quoteResource = $objectManager->get(QuoteResource::class);
- $this->quoteFactory = $objectManager->get(QuoteFactory::class);
- $this->quoteIdToMaskedId = $objectManager->get(QuoteIdToMaskedQuoteIdInterface::class);
$this->customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class);
+ $this->getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class);
+ $this->getQuoteShippingAddressIdByReservedQuoteId = $objectManager->get(
+ GetQuoteShippingAddressIdByReservedQuoteId::class
+ );
}
/**
- * @magentoApiDataFixture Magento/Checkout/_files/quote_with_address_saved.php
- * @magentoApiDataFixture Magento/Ups/_files/enable_ups_shipping_method.php
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php
+ * @magentoApiDataFixture Magento/GraphQl/Ups/_files/enable_ups_shipping_method.php
+ *
+ * @dataProvider dataProviderShippingMethods
+ * @param string $methodCode
+ * @param string $methodLabel
*/
- public function testSetUpsShippingMethod()
+ public function testSetUpsShippingMethod(string $methodCode, string $methodLabel)
{
- $quote = $this->quoteFactory->create();
- $this->quoteResource->load($quote, 'test_order_1', 'reserved_order_id');
- $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$quote->getId());
- $shippingAddressId = (int)$quote->getShippingAddress()->getId();
-
- $query = $this->getAddUpsShippingMethodQuery(
- $maskedQuoteId,
- $shippingAddressId,
- self::CARRIER_CODE,
- self::CARRIER_METHOD_CODE_GROUND
+ $quoteReservedId = 'test_quote';
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($quoteReservedId);
+ $shippingAddressId = $this->getQuoteShippingAddressIdByReservedQuoteId->execute($quoteReservedId);
+
+ $query = $this->getQuery($maskedQuoteId, $shippingAddressId, self::CARRIER_CODE, $methodCode);
+ $response = $this->sendRequestWithToken($query);
+
+ self::assertArrayHasKey('setShippingMethodsOnCart', $response);
+ self::assertArrayHasKey('cart', $response['setShippingMethodsOnCart']);
+ self::assertArrayHasKey('shipping_addresses', $response['setShippingMethodsOnCart']['cart']);
+ self::assertCount(1, $response['setShippingMethodsOnCart']['cart']['shipping_addresses']);
+
+ $shippingAddress = current($response['setShippingMethodsOnCart']['cart']['shipping_addresses']);
+ self::assertArrayHasKey('selected_shipping_method', $shippingAddress);
+
+ self::assertArrayHasKey('carrier_code', $shippingAddress['selected_shipping_method']);
+ self::assertEquals(self::CARRIER_CODE, $shippingAddress['selected_shipping_method']['carrier_code']);
+
+ self::assertArrayHasKey('method_code', $shippingAddress['selected_shipping_method']);
+ self::assertEquals($methodCode, $shippingAddress['selected_shipping_method']['method_code']);
+
+ self::assertArrayHasKey('label', $shippingAddress['selected_shipping_method']);
+ self::assertEquals(
+ self::CARRIER_LABEL . ' - ' . $methodLabel,
+ $shippingAddress['selected_shipping_method']['label']
);
+ }
+ /**
+ * @return array
+ */
+ public function dataProviderShippingMethods(): array
+ {
+ return [
+ 'Next Day Air Early AM' => ['1DM', 'Next Day Air Early AM'],
+ 'Next Day Air' => ['1DA', 'Next Day Air'],
+ '2nd Day Air' => ['2DA', '2nd Day Air'],
+ '3 Day Select' => ['3DS', '3 Day Select'],
+ 'Ground' => ['GND', 'Ground'],
+ ];
+ }
+
+ /**
+ * @magentoApiDataFixture Magento/Customer/_files/customer.php
+ * @magentoApiDataFixture Magento/GraphQl/Catalog/_files/simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php
+ * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_canada_address.php
+ * @magentoApiDataFixture Magento/GraphQl/Ups/_files/enable_ups_shipping_method.php
+ *
+ * @dataProvider dataProviderShippingMethodsBasedOnCanadaAddress
+ * @param string $methodCode
+ * @param string $methodLabel
+ */
+ public function testSetUpsShippingMethodBasedOnCanadaAddress(string $methodCode, string $methodLabel)
+ {
+ $quoteReservedId = 'test_quote';
+ $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute($quoteReservedId);
+ $shippingAddressId = $this->getQuoteShippingAddressIdByReservedQuoteId->execute($quoteReservedId);
+
+ $query = $this->getQuery($maskedQuoteId, $shippingAddressId, self::CARRIER_CODE, $methodCode);
$response = $this->sendRequestWithToken($query);
- $addressesInformation = $response['setShippingMethodsOnCart']['cart']['shipping_addresses'];
- $expectedResult = [
- 'carrier_code' => self::CARRIER_CODE,
- 'method_code' => self::CARRIER_METHOD_CODE_GROUND,
- 'label' => 'United Parcel Service - Ground',
+
+ self::assertArrayHasKey('setShippingMethodsOnCart', $response);
+ self::assertArrayHasKey('cart', $response['setShippingMethodsOnCart']);
+ self::assertArrayHasKey('shipping_addresses', $response['setShippingMethodsOnCart']['cart']);
+ self::assertCount(1, $response['setShippingMethodsOnCart']['cart']['shipping_addresses']);
+
+ $shippingAddress = current($response['setShippingMethodsOnCart']['cart']['shipping_addresses']);
+ self::assertArrayHasKey('selected_shipping_method', $shippingAddress);
+
+ self::assertArrayHasKey('carrier_code', $shippingAddress['selected_shipping_method']);
+ self::assertEquals(self::CARRIER_CODE, $shippingAddress['selected_shipping_method']['carrier_code']);
+
+ self::assertArrayHasKey('method_code', $shippingAddress['selected_shipping_method']);
+ self::assertEquals($methodCode, $shippingAddress['selected_shipping_method']['method_code']);
+
+ self::assertArrayHasKey('label', $shippingAddress['selected_shipping_method']);
+ self::assertEquals(
+ self::CARRIER_LABEL . ' - ' . $methodLabel,
+ $shippingAddress['selected_shipping_method']['label']
+ );
+ }
+
+ /**
+ * @return array
+ */
+ public function dataProviderShippingMethodsBasedOnCanadaAddress(): array
+ {
+ return [
+ 'Canada Standard' => ['STD', 'Canada Standard'],
+ 'Worldwide Express' => ['XPR', 'Worldwide Express'],
+ 'Worldwide Express Saver' => ['WXS', 'Worldwide Express Saver'],
+ 'Worldwide Express Plus' => ['XDM', 'Worldwide Express Plus'],
+ 'Worldwide Expedited' => ['XPD', 'Worldwide Expedited'],
];
- self::assertEquals($addressesInformation[0]['selected_shipping_method'], $expectedResult);
}
/**
@@ -98,7 +207,7 @@ public function testSetUpsShippingMethod()
* @param string $methodCode
* @return string
*/
- private function getAddUpsShippingMethodQuery(
+ private function getQuery(
string $maskedQuoteId,
int $shippingAddressId,
string $carrierCode,
diff --git a/dev/tests/functional/tests/app/Magento/AdminNotification/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/AdminNotification/Test/TestCase/NavigateMenuTest.xml
index f2f56eb74f704..99bd9c6d9d220 100644
--- a/dev/tests/functional/tests/app/Magento/AdminNotification/Test/TestCase/NavigateMenuTest.xml
+++ b/dev/tests/functional/tests/app/Magento/AdminNotification/Test/TestCase/NavigateMenuTest.xml
@@ -8,6 +8,7 @@
+ mftf_migrated:yes
System > Notifications
Notifications
diff --git a/dev/tests/functional/tests/app/Magento/Analytics/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Analytics/Test/TestCase/NavigateMenuTest.xml
index cdb73c5d36f25..8f7b07c8c14c4 100644
--- a/dev/tests/functional/tests/app/Magento/Analytics/Test/TestCase/NavigateMenuTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Analytics/Test/TestCase/NavigateMenuTest.xml
@@ -8,6 +8,7 @@
+ mftf_migrated:yes
MAGETWO-97261: Magento\Backend\Test\TestCase\NavigateMenuTest fails on Jenkins
Reports > BI Essentials
false
@@ -15,6 +16,7 @@
+ mftf_migrated:yes
Reports > Advanced Reporting
false
https://advancedreporting.rjmetrics.com/report
diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/NavigateMenuTest.xml
index 67842f62d7c92..afdf70704a984 100644
--- a/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/NavigateMenuTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/NavigateMenuTest.xml
@@ -8,26 +8,31 @@
+ mftf_migrated:yes
Dashboard
Dashboard
+ mftf_migrated:yes
Content > Schedule
Store Design Schedule
+ mftf_migrated:yes
Stores > All Stores
Stores
+ mftf_migrated:yes
Stores > Configuration
Configuration
+ mftf_migrated:yes
System > Cache Management
Cache Management
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/NavigateMenuTest.xml
index 260095048431e..08bff9f70708a 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/NavigateMenuTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/NavigateMenuTest.xml
@@ -8,21 +8,25 @@
+ mftf_migrated:yes
Catalog > Products
Products
+ mftf_migrated:yes
Catalog > Categories
Default Category (ID: 2)
+ mftf_migrated:yes
Stores > Product
Product Attributes
+ mftf_migrated:yes
Stores > Attribute Set
Attribute Sets
diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/NavigateMenuTest.xml
index 659d76eabccbe..4a965d5708947 100644
--- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/NavigateMenuTest.xml
+++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/TestCase/NavigateMenuTest.xml
@@ -8,6 +8,7 @@
+ mftf_migrated:yes
Marketing > Catalog Price Rule
Catalog Price Rule
diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/NavigateMenuTest.xml
index 493d427dd0ac2..d9bb0f65e704e 100644
--- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/NavigateMenuTest.xml
+++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/NavigateMenuTest.xml
@@ -8,11 +8,13 @@
+ mftf_migrated:yes
Marketing > Search Terms
Search Terms
+ mftf_migrated:yes
Reports > Search Terms
Search Terms Report
diff --git a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SearchEntityResultsTest.xml b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SearchEntityResultsTest.xml
index dc91608f361c2..42dd7b6c96e2e 100644
--- a/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SearchEntityResultsTest.xml
+++ b/dev/tests/functional/tests/app/Magento/CatalogSearch/Test/TestCase/SearchEntityResultsTest.xml
@@ -8,53 +8,64 @@
- test_type:acceptance_test, test_type:extended_acceptance_test
+ test_type:acceptance_test, test_type:extended_acceptance_test, mftf_migrated:yes
catalogProductSimple::default::sku
+ mftf_migrated:yes
catalogProductSimple::default::simple
+ mftf_migrated:yes
catalogProductVirtual::default::virtual
+ mftf_migrated:yes
configurableProduct::default::configurable
+ mftf_migrated:yes
downloadableProduct::default::downloadable
+ mftf_migrated:yes
groupedProduct::withSimpleProducts_without_qty::grouped
+ mftf_migrated:yes
bundleProduct::bundle_dynamic_product::bundle
+ mftf_migrated:yes
bundleProduct::bundle_fixed_product::bundle
+ mftf_migrated:yes
catalogProductSimple::default::name
+ mftf_migrated:yes
catalogProductSimple::product_with_special_symbols_in_name::name
+ mftf_migrated:yes
TryToFindMeAndI'llFindYOU
catalogProductSimple::default
+ mftf_migrated:yes
catalogProductSimple::default::name
2
@@ -66,6 +77,7 @@
+ mftf_migrated:yes
catalogProductSimple::product_with_long_name::name
128
@@ -80,6 +92,7 @@
+ mftf_migrated:yes
alaska
- catalogProductSimple::search_weight_term_twice_weight_1
@@ -90,6 +103,7 @@
+ mftf_migrated:yes
alaska
- catalogProductSimple::search_weight_term_once_weight_5
@@ -98,6 +112,7 @@
+ mftf_migrated:yes
configurableProduct::one_simple_product_not_visible_individually::name
diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.xml
index 0edd8f4183f30..daf9aaae50580 100644
--- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestCase/OnePageCheckoutTest.xml
@@ -15,13 +15,11 @@
- 1
-
- - 1
-
- 565.00
Flat Rate
+ false
Fixed
checkmo
checkmo
@@ -43,6 +41,7 @@
- 565.00
Flat Rate
+ false
Fixed
checkmo
checkmo
@@ -61,7 +60,7 @@
UK_address_without_email
Flat Rate
Fixed
- Yes
+ false
US_address_1_without_email
checkmo
checkmo
diff --git a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/FillBillingInformationStep.php b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/FillBillingInformationStep.php
index aa7eba634145f..52b296c2e01fa 100644
--- a/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/FillBillingInformationStep.php
+++ b/dev/tests/functional/tests/app/Magento/Checkout/Test/TestStep/FillBillingInformationStep.php
@@ -126,11 +126,15 @@ public function run()
if ($this->billingCheckboxState) {
$this->assertBillingAddressCheckbox->processAssert($this->checkoutOnepage, $this->billingCheckboxState);
}
- if ($this->billingCheckboxState === 'Yes' && !$this->editBillingInformation) {
- return [
- 'billingAddress' => $this->shippingAddress
- ];
+
+ if (!$this->editBillingInformation) {
+ $billingAddress = $this->billingCheckboxState === 'Yes'
+ ? $this->shippingAddress
+ : $this->getDefaultBillingAddress();
+
+ return ['billingAddress' => $billingAddress];
}
+
if ($this->billingAddress) {
$selectedPaymentMethod = $this->checkoutOnepage->getPaymentBlock()->getSelectedPaymentMethodBlock();
if ($this->shippingAddress) {
@@ -139,9 +143,11 @@ public function run()
$selectedPaymentMethod->getBillingBlock()->fillBilling($this->billingAddress);
$billingAddress = $this->billingAddress;
}
+
if (isset($this->billingAddressCustomer['added'])) {
$addressIndex = $this->billingAddressCustomer['added'];
- $billingAddress = $this->customer->getDataFieldConfig('address')['source']->getAddresses()[$addressIndex];
+ $billingAddress = $this->customer->getDataFieldConfig('address')['source']
+ ->getAddresses()[$addressIndex];
$address = $this->objectManager->create(
\Magento\Customer\Test\Block\Address\Renderer::class,
['address' => $billingAddress, 'type' => 'html_for_select_element']
@@ -156,4 +162,25 @@ public function run()
'billingAddress' => $billingAddress
];
}
+
+ /**
+ * Get default billing address
+ *
+ * @return Address|null
+ */
+ private function getDefaultBillingAddress()
+ {
+ $addresses = $this->customer->hasData('address')
+ ? $this->customer->getDataFieldConfig('address')['source']->getAddresses()
+ : [];
+ $defaultAddress = null;
+ foreach ($addresses as $address) {
+ if ($address->getDefaultBilling() === 'Yes') {
+ $defaultAddress = $address;
+ break;
+ }
+ }
+
+ return $defaultAddress;
+ }
}
diff --git a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/NavigateMenuTest.xml
index 18cbf32ded5c1..3458e2944a9ec 100644
--- a/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/NavigateMenuTest.xml
+++ b/dev/tests/functional/tests/app/Magento/CheckoutAgreements/Test/TestCase/NavigateMenuTest.xml
@@ -8,7 +8,7 @@
- severity:S2
+ severity:S2, mftf_migrated:yes
Stores > Terms and Conditions
Terms and Conditions
diff --git a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/NavigateMenuTest.xml
index f9f0a11c0a475..cff5f7f2a5622 100644
--- a/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/NavigateMenuTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Cms/Test/TestCase/NavigateMenuTest.xml
@@ -8,13 +8,13 @@
- severity:S2
+ severity:S2, mftf_migrated:yes
Content > Pages
Pages
- severity:S2
+ severity:S2, mftf_migrated:yes
Content > Blocks
Blocks
diff --git a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/TestCase/NavigateMenuTest.xml
index 0a061eb4be6c7..fc031a77ff53f 100644
--- a/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/TestCase/NavigateMenuTest.xml
+++ b/dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/TestCase/NavigateMenuTest.xml
@@ -8,11 +8,13 @@
+ mftf_migrated:yes
Stores > Currency Rates
Currency Rates
+ mftf_migrated:yes
Stores > Currency Symbols
Currency Symbols
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/NavigateMenuTest.xml
index 404e62dcad648..a4a3aa34f9f1c 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/NavigateMenuTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/NavigateMenuTest.xml
@@ -8,16 +8,19 @@
+ mftf_migrated:yes
Customers > All Customers
Customers
+ mftf_migrated:yes
Customers > Now Online
Customers Now Online
+ mftf_migrated:yes
Customers > Customer Groups
Customer Groups
diff --git a/dev/tests/functional/tests/app/Magento/Email/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Email/Test/TestCase/NavigateMenuTest.xml
index f6dcdd5b65d02..4e98019c25317 100644
--- a/dev/tests/functional/tests/app/Magento/Email/Test/TestCase/NavigateMenuTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Email/Test/TestCase/NavigateMenuTest.xml
@@ -8,6 +8,7 @@
+ mftf_migrated:yes
Marketing > Email Templates
Email Templates
diff --git a/dev/tests/functional/tests/app/Magento/ImportExport/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/ImportExport/Test/TestCase/NavigateMenuTest.xml
index 6ce4d01d177db..d396a364a3f42 100644
--- a/dev/tests/functional/tests/app/Magento/ImportExport/Test/TestCase/NavigateMenuTest.xml
+++ b/dev/tests/functional/tests/app/Magento/ImportExport/Test/TestCase/NavigateMenuTest.xml
@@ -8,11 +8,13 @@
+ mftf_migrated:yes
System > Import
Import
+ mftf_migrated:yes
System > Export
Export
diff --git a/dev/tests/functional/tests/app/Magento/Indexer/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Indexer/Test/TestCase/NavigateMenuTest.xml
index 883e9bde47bf8..16ae092e62cad 100644
--- a/dev/tests/functional/tests/app/Magento/Indexer/Test/TestCase/NavigateMenuTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Indexer/Test/TestCase/NavigateMenuTest.xml
@@ -8,6 +8,7 @@
+ mftf_migrated:yes
System > Index Management
Index Management
diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/NavigateMenuTest.xml
index 22def36751f53..265790ed4b763 100644
--- a/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/NavigateMenuTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/NavigateMenuTest.xml
@@ -8,6 +8,7 @@
+ mftf_migrated:yes
System > Integrations
Integrations
diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Newsletter/Test/TestCase/NavigateMenuTest.xml
index 13843a50868e7..b1a6b3e0c4386 100644
--- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/TestCase/NavigateMenuTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/TestCase/NavigateMenuTest.xml
@@ -8,21 +8,25 @@
+ mftf_migrated:yes
Marketing > Newsletter Template
Newsletter Templates
+ mftf_migrated:yes
Marketing > Newsletter Queue
Newsletter Queue
+ mftf_migrated:yes
Marketing > Newsletter Subscribers
Newsletter Subscribers
+ mftf_migrated:yes
Reports > Newsletter Problem Reports
Newsletter Problems Report
diff --git a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/NavigateMenuTest.xml
index d7d031f559f82..114235e75524f 100644
--- a/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/NavigateMenuTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Paypal/Test/TestCase/NavigateMenuTest.xml
@@ -8,13 +8,13 @@
- severity:S0
+ severity:S0, mftf_migrated:yes
Reports > PayPal Settlement
PayPal Settlement Reports
- severity:S0
+ severity:S0, mftf_migrated:yes
Sales > Billing Agreements
Billing Agreements
diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NavigateMenuTest.xml
index 08cce1ffe7d23..4e3cd1824767a 100644
--- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NavigateMenuTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NavigateMenuTest.xml
@@ -8,76 +8,91 @@
+ mftf_migrated:yes
Reports > Products in Cart
Products in Carts
+ mftf_migrated:yes
Reports > Abandoned Carts
Abandoned Carts
+ mftf_migrated:yes
Reports > Orders
Orders Report
+ mftf_migrated:yes
Reports > Tax
Tax Report
+ mftf_migrated:yes
Reports > Invoiced
Invoice Report
+ mftf_migrated:yes
Reports > Coupons
Coupons Report
+ mftf_migrated:yes
Reports > Order Total
Order Total Report
+ mftf_migrated:yes
Reports > Order Count
Order Count Report
+ mftf_migrated:yes
Reports > New
New Accounts Report
+ mftf_migrated:yes
Reports > Views
Product Views Report
+ mftf_migrated:yes
Reports > Bestsellers
Bestsellers Report
+ mftf_migrated:yes
Reports > Low Stock
Low Stock Report
+ mftf_migrated:yes
Reports > Ordered
Ordered Products Report
+ mftf_migrated:yes
Reports > Downloads
Downloads Report
+ mftf_migrated:yes
Reports > Refresh Statistics
Refresh Statistics
diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/NavigateMenuTest.xml
index 4d96ebd2edbe3..334497cc2f77e 100644
--- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/NavigateMenuTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/NavigateMenuTest.xml
@@ -8,21 +8,25 @@
+ mftf_migrated:yes
Marketing > All Reviews
Reviews
+ mftf_migrated:yes
Reports > By Customers
Customer Reviews Report
+ mftf_migrated:yes
Reports > By Products
Product Reviews Report
+ mftf_migrated:yes
Stores > Rating
Ratings
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/NavigateMenuTest.xml
index 316ba33f19fdb..5cc673f4b4fa5 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/NavigateMenuTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/NavigateMenuTest.xml
@@ -8,31 +8,37 @@
+ mftf_migrated:yes
Sales > Orders
Orders
+ mftf_migrated:yes
Sales > Invoices
Invoices
+ mftf_migrated:yes
Sales > Shipments
Shipments
+ mftf_migrated:yes
Sales > Credit Memos
Credit Memos
+ mftf_migrated:yes
Sales > Transactions
Transactions
+ mftf_migrated:yes
Stores > Order Status
Order Status
diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/NavigateMenuTest.xml
index 0a100eabcff46..1eeaeaaa483c0 100644
--- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/NavigateMenuTest.xml
+++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/NavigateMenuTest.xml
@@ -8,6 +8,7 @@
+ mftf_migrated:yes
Marketing > Cart Price Rules
Cart Price Rules
diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/NavigateMenuTest.xml
index cbef8fd52fd80..0f9514ffc7a00 100644
--- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/NavigateMenuTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/NavigateMenuTest.xml
@@ -8,7 +8,7 @@
- severity:S2
+ severity:S2, mftf_migrated:yes
Marketing > Site Map
Site Map
diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreGroupEntityTest.xml b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreGroupEntityTest.xml
index 8cdeb48bb1c98..dcfe22eb0d5f8 100644
--- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreGroupEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreGroupEntityTest.xml
@@ -8,7 +8,7 @@
- severity:S1
+ severity:S1, mftf_migrated:yes
main_website
store_name_%isolation%
store_code_%isolation%
@@ -18,7 +18,7 @@
- severity:S1
+ severity:S1, mftf_migrated:yes
custom_website
store_name_%isolation%
store_code_%isolation%
@@ -29,6 +29,7 @@
+ mftf_migrated:yes
custom_new_group
diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/MoveStoreToOtherGroupSameWebsiteTest.xml b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/MoveStoreToOtherGroupSameWebsiteTest.xml
index 8da208bc3f0f1..ab702dfdd4b78 100644
--- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/MoveStoreToOtherGroupSameWebsiteTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/MoveStoreToOtherGroupSameWebsiteTest.xml
@@ -8,6 +8,7 @@
+ mftf_migrated:yes
custom_group_custom_store
custom_group_custom_store
diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreEntityTest.xml b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreEntityTest.xml
index 4a73986673c60..6053352386203 100644
--- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreEntityTest.xml
@@ -8,7 +8,7 @@
- severity:S2
+ severity:S2, mftf_migrated:yes
custom
default
storename_updated%isolation%
@@ -21,7 +21,7 @@
- severity:S1
+ severity:S1, mftf_migrated:yes
default
storename_updated%isolation%
diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreGroupEntityTest.xml b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreGroupEntityTest.xml
index 593d9c365a92e..9ff67a9ba9fec 100644
--- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreGroupEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/UpdateStoreGroupEntityTest.xml
@@ -8,7 +8,7 @@
- severity:S2
+ severity:S2, mftf_migrated:yes
custom
main_website
store_name_updated_%isolation%
@@ -20,7 +20,7 @@
- severity:S2
+ severity:S2, mftf_migrated:yes
custom
custom_website
store_name_updated_%isolation%
diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/NavigateMenuTest.xml
index ee225f21462ea..ecf202ddae3a8 100644
--- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/NavigateMenuTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/NavigateMenuTest.xml
@@ -8,16 +8,19 @@
+ mftf_migrated:yes
Stores > Tax Rules
Tax Rules
+ mftf_migrated:yes
Stores > Tax Zones and Rates
Tax Zones and Rates
+ mftf_migrated:yes
System > Import/Export Tax Rates
Import and Export Tax Rates
diff --git a/dev/tests/functional/tests/app/Magento/Theme/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Theme/Test/TestCase/NavigateMenuTest.xml
index 71964fc926499..ee38659122301 100644
--- a/dev/tests/functional/tests/app/Magento/Theme/Test/TestCase/NavigateMenuTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Theme/Test/TestCase/NavigateMenuTest.xml
@@ -8,6 +8,7 @@
+ mftf_migrated:yes
Content > Themes
Themes
diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/NavigateMenuTest.xml
index cdf1d9e3617d8..30d9e57602af1 100644
--- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/NavigateMenuTest.xml
+++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/NavigateMenuTest.xml
@@ -8,6 +8,7 @@
+ mftf_migrated:yes
Marketing > URL Rewrites
URL Rewrites
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/NavigateMenuTest.xml
index d196bebca0e9a..4572738b6cb48 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/NavigateMenuTest.xml
+++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/NavigateMenuTest.xml
@@ -8,21 +8,25 @@
+ mftf_migrated:yes
System > Locked Users
Locked Users
+ mftf_migrated:yes
System > Manage Encryption Key
Encryption Key
+ mftf_migrated:yes
System > All Users
Users
+ mftf_migrated:yes
System > User Roles
Roles
diff --git a/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/NavigateMenuTest.xml
index 3fceddf1a807a..0a9c74cd92bc6 100644
--- a/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/NavigateMenuTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/NavigateMenuTest.xml
@@ -8,6 +8,7 @@
+ mftf_migrated:yes
System > Custom Variables
Custom Variables
diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/NavigateMenuTest.xml
index 6b3215dd30d16..6a2a533c59df2 100644
--- a/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/NavigateMenuTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/NavigateMenuTest.xml
@@ -8,7 +8,7 @@
- severity:S2
+ severity:S2, mftf_migrated:yes
Content > Widgets
Widgets
diff --git a/dev/tests/integration/testsuite/Magento/Bundle/Model/Product/PriceTest.php b/dev/tests/integration/testsuite/Magento/Bundle/Model/Product/PriceTest.php
index 2a68ff48e5f9a..4a5757aae3134 100644
--- a/dev/tests/integration/testsuite/Magento/Bundle/Model/Product/PriceTest.php
+++ b/dev/tests/integration/testsuite/Magento/Bundle/Model/Product/PriceTest.php
@@ -6,7 +6,7 @@
namespace Magento\Bundle\Model\Product;
/**
- * @magentoDataFixture Magento/Bundle/_files/product_with_tier_pricing.php
+ * Class to test bundle prices
*/
class PriceTest extends \PHPUnit\Framework\TestCase
{
@@ -22,6 +22,9 @@ protected function setUp()
);
}
+ /**
+ * @magentoDataFixture Magento/Bundle/_files/product_with_tier_pricing.php
+ */
public function testGetTierPrice()
{
/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */
@@ -37,4 +40,50 @@ public function testGetTierPrice()
$this->assertEquals(20.0, $this->_model->getTierPrice(4, $product));
$this->assertEquals(30.0, $this->_model->getTierPrice(5, $product));
}
+
+ /**
+ * Test calculation final price for bundle product with tire price in simple product
+ *
+ * @param float $bundleQty
+ * @param float $selectionQty
+ * @param float $finalPrice
+ * @magentoDataFixture Magento/Bundle/_files/product_with_simple_tier_pricing.php
+ * @dataProvider getSelectionFinalTotalPriceWithSimpleTierPriceDataProvider
+ */
+ public function testGetSelectionFinalTotalPriceWithSimpleTierPrice(
+ float $bundleQty,
+ float $selectionQty,
+ float $finalPrice
+ ) {
+ /** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */
+ $productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
+ ->create(\Magento\Catalog\Api\ProductRepositoryInterface::class);
+ $bundleProduct = $productRepository->get('bundle-product');
+ $simpleProduct = $productRepository->get('simple');
+ $simpleProduct->setCustomerGroupId(\Magento\Customer\Model\Group::CUST_GROUP_ALL);
+
+ $this->assertEquals(
+ $finalPrice,
+ $this->_model->getSelectionFinalTotalPrice(
+ $bundleProduct,
+ $simpleProduct,
+ $bundleQty,
+ $selectionQty,
+ false
+ ),
+ 'Tier price calculation for Simple product is wrong'
+ );
+ }
+
+ /**
+ * @return array
+ */
+ public function getSelectionFinalTotalPriceWithSimpleTierPriceDataProvider(): array
+ {
+ return [
+ [1, 1, 10],
+ [2, 1, 8],
+ [5, 1, 5],
+ ];
+ }
}
diff --git a/dev/tests/integration/testsuite/Magento/Bundle/_files/product_with_simple_tier_pricing.php b/dev/tests/integration/testsuite/Magento/Bundle/_files/product_with_simple_tier_pricing.php
new file mode 100644
index 0000000000000..30f0978480701
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Bundle/_files/product_with_simple_tier_pricing.php
@@ -0,0 +1,43 @@
+create(\Magento\Catalog\Model\ProductFactory::class);
+/** @var $bundleProduct \Magento\Catalog\Model\Product */
+$bundleProduct = $productFactory->create();
+$bundleProduct->setTypeId('bundle')
+ ->setAttributeSetId($product->getDefaultAttributeSetId())
+ ->setWebsiteIds([1])
+ ->setPriceType(\Magento\Bundle\Model\Product\Price::PRICE_TYPE_DYNAMIC)
+ ->setPriceView(1)
+ ->setName('Bundle Product')
+ ->setSku('bundle-product')
+ ->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
+ ->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
+ ->setStockData([
+ 'use_config_manage_stock' => 1,
+ 'qty' => 100,
+ 'is_qty_decimal' => 0,
+ 'is_in_stock' => 1,
+ ])
+ ->setBundleOptionsData(
+ [
+ [
+ 'title' => 'Bundle Product Items',
+ 'default_title' => 'Bundle Product Items',
+ 'type' => 'checkbox',
+ 'required' => 1,
+ 'delete' => '',
+ ],
+ ]
+ )
+ ->setBundleSelectionsData(
+ [[['product_id' => $product->getId(), 'selection_qty' => 1, 'delete' => '']]]
+ );
+$productRepository->save($bundleProduct);
diff --git a/dev/tests/integration/testsuite/Magento/Bundle/_files/product_with_simple_tier_pricing_rollback.php b/dev/tests/integration/testsuite/Magento/Bundle/_files/product_with_simple_tier_pricing_rollback.php
new file mode 100644
index 0000000000000..aa661c7412d42
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Bundle/_files/product_with_simple_tier_pricing_rollback.php
@@ -0,0 +1,24 @@
+get(\Magento\Framework\Registry::class);
+
+$registry->unregister('isSecureArea');
+$registry->register('isSecureArea', true);
+
+try {
+ $product = $productRepository->get('bundle-product');
+ $productRepository->delete($product);
+} catch (\Magento\Framework\Exception\NoSuchEntityException $exception) {
+ //Product already removed
+}
+
+$registry->unregister('isSecureArea');
+$registry->register('isSecureArea', false);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_options.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_options.php
new file mode 100644
index 0000000000000..a401db8eb2bf7
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_options.php
@@ -0,0 +1,107 @@
+create(\Magento\Catalog\Model\Product::class);
+
+$product->setTypeId(
+ 'simple'
+)->setAttributeSetId(
+ 4
+)->setWebsiteIds(
+ [1]
+)->setName(
+ 'Virtual Product With Custom Options'
+)->setSku(
+ 'simple'
+)->setPrice(
+ 10
+)->setMetaTitle(
+ 'meta title'
+)->setMetaKeyword(
+ 'meta keyword'
+)->setMetaDescription(
+ 'meta description'
+)->setVisibility(
+ \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH
+)->setStatus(
+ \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED
+)->setCanSaveCustomOptions(
+ true
+)->setStockData(
+ [
+ 'qty' => 100,
+ 'is_in_stock' => 1,
+ 'manage_stock' => 1,
+ ]
+)->setHasOptions(true);
+
+$options = [
+ [
+ 'title' => 'test_option_code_1',
+ 'type' => 'field',
+ 'is_require' => true,
+ 'sort_order' => 1,
+ 'price' => -10.0,
+ 'price_type' => 'fixed',
+ 'sku' => 'sku1',
+ 'max_characters' => 10,
+ ],
+ [
+ 'title' => 'area option',
+ 'type' => 'area',
+ 'is_require' => true,
+ 'sort_order' => 2,
+ 'price' => 20.0,
+ 'price_type' => 'percent',
+ 'sku' => 'sku2',
+ 'max_characters' => 20
+ ],
+ [
+ 'title' => 'drop_down option',
+ 'type' => 'drop_down',
+ 'is_require' => false,
+ 'sort_order' => 4,
+ 'values' => [
+ [
+ 'title' => 'drop_down option 1',
+ 'price' => 10,
+ 'price_type' => 'fixed',
+ 'sku' => 'drop_down option 1 sku',
+ 'sort_order' => 1,
+ ],
+ [
+ 'title' => 'drop_down option 2',
+ 'price' => 20,
+ 'price_type' => 'fixed',
+ 'sku' => 'drop_down option 2 sku',
+ 'sort_order' => 2,
+ ],
+ ],
+ ]
+];
+
+$customOptions = [];
+
+/** @var \Magento\Catalog\Api\Data\ProductCustomOptionInterfaceFactory $customOptionFactory */
+$customOptionFactory = $objectManager->get(\Magento\Catalog\Api\Data\ProductCustomOptionInterfaceFactory::class);
+
+foreach ($options as $option) {
+ /** @var \Magento\Catalog\Api\Data\ProductCustomOptionInterface $customOption */
+ $customOption = $customOptionFactory->create(['data' => $option]);
+ $customOption->setProductSku($product->getSku());
+
+ $customOptions[] = $customOption;
+}
+
+$product->setOptions($customOptions);
+
+/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepositoryFactory */
+$productRepository = $objectManager->get(\Magento\Catalog\Api\ProductRepositoryInterface::class);
+$productRepository->save($product);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_options_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_options_rollback.php
new file mode 100644
index 0000000000000..8863da1cd2782
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_with_options_rollback.php
@@ -0,0 +1,25 @@
+get(\Magento\Framework\Registry::class);
+
+$registry->unregister('isSecureArea');
+$registry->register('isSecureArea', true);
+
+$repository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
+ \Magento\Catalog\Model\ProductRepository::class
+);
+try {
+ $product = $repository->get('simple', false, null, true);
+ $repository->delete($product);
+} catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
+ //Entity already deleted
+}
+
+$registry->unregister('isSecureArea');
+$registry->register('isSecureArea', false);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_virtual.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_virtual.php
index 38e8c404dc002..838ae2b9a2aa6 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_virtual.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_virtual.php
@@ -3,9 +3,14 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+declare(strict_types=1);
-/** @var $product \Magento\Catalog\Model\Product */
-$product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Catalog\Model\Product::class);
+use Magento\Catalog\Api\Data\ProductInterfaceFactory;
+use Magento\TestFramework\Helper\Bootstrap;
+use Magento\Catalog\Model\ResourceModel\Product as ProductResource;
+
+$productFactory = Bootstrap::getObjectManager()->get(ProductInterfaceFactory::class);
+$product = $productFactory->create();
$product->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_VIRTUAL)
->setId(21)
->setAttributeSetId(4)
@@ -22,4 +27,7 @@
'is_in_stock' => 1,
'manage_stock' => 1,
]
- )->save();
+ );
+/** @var ProductResource $productResource */
+$productResource = Bootstrap::getObjectManager()->get(ProductResource::class);
+$productResource->save($product);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_virtual_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_virtual_rollback.php
index 7fdeca846885a..f5568ced2c96a 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_virtual_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_virtual_rollback.php
@@ -3,23 +3,27 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+declare(strict_types=1);
-/** @var \Magento\Framework\Registry $registry */
-$registry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(\Magento\Framework\Registry::class);
+use Magento\Catalog\Api\ProductRepositoryInterface;
+use Magento\Framework\Exception\NoSuchEntityException;
+use Magento\Framework\Exception\StateException;
+use Magento\TestFramework\Helper\Bootstrap;
+
+$registry = Bootstrap::getObjectManager()->get(\Magento\Framework\Registry::class);
$registry->unregister('isSecureArea');
$registry->register('isSecureArea', true);
-/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */
-$productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
- ->create(\Magento\Catalog\Api\ProductRepositoryInterface::class);
+$productRepository = Bootstrap::getObjectManager()
+ ->get(ProductRepositoryInterface::class);
try {
$product = $productRepository->get('virtual-product', false, null, true);
$productRepository->delete($product);
-} catch (\Magento\Framework\Exception\NoSuchEntityException $exception) {
+} catch (NoSuchEntityException $exception) {
//Product already removed
-} catch (\Magento\Framework\Exception\StateException $exception) {
+} catch (StateException $exception) {
}
$registry->unregister('isSecureArea');
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_virtual_with_options.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_virtual_with_options.php
new file mode 100644
index 0000000000000..c1f981cefa646
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_virtual_with_options.php
@@ -0,0 +1,107 @@
+create(\Magento\Catalog\Model\Product::class);
+
+$product->setTypeId(
+ 'virtual'
+)->setAttributeSetId(
+ 4
+)->setWebsiteIds(
+ [1]
+)->setName(
+ 'Virtual Product With Custom Options'
+)->setSku(
+ 'virtual'
+)->setPrice(
+ 10
+)->setMetaTitle(
+ 'meta title'
+)->setMetaKeyword(
+ 'meta keyword'
+)->setMetaDescription(
+ 'meta description'
+)->setVisibility(
+ \Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH
+)->setStatus(
+ \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED
+)->setCanSaveCustomOptions(
+ true
+)->setStockData(
+ [
+ 'qty' => 100,
+ 'is_in_stock' => 1,
+ 'manage_stock' => 1,
+ ]
+)->setHasOptions(true);
+
+$options = [
+ [
+ 'title' => 'test_option_code_1',
+ 'type' => 'field',
+ 'is_require' => true,
+ 'sort_order' => 1,
+ 'price' => -10.0,
+ 'price_type' => 'fixed',
+ 'sku' => 'sku1',
+ 'max_characters' => 10,
+ ],
+ [
+ 'title' => 'area option',
+ 'type' => 'area',
+ 'is_require' => true,
+ 'sort_order' => 2,
+ 'price' => 20.0,
+ 'price_type' => 'percent',
+ 'sku' => 'sku2',
+ 'max_characters' => 20
+ ],
+ [
+ 'title' => 'drop_down option',
+ 'type' => 'drop_down',
+ 'is_require' => false,
+ 'sort_order' => 4,
+ 'values' => [
+ [
+ 'title' => 'drop_down option 1',
+ 'price' => 10,
+ 'price_type' => 'fixed',
+ 'sku' => 'drop_down option 1 sku',
+ 'sort_order' => 1,
+ ],
+ [
+ 'title' => 'drop_down option 2',
+ 'price' => 20,
+ 'price_type' => 'fixed',
+ 'sku' => 'drop_down option 2 sku',
+ 'sort_order' => 2,
+ ],
+ ],
+ ]
+];
+
+$customOptions = [];
+
+/** @var \Magento\Catalog\Api\Data\ProductCustomOptionInterfaceFactory $customOptionFactory */
+$customOptionFactory = $objectManager->get(\Magento\Catalog\Api\Data\ProductCustomOptionInterfaceFactory::class);
+
+foreach ($options as $option) {
+ /** @var \Magento\Catalog\Api\Data\ProductCustomOptionInterface $customOption */
+ $customOption = $customOptionFactory->create(['data' => $option]);
+ $customOption->setProductSku($product->getSku());
+
+ $customOptions[] = $customOption;
+}
+
+$product->setOptions($customOptions);
+
+/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepositoryFactory */
+$productRepository = $objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class);
+$productRepository->save($product);
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_virtual_with_options_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_virtual_with_options_rollback.php
new file mode 100644
index 0000000000000..f46cdc13d3263
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_virtual_with_options_rollback.php
@@ -0,0 +1,25 @@
+get(\Magento\Framework\Registry::class);
+
+$registry->unregister('isSecureArea');
+$registry->register('isSecureArea', true);
+
+$repository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
+ \Magento\Catalog\Model\ProductRepository::class
+);
+try {
+ $product = $repository->get('virtual', false, null, true);
+ $repository->delete($product);
+} catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
+ //Entity already deleted
+}
+
+$registry->unregister('isSecureArea');
+$registry->register('isSecureArea', false);
diff --git a/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_virtual_product_saved.php b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_virtual_product_saved.php
index 835b2ab812856..833e5a57ac34f 100644
--- a/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_virtual_product_saved.php
+++ b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_virtual_product_saved.php
@@ -13,6 +13,7 @@
->setIsMultiShipping(false)
->setReservedOrderId('test_order_with_virtual_product_without_address')
->setEmail('store@example.com')
+ ->setCustomerEmail('store@example.com')
->addProduct(
$product->load($product->getId()),
1
diff --git a/dev/tests/integration/testsuite/Magento/Framework/Data/Form/Element/DateTest.php b/dev/tests/integration/testsuite/Magento/Framework/Data/Form/Element/DateTest.php
index a934372bfd907..9980f40239f8c 100644
--- a/dev/tests/integration/testsuite/Magento/Framework/Data/Form/Element/DateTest.php
+++ b/dev/tests/integration/testsuite/Magento/Framework/Data/Form/Element/DateTest.php
@@ -4,41 +4,51 @@
* See COPYING.txt for license details.
*/
+namespace Magento\Framework\Data\Form\Element;
+
+use Magento\Framework\Data\Form\ElementFactory;
+use Magento\TestFramework\Helper\Bootstrap;
+
/**
* Tests for \Magento\Framework\Data\Form\Element\Date
*/
-namespace Magento\Framework\Data\Form\Element;
-
class DateTest extends \PHPUnit\Framework\TestCase
{
/**
- * @var \Magento\Framework\Data\Form\ElementFactory
+ * @var ElementFactory
*/
- protected $_elementFactory;
+ private $elementFactory;
/**
- * SetUp method
+ * @inheritdoc
*/
protected function setUp()
{
- $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
- $this->_elementFactory = $objectManager->create(\Magento\Framework\Data\Form\ElementFactory::class);
+ $objectManager = Bootstrap::getObjectManager();
+ $this->elementFactory = $objectManager->create(ElementFactory::class);
}
/**
+ * Test get value
+ *
+ * @param array $data
+ * @param string $expect
+ * @return void
* @dataProvider getValueDataProvider
*/
- public function testGetValue(array $data, $expect)
+ public function testGetValue(array $data, string $expect): void
{
- /** @var $date \Magento\Framework\Data\Form\Element\Date */
- $date = $this->_elementFactory->create(\Magento\Framework\Data\Form\Element\Date::class, $data);
+ /** @var $date Date */
+ $date = $this->elementFactory->create(Date::class, $data);
$this->assertEquals($expect, $date->getValue());
}
/**
+ * Get value test data provider
+ *
* @return array
*/
- public function getValueDataProvider()
+ public function getValueDataProvider(): array
{
$testTimestamp = strtotime('2014-05-18 12:08:16');
$date = new \DateTime('@' . $testTimestamp);
@@ -56,15 +66,22 @@ public function getValueDataProvider()
'time_format' => 'h:mm a',
'value' => $testTimestamp,
],
- $date->format('g:i A')
+ $date->format('g:i A'),
],
[
[
'date_format' => 'MM/d/yy',
'value' => $testTimestamp,
],
- $date->format('m/j/y')
- ]
+ $date->format('m/j/y'),
+ ],
+ [
+ [
+ 'date_format' => 'd-MM-Y',
+ 'value' => $date->format('d-m-Y'),
+ ],
+ $date->format('d-m-Y'),
+ ],
];
}
}
diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Catalog/_files/apply_tax_for_simple_product.php b/dev/tests/integration/testsuite/Magento/GraphQl/Catalog/_files/apply_tax_for_simple_product.php
new file mode 100644
index 0000000000000..9968704517ecd
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/GraphQl/Catalog/_files/apply_tax_for_simple_product.php
@@ -0,0 +1,26 @@
+get(ProductRepositoryInterface::class);
+$product = $productRepository->get('simple_product');
+
+/** @var TaxClassCollectionFactory $taxClassCollectionFactory */
+$taxClassCollectionFactory = $objectManager->get(TaxClassCollectionFactory::class);
+$taxClassCollection = $taxClassCollectionFactory->create();
+
+/** @var TaxClassModel $taxClass */
+$taxClassCollection->addFieldToFilter('class_type', TaxClassModel::TAX_CLASS_TYPE_PRODUCT);
+$taxClass = $taxClassCollection->getFirstItem();
+
+$product->setCustomAttribute('tax_class_id', $taxClass->getClassId());
+$productRepository->save($product);
diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/guest/set_guest_email.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/guest/set_guest_email.php
new file mode 100644
index 0000000000000..c8084b2552395
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/guest/set_guest_email.php
@@ -0,0 +1,24 @@
+get(QuoteFactory::class);
+/** @var CartRepositoryInterface $cartRepository */
+$cartRepository = Bootstrap::getObjectManager()->get(CartRepositoryInterface::class);
+/** @var QuoteResource $quoteResource */
+$quoteResource = Bootstrap::getObjectManager()->get(QuoteResource::class);
+
+$quote = $quoteFactory->create();
+$quoteResource->load($quote, 'test_quote', 'reserved_order_id');
+
+$quote->setCustomerEmail('guest@example.com');
+$cartRepository->save($quote);
diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/set_new_shipping_address.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/set_new_shipping_address.php
index e17b9e61f82db..54f4d8d0c6e75 100644
--- a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/set_new_shipping_address.php
+++ b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/set_new_shipping_address.php
@@ -26,7 +26,7 @@
$quoteAddressData = [
AddressInterface::KEY_TELEPHONE => 3468676,
- AddressInterface::KEY_POSTCODE => 75477,
+ AddressInterface::KEY_POSTCODE => '75477',
AddressInterface::KEY_COUNTRY_ID => 'US',
AddressInterface::KEY_CITY => 'CityM',
AddressInterface::KEY_COMPANY => 'CompanyName',
diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/set_new_shipping_canada_address.php b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/set_new_shipping_canada_address.php
new file mode 100644
index 0000000000000..8e60dc904bd4e
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/GraphQl/Quote/_files/set_new_shipping_canada_address.php
@@ -0,0 +1,43 @@
+get(QuoteFactory::class);
+/** @var QuoteResource $quoteResource */
+$quoteResource = Bootstrap::getObjectManager()->get(QuoteResource::class);
+/** @var AddressInterfaceFactory $quoteAddressFactory */
+$quoteAddressFactory = Bootstrap::getObjectManager()->get(AddressInterfaceFactory::class);
+/** @var DataObjectHelper $dataObjectHelper */
+$dataObjectHelper = Bootstrap::getObjectManager()->get(DataObjectHelper::class);
+/** @var ShippingAddressManagementInterface $shippingAddressManagement */
+$shippingAddressManagement = Bootstrap::getObjectManager()->get(ShippingAddressManagementInterface::class);
+
+$quoteAddressData = [
+ AddressInterface::KEY_TELEPHONE => 3468676,
+ AddressInterface::KEY_POSTCODE => 'M4L 1V3',
+ AddressInterface::KEY_COUNTRY_ID => 'CA',
+ AddressInterface::KEY_CITY => 'Toronto',
+ AddressInterface::KEY_COMPANY => 'CompanyName',
+ AddressInterface::KEY_STREET => '500 Kingston Rd',
+ AddressInterface::KEY_LASTNAME => 'Smith',
+ AddressInterface::KEY_FIRSTNAME => 'John',
+ AddressInterface::KEY_REGION_CODE => 'ON',
+];
+$quoteAddress = $quoteAddressFactory->create();
+$dataObjectHelper->populateWithArray($quoteAddress, $quoteAddressData, AddressInterfaceFactory::class);
+
+$quote = $quoteFactory->create();
+$quoteResource->load($quote, 'test_quote', 'reserved_order_id');
+$shippingAddressManagement->assign($quote->getId(), $quoteAddress);
diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Tax/_files/tax_rule_for_region_1.php b/dev/tests/integration/testsuite/Magento/GraphQl/Tax/_files/tax_rule_for_region_1.php
new file mode 100644
index 0000000000000..aca55bd8414f6
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/GraphQl/Tax/_files/tax_rule_for_region_1.php
@@ -0,0 +1,53 @@
+get(DataObjectHelper::class);
+/** @var RateFactory $rateFactory */
+$rateFactory = $objectManager->get(RateFactory::class);
+/** @var RuleFactory $ruleFactory */
+$ruleFactory = $objectManager->get(RuleFactory::class);
+/** @var RateRepository $rateRepository */
+$rateRepository = $objectManager->get(TaxRateRepositoryInterface::class);
+/** @var TaxRuleRepository $ruleRepository */
+$ruleRepository = $objectManager->get(TaxRuleRepositoryInterface::class);
+/** @var Rate $rate */
+$rate = $rateFactory->create();
+$rateData = [
+ Rate::KEY_COUNTRY_ID => 'US',
+ Rate::KEY_REGION_ID => '1',
+ Rate::KEY_POSTCODE => '*',
+ Rate::KEY_CODE => 'US-TEST-*-Rate-1',
+ Rate::KEY_PERCENTAGE_RATE => '7.5',
+];
+$dataObjectHelper->populateWithArray($rate, $rateData, TaxRateInterface::class);
+$rateRepository->save($rate);
+
+$rule = $ruleFactory->create();
+$ruleData = [
+ Rule::KEY_CODE=> 'GraphQl Test Rule',
+ Rule::KEY_PRIORITY => '0',
+ Rule::KEY_POSITION => '0',
+ Rule::KEY_CUSTOMER_TAX_CLASS_IDS => [3],
+ Rule::KEY_PRODUCT_TAX_CLASS_IDS => [2],
+ Rule::KEY_TAX_RATE_IDS => [$rate->getId()],
+];
+$dataObjectHelper->populateWithArray($rule, $ruleData, TaxRuleInterface::class);
+$ruleRepository->save($rule);
diff --git a/dev/tests/integration/testsuite/Magento/GraphQl/Tax/_files/tax_rule_for_region_1_rollback.php b/dev/tests/integration/testsuite/Magento/GraphQl/Tax/_files/tax_rule_for_region_1_rollback.php
new file mode 100644
index 0000000000000..aba1960624ed4
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/GraphQl/Tax/_files/tax_rule_for_region_1_rollback.php
@@ -0,0 +1,38 @@
+get(RateFactory::class);
+/** @var RuleFactory $ruleFactory */
+$ruleFactory = $objectManager->get(RuleFactory::class);
+/** @var RateRepository $rateRepository */
+$rateRepository = $objectManager->get(TaxRateRepositoryInterface::class);
+/** @var TaxRuleRepository $ruleRepository */
+$ruleRepository = $objectManager->get(TaxRuleRepositoryInterface::class);
+/** @var RateResource $rateResource */
+$rateResource = $objectManager->get(RateResource::class);
+/** @var RuleResource $ruleResource */
+$ruleResource = $objectManager->get(RuleResource::class);
+
+$rate = $rateFactory->create();
+$rateResource->load($rate, 'US-TEST-*-Rate-1', Rate::KEY_CODE);
+$rule = $ruleFactory->create();
+$ruleResource->load($rule, 'GraphQl Test Rule', Rule::KEY_CODE);
+$ruleRepository->delete($rule);
+$rateRepository->delete($rate);
diff --git a/dev/tests/integration/testsuite/Magento/Ups/_files/enable_ups_shipping_method.php b/dev/tests/integration/testsuite/Magento/GraphQl/Ups/_files/enable_ups_shipping_method.php
similarity index 87%
rename from dev/tests/integration/testsuite/Magento/Ups/_files/enable_ups_shipping_method.php
rename to dev/tests/integration/testsuite/Magento/GraphQl/Ups/_files/enable_ups_shipping_method.php
index 5c6c60866fafb..ffdc215d50a68 100644
--- a/dev/tests/integration/testsuite/Magento/Ups/_files/enable_ups_shipping_method.php
+++ b/dev/tests/integration/testsuite/Magento/GraphQl/Ups/_files/enable_ups_shipping_method.php
@@ -3,6 +3,7 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+// TODO: Should be removed in scope of https://github.com/magento/graphql-ce/issues/167
declare(strict_types=1);
use Magento\Framework\App\Config\Storage\Writer;
diff --git a/dev/tests/integration/testsuite/Magento/Ups/_files/enable_ups_shipping_method_rollback.php b/dev/tests/integration/testsuite/Magento/GraphQl/Ups/_files/enable_ups_shipping_method_rollback.php
similarity index 84%
rename from dev/tests/integration/testsuite/Magento/Ups/_files/enable_ups_shipping_method_rollback.php
rename to dev/tests/integration/testsuite/Magento/GraphQl/Ups/_files/enable_ups_shipping_method_rollback.php
index 6d7894879f97b..243ec0217a0bb 100644
--- a/dev/tests/integration/testsuite/Magento/Ups/_files/enable_ups_shipping_method_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/GraphQl/Ups/_files/enable_ups_shipping_method_rollback.php
@@ -3,6 +3,7 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+// TODO: Should be removed in scope of https://github.com/magento/graphql-ce/issues/167
declare(strict_types=1);
use Magento\Framework\App\Config\Storage\Writer;
diff --git a/dev/tests/integration/testsuite/Magento/NewRelicReporting/Model/Module/CollectTest.php b/dev/tests/integration/testsuite/Magento/NewRelicReporting/Model/Module/CollectTest.php
new file mode 100644
index 0000000000000..5e5051163cc1f
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/NewRelicReporting/Model/Module/CollectTest.php
@@ -0,0 +1,38 @@
+collect = Bootstrap::getObjectManager()->create(Collect::class);
+ }
+
+ /**
+ * @return void
+ */
+ public function testReport()
+ {
+ $this->collect->getModuleData();
+ $moduleData = $this->collect->getModuleData();
+ $this->assertEmpty($moduleData['changes']);
+ }
+}
diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_list.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_list.php
index 1f4253f18487c..99122d72df4b7 100644
--- a/dev/tests/integration/testsuite/Magento/Sales/_files/order_list.php
+++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_list.php
@@ -9,6 +9,7 @@
use Magento\Sales\Model\Order\Address as OrderAddress;
use Magento\Sales\Model\Order\Payment;
+// phpcs:ignore Magento2.Security.IncludeFile
require 'order.php';
/** @var Order $order */
/** @var Order\Payment $payment */
@@ -24,8 +25,7 @@
'subtotal' => 120.00,
'base_grand_total' => 120.00,
'store_id' => 1,
- 'website_id' => 1,
- 'payment' => $payment
+ 'website_id' => 1
],
[
'increment_id' => '100000003',
@@ -35,8 +35,7 @@
'base_grand_total' => 140.00,
'subtotal' => 140.00,
'store_id' => 0,
- 'website_id' => 0,
- 'payment' => $payment
+ 'website_id' => 0
],
[
'increment_id' => '100000004',
@@ -46,8 +45,7 @@
'base_grand_total' => 140.00,
'subtotal' => 140.00,
'store_id' => 1,
- 'website_id' => 1,
- 'payment' => $payment
+ 'website_id' => 1
],
];
diff --git a/dev/tests/integration/testsuite/Magento/Tax/Model/Sales/Total/Quote/SetupUtil.php b/dev/tests/integration/testsuite/Magento/Tax/Model/Sales/Total/Quote/SetupUtil.php
index bd505fd4db035..985019b687ce0 100644
--- a/dev/tests/integration/testsuite/Magento/Tax/Model/Sales/Total/Quote/SetupUtil.php
+++ b/dev/tests/integration/testsuite/Magento/Tax/Model/Sales/Total/Quote/SetupUtil.php
@@ -7,10 +7,19 @@
namespace Magento\Tax\Model\Sales\Total\Quote;
use Magento\Framework\App\Config\ScopeConfigInterface;
+use Magento\Quote\Model\Quote;
use Magento\Tax\Model\Config;
use Magento\Tax\Model\Calculation;
+use Magento\Quote\Model\Quote\Item\Updater;
+use Magento\Catalog\Api\ProductRepositoryInterface;
+use Magento\Catalog\Api\Data\ProductInterface;
+use Magento\Framework\Api\Filter;
+use Magento\Framework\Api\Search\FilterGroup;
+use Magento\Framework\Api\SearchCriteriaInterface;
/**
+ * Setup utility for quote
+ *
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class SetupUtil
@@ -594,7 +603,7 @@ protected function createCartRule($ruleDataOverride)
*
* @param array $quoteData
* @param \Magento\Customer\Api\Data\CustomerInterface $customer
- * @return \Magento\Quote\Model\Quote
+ * @return Quote
*/
protected function createQuote($quoteData, $customer)
{
@@ -619,8 +628,8 @@ protected function createQuote($quoteData, $customer)
$quoteBillingAddress = $this->objectManager->create(\Magento\Quote\Model\Quote\Address::class);
$quoteBillingAddress->importCustomerAddressData($addressService->getById($billingAddress->getId()));
- /** @var \Magento\Quote\Model\Quote $quote */
- $quote = $this->objectManager->create(\Magento\Quote\Model\Quote::class);
+ /** @var Quote $quote */
+ $quote = $this->objectManager->create(Quote::class);
$quote->setStoreId(1)
->setIsActive(true)
->setIsMultiShipping(false)
@@ -634,7 +643,7 @@ protected function createQuote($quoteData, $customer)
/**
* Add products to quote
*
- * @param \Magento\Quote\Model\Quote $quote
+ * @param Quote $quote
* @param array $itemsData
* @return $this
*/
@@ -657,7 +666,8 @@ protected function addProductToQuote($quote, $itemsData)
* Create a quote based on given data
*
* @param array $quoteData
- * @return \Magento\Quote\Model\Quote
+ *
+ * @return Quote
*/
public function setupQuote($quoteData)
{
@@ -666,7 +676,9 @@ public function setupQuote($quoteData)
$quote = $this->createQuote($quoteData, $customer);
$this->addProductToQuote($quote, $quoteData['items']);
-
+ if (isset($quoteData['update_items'])) {
+ $this->updateItems($quote, $quoteData['update_items']);
+ }
//Set shipping amount
if (isset($quoteData['shipping_method'])) {
$quote->getShippingAddress()->setShippingMethod($quoteData['shipping_method']);
@@ -683,4 +695,33 @@ public function setupQuote($quoteData)
return $quote;
}
+
+ /**
+ * Update quote items
+ *
+ * @param Quote $quote
+ * @param array $items
+ *
+ * @return void
+ */
+ private function updateItems(Quote $quote, array $items): void
+ {
+ $updater = $this->objectManager->get(Updater::class);
+ $productRepository = $this->objectManager->get(ProductRepositoryInterface::class);
+ $filter = $this->objectManager->create(Filter::class);
+ $filter->setField('sku')->setValue(array_keys($items));
+ $filterGroup = $this->objectManager->create(FilterGroup::class);
+ $filterGroup->setFilters([$filter]);
+ $searchCriteria = $this->objectManager->create(SearchCriteriaInterface::class);
+ $searchCriteria->setFilterGroups([$filterGroup]);
+ $products = $productRepository->getList($searchCriteria)->getItems();
+ /** @var ProductInterface $product */
+ foreach ($products as $product) {
+ $quoteItem = $quote->getItemByProduct($product);
+ $updater->update(
+ $quoteItem,
+ $items[$product->getSku()]
+ );
+ }
+ }
}
diff --git a/dev/tests/integration/testsuite/Magento/Tax/_files/scenarios/including_tax_with_custom_price.php b/dev/tests/integration/testsuite/Magento/Tax/_files/scenarios/including_tax_with_custom_price.php
new file mode 100644
index 0000000000000..290c133f455f6
--- /dev/null
+++ b/dev/tests/integration/testsuite/Magento/Tax/_files/scenarios/including_tax_with_custom_price.php
@@ -0,0 +1,93 @@
+ [
+ SetupUtil::CONFIG_OVERRIDES => [
+ Config::CONFIG_XML_PATH_PRICE_INCLUDES_TAX => 1,
+ Config::CONFIG_XML_PATH_APPLY_ON => 0,
+ ],
+ SetupUtil::TAX_RATE_OVERRIDES => [
+ SetupUtil::TAX_RATE_TX => 8.25,
+ SetupUtil::TAX_STORE_RATE => 8.25,
+ ],
+ SetupUtil::TAX_RULE_OVERRIDES => [
+ ],
+ ],
+ 'quote_data' => [
+ 'billing_address' => [
+ 'region_id' => SetupUtil::REGION_TX,
+ ],
+ 'shipping_address' => [
+ 'region_id' => SetupUtil::REGION_TX,
+ ],
+ 'items' => [
+ [
+ 'sku' => 'simple1',
+ 'price' => 16.24,
+ 'qty' => 1,
+ ],
+ ],
+ 'update_items' => [
+ 'simple1' => [
+ 'custom_price' => 14,
+ 'qty' => 1,
+ ],
+ ],
+ ],
+ 'expected_results' => [
+ 'address_data' => [
+ 'subtotal' => 12.93,
+ 'base_subtotal' => 12.93,
+ 'subtotal_incl_tax' => 14,
+ 'base_subtotal_incl_tax' => 14,
+ 'tax_amount' => 1.07,
+ 'base_tax_amount' => 1.07,
+ 'shipping_amount' => 0,
+ 'base_shipping_amount' => 0,
+ 'shipping_incl_tax' => 0,
+ 'base_shipping_incl_tax' => 0,
+ 'shipping_taxable' => 0,
+ 'base_shipping_taxable' => 0,
+ 'shipping_tax_amount' => 0,
+ 'base_shipping_tax_amount' => 0,
+ 'discount_amount' => 0,
+ 'base_discount_amount' => 0,
+ 'discount_tax_compensation_amount' => 0,
+ 'base_discount_tax_compensation_amount' => 0,
+ 'shipping_discount_tax_compensation_amount' => 0,
+ 'base_shipping_discount_tax_compensation_amount' => 0,
+ 'grand_total' => 14,
+ 'base_grand_total' => 14,
+ ],
+ 'items_data' => [
+ 'simple1' => [
+ 'row_total' => 12.93,
+ 'base_row_total' => 12.93,
+ 'tax_percent' => 8.25,
+ 'price' => 12.93,
+ 'custom_price' => 12.93,
+ 'original_custom_price' => 14,
+ 'base_price' => 12.93,
+ 'price_incl_tax' => 14,
+ 'base_price_incl_tax' => 14,
+ 'row_total_incl_tax' => 14,
+ 'base_row_total_incl_tax' => 14,
+ 'tax_amount' => 1.07,
+ 'base_tax_amount' => 1.07,
+ 'discount_amount' => 0,
+ 'base_discount_amount' => 0,
+ 'discount_percent' => 0,
+ 'discount_tax_compensation_amount' => 0,
+ 'base_discount_tax_compensation_amount' => 0,
+ ],
+ ],
+ ],
+];
diff --git a/dev/tests/integration/testsuite/Magento/Tax/_files/tax_calculation_data_aggregated.php b/dev/tests/integration/testsuite/Magento/Tax/_files/tax_calculation_data_aggregated.php
index f22b48a259685..3c56b1bf815a6 100644
--- a/dev/tests/integration/testsuite/Magento/Tax/_files/tax_calculation_data_aggregated.php
+++ b/dev/tests/integration/testsuite/Magento/Tax/_files/tax_calculation_data_aggregated.php
@@ -3,14 +3,15 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+declare(strict_types=1);
/**
- * Global array that holds test scenarios data
+ * Global array that holds test scenarios data.
*
* @var array
*/
$taxCalculationData = [];
-
+//phpcs:disable Magento2.Security.IncludeFile
require_once __DIR__ . '/scenarios/excluding_tax_apply_tax_after_discount.php';
require_once __DIR__ . '/scenarios/excluding_tax_apply_tax_after_discount_discount_tax.php';
require_once __DIR__ . '/scenarios/excluding_tax_apply_tax_before_discount.php';
@@ -31,3 +32,4 @@
require_once __DIR__ . '/scenarios/multi_tax_rule_two_row_calculate_subtotal_yes_row.php';
require_once __DIR__ . '/scenarios/multi_tax_rule_two_row_calculate_subtotal_yes_total.php';
require_once __DIR__ . '/scenarios/including_tax_apply_tax_after_discount.php';
+require_once __DIR__ . '/scenarios/including_tax_with_custom_price.php';
diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Braintree/frontend/js/view/payment/method-renderer/cc-form.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Braintree/frontend/js/view/payment/method-renderer/cc-form.test.js
index 8fdef2cbaadbb..429342b43bcb2 100644
--- a/dev/tests/js/jasmine/tests/app/code/Magento/Braintree/frontend/js/view/payment/method-renderer/cc-form.test.js
+++ b/dev/tests/js/jasmine/tests/app/code/Magento/Braintree/frontend/js/view/payment/method-renderer/cc-form.test.js
@@ -15,6 +15,18 @@ define([
describe('Magento_Braintree/js/view/payment/method-renderer/cc-form', function () {
var injector = new Squire(),
mocks = {
+ 'Magento_Checkout/js/model/checkout-data-resolver': {
+
+ /** Stub */
+ applyBillingAddress: function () {
+ return true;
+ },
+
+ /** Stub */
+ resolveBillingAddress: function () {
+ return true;
+ }
+ },
'Magento_Checkout/js/model/quote': {
billingAddress: ko.observable(),
shippingAddress: ko.observable(),
diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Braintree/frontend/js/view/payment/method-renderer/paypal.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Braintree/frontend/js/view/payment/method-renderer/paypal.test.js
index 4fc73caf7e14b..6ba0ed0b58f03 100644
--- a/dev/tests/js/jasmine/tests/app/code/Magento/Braintree/frontend/js/view/payment/method-renderer/paypal.test.js
+++ b/dev/tests/js/jasmine/tests/app/code/Magento/Braintree/frontend/js/view/payment/method-renderer/paypal.test.js
@@ -14,6 +14,18 @@ define([
var injector = new Squire(),
mocks = {
+ 'Magento_Checkout/js/model/checkout-data-resolver': {
+
+ /** Stub */
+ applyBillingAddress: function () {
+ return true;
+ },
+
+ /** Stub */
+ resolveBillingAddress: function () {
+ return true;
+ }
+ },
'Magento_Checkout/js/model/quote': {
billingAddress: ko.observable(),
shippingAddress: ko.observable({
diff --git a/dev/tests/js/jasmine/tests/app/code/Magento/Paypal/frontend/js/view/payment/method-renderer/paypal-express-abstract.test.js b/dev/tests/js/jasmine/tests/app/code/Magento/Paypal/frontend/js/view/payment/method-renderer/paypal-express-abstract.test.js
index 29a2e8db914a7..7bc9a2a0113aa 100644
--- a/dev/tests/js/jasmine/tests/app/code/Magento/Paypal/frontend/js/view/payment/method-renderer/paypal-express-abstract.test.js
+++ b/dev/tests/js/jasmine/tests/app/code/Magento/Paypal/frontend/js/view/payment/method-renderer/paypal-express-abstract.test.js
@@ -24,6 +24,18 @@ define([
return true;
}).and.callThrough(),
mocks = {
+ 'Magento_Checkout/js/model/checkout-data-resolver': {
+
+ /** Stub */
+ applyBillingAddress: function () {
+ return true;
+ },
+
+ /** Stub */
+ resolveBillingAddress: function () {
+ return true;
+ }
+ },
'Magento_Checkout/js/model/quote': {
billingAddress: ko.observable(),
shippingAddress: ko.observable(),
diff --git a/lib/internal/Magento/Framework/App/DocRootLocator.php b/lib/internal/Magento/Framework/App/DocRootLocator.php
index 6fb35c42f1330..d73baf8e4e742 100644
--- a/lib/internal/Magento/Framework/App/DocRootLocator.php
+++ b/lib/internal/Magento/Framework/App/DocRootLocator.php
@@ -3,10 +3,12 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+declare(strict_types=1);
namespace Magento\Framework\App;
use Magento\Framework\App\Filesystem\DirectoryList;
+use Magento\Framework\Filesystem;
use Magento\Framework\Filesystem\Directory\ReadFactory;
/**
@@ -20,18 +22,26 @@ class DocRootLocator
private $request;
/**
+ * @deprecated
* @var ReadFactory
*/
private $readFactory;
+ /**
+ * @var Filesystem
+ */
+ private $filesystem;
+
/**
* @param RequestInterface $request
* @param ReadFactory $readFactory
+ * @param Filesystem|null $filesystem
*/
- public function __construct(RequestInterface $request, ReadFactory $readFactory)
+ public function __construct(RequestInterface $request, ReadFactory $readFactory, Filesystem $filesystem = null)
{
$this->request = $request;
$this->readFactory = $readFactory;
+ $this->filesystem = $filesystem ?: ObjectManager::getInstance()->get(Filesystem::class);
}
/**
@@ -42,7 +52,8 @@ public function __construct(RequestInterface $request, ReadFactory $readFactory)
public function isPub()
{
$rootBasePath = $this->request->getServer('DOCUMENT_ROOT');
- $readDirectory = $this->readFactory->create(DirectoryList::ROOT);
- return (substr($rootBasePath, -strlen('/pub')) === '/pub') && !$readDirectory->isExist($rootBasePath . 'setup');
+ $readDirectory = $this->filesystem->getDirectoryRead(DirectoryList::ROOT);
+
+ return (substr($rootBasePath, -\strlen('/pub')) === '/pub') && ! $readDirectory->isExist('setup');
}
}
diff --git a/lib/internal/Magento/Framework/App/Test/Unit/DocRootLocatorTest.php b/lib/internal/Magento/Framework/App/Test/Unit/DocRootLocatorTest.php
index 23afbbc73d2b9..ef4152ba2e49e 100644
--- a/lib/internal/Magento/Framework/App/Test/Unit/DocRootLocatorTest.php
+++ b/lib/internal/Magento/Framework/App/Test/Unit/DocRootLocatorTest.php
@@ -8,6 +8,9 @@
use Magento\Framework\App\DocRootLocator;
+/**
+ * Test for Magento\Framework\App\DocRootLocator class.
+ */
class DocRootLocatorTest extends \PHPUnit\Framework\TestCase
{
/**
@@ -21,11 +24,15 @@ public function testIsPub($path, $isExist, $result)
{
$request = $this->createMock(\Magento\Framework\App\Request\Http::class);
$request->expects($this->once())->method('getServer')->willReturn($path);
+
+ $readFactory = $this->createMock(\Magento\Framework\Filesystem\Directory\ReadFactory::class);
+
$reader = $this->createMock(\Magento\Framework\Filesystem\Directory\Read::class);
+ $filesystem = $this->createMock(\Magento\Framework\Filesystem::class);
+ $filesystem->expects($this->once())->method('getDirectoryRead')->willReturn($reader);
$reader->expects($this->any())->method('isExist')->willReturn($isExist);
- $readFactory = $this->createMock(\Magento\Framework\Filesystem\Directory\ReadFactory::class);
- $readFactory->expects($this->once())->method('create')->willReturn($reader);
- $model = new DocRootLocator($request, $readFactory);
+
+ $model = new DocRootLocator($request, $readFactory, $filesystem);
$this->assertSame($result, $model->isPub());
}
diff --git a/lib/internal/Magento/Framework/Code/Generator.php b/lib/internal/Magento/Framework/Code/Generator.php
index 4dec7d1a28146..b46c8c681bb52 100644
--- a/lib/internal/Magento/Framework/Code/Generator.php
+++ b/lib/internal/Magento/Framework/Code/Generator.php
@@ -8,11 +8,15 @@
use Magento\Framework\Code\Generator\DefinedClasses;
use Magento\Framework\Code\Generator\EntityAbstract;
use Magento\Framework\Code\Generator\Io;
+use Magento\Framework\ObjectManager\ConfigInterface;
use Magento\Framework\ObjectManagerInterface;
use Magento\Framework\Phrase;
use Magento\Framework\Filesystem\Driver\File;
use Psr\Log\LoggerInterface;
+/**
+ * Class code generator.
+ */
class Generator
{
const GENERATION_SUCCESS = 'success';
@@ -232,7 +236,21 @@ protected function shouldSkipGeneration($resultEntityType, $sourceClassName, $re
{
if (!$resultEntityType || !$sourceClassName) {
return self::GENERATION_ERROR;
- } elseif ($this->definedClasses->isClassLoadableFromDisk($resultClass)) {
+ }
+
+ /** @var ConfigInterface $omConfig */
+ $omConfig = $this->objectManager->get(ConfigInterface::class);
+ $virtualTypes = $omConfig->getVirtualTypes();
+
+ /**
+ * Do not try to autogenerate virtual types
+ * For example virtual types with names overlapping autogenerated suffixes
+ */
+ if (isset($virtualTypes[$resultClass])) {
+ return self::GENERATION_SKIP;
+ }
+
+ if ($this->definedClasses->isClassLoadableFromDisk($resultClass)) {
$generatedFileName = $this->_ioObject->generateResultFileName($resultClass);
/**
* Must handle two edge cases: a competing process has generated the class and written it to disc already,
@@ -244,9 +262,12 @@ protected function shouldSkipGeneration($resultEntityType, $sourceClassName, $re
$this->_ioObject->includeFile($generatedFileName);
}
return self::GENERATION_SKIP;
- } elseif (!isset($this->_generatedEntities[$resultEntityType])) {
+ }
+
+ if (!isset($this->_generatedEntities[$resultEntityType])) {
throw new \InvalidArgumentException('Unknown generation entity.');
}
+
return false;
}
}
diff --git a/lib/internal/Magento/Framework/Code/Test/Unit/GeneratorTest.php b/lib/internal/Magento/Framework/Code/Test/Unit/GeneratorTest.php
index 9cc93f7620b1f..2753561683385 100644
--- a/lib/internal/Magento/Framework/Code/Test/Unit/GeneratorTest.php
+++ b/lib/internal/Magento/Framework/Code/Test/Unit/GeneratorTest.php
@@ -3,11 +3,15 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
+declare(strict_types=1);
+
namespace Magento\Framework\Code\Test\Unit;
use Magento\Framework\Code\Generator;
use Magento\Framework\Code\Generator\DefinedClasses;
use Magento\Framework\Code\Generator\Io;
+use Magento\Framework\ObjectManager\ConfigInterface;
+use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;
use Magento\Framework\ObjectManager\Code\Generator\Factory;
use Magento\Framework\ObjectManager\Code\Generator\Proxy;
@@ -17,13 +21,19 @@
use Magento\Framework\ObjectManagerInterface;
use Magento\Framework\Code\Generator\EntityAbstract;
use Magento\GeneratedClass\Factory as GeneratedClassFactory;
+use RuntimeException;
+/**
+ * Tests for code generator.
+ *
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
+ */
class GeneratorTest extends TestCase
{
/**
* Class name parameter value
*/
- const SOURCE_CLASS = 'testClassName';
+ private const SOURCE_CLASS = 'testClassName';
/**
* Expected generated entities
@@ -58,6 +68,19 @@ class GeneratorTest extends TestCase
*/
private $loggerMock;
+ /**
+ * @var ObjectManagerInterface|MockObject
+ */
+ private $objectManagerMock;
+
+ /**
+ * @var ConfigInterface|MockObject
+ */
+ private $objectManagerConfigMock;
+
+ /**
+ * @inheritDoc
+ */
protected function setUp()
{
$this->definedClassesMock = $this->createMock(DefinedClasses::class);
@@ -65,6 +88,12 @@ protected function setUp()
->disableOriginalConstructor()
->getMock();
$this->loggerMock = $this->getMockForAbstractClass(LoggerInterface::class);
+ $this->objectManagerMock = $this->getMockBuilder(ObjectManagerInterface::class)
+ ->disableOriginalConstructor()
+ ->getMock();
+ $this->objectManagerConfigMock = $this->getMockBuilder(ConfigInterface::class)
+ ->disableOriginalConstructor()
+ ->getMock();
$this->model = new Generator(
$this->ioObjectMock,
@@ -78,7 +107,7 @@ protected function setUp()
);
}
- public function testGetGeneratedEntities()
+ public function testGetGeneratedEntities(): void
{
$this->model = new Generator(
$this->ioObjectMock,
@@ -91,22 +120,58 @@ public function testGetGeneratedEntities()
/**
* @param string $className
* @param string $entityType
- * @expectedException \RuntimeException
+ * @expectedException RuntimeException
* @dataProvider generateValidClassDataProvider
*/
- public function testGenerateClass($className, $entityType)
+ public function testGenerateClass($className, $entityType): void
{
- $objectManagerMock = $this->createMock(ObjectManagerInterface::class);
$fullClassName = $className . $entityType;
+
$entityGeneratorMock = $this->getMockBuilder(EntityAbstract::class)
->disableOriginalConstructor()
->getMock();
- $objectManagerMock->expects($this->once())->method('create')->willReturn($entityGeneratorMock);
- $this->model->setObjectManager($objectManagerMock);
- $this->model->generateClass($fullClassName);
+ $this->objectManagerMock
+ ->expects($this->once())
+ ->method('create')
+ ->willReturn($entityGeneratorMock);
+
+ $this->objectManagerConfigMock
+ ->expects($this->once())
+ ->method('getVirtualTypes')
+ ->willReturn([]);
+ $this->objectManagerMock
+ ->expects($this->once())
+ ->method('get')
+ ->with(ConfigInterface::class)
+ ->willReturn($this->objectManagerConfigMock);
+ $this->model->setObjectManager($this->objectManagerMock);
+
+ $this->assertSame(
+ Generator::GENERATION_SUCCESS,
+ $this->model->generateClass($fullClassName)
+ );
}
- public function testGenerateClassWithWrongName()
+ public function testShouldNotGenerateVirtualType(): void
+ {
+ $this->objectManagerConfigMock
+ ->expects($this->once())
+ ->method('getVirtualTypes')
+ ->willReturn([GeneratedClassFactory::class => GeneratedClassFactory::class]);
+ $this->objectManagerMock
+ ->expects($this->once())
+ ->method('get')
+ ->with(ConfigInterface::class)
+ ->willReturn($this->objectManagerConfigMock);
+ $this->model->setObjectManager($this->objectManagerMock);
+
+ $this->assertSame(
+ Generator::GENERATION_SKIP,
+ $this->model->generateClass(GeneratedClassFactory::class)
+ );
+ }
+
+ public function testGenerateClassWithWrongName(): void
{
$this->assertEquals(
Generator::GENERATION_ERROR,
@@ -115,25 +180,42 @@ public function testGenerateClassWithWrongName()
}
/**
- * @expectedException \RuntimeException
+ * @expectedException RuntimeException
*/
- public function testGenerateClassWhenClassIsNotGenerationSuccess()
+ public function testGenerateClassWhenClassIsNotGenerationSuccess(): void
{
$expectedEntities = array_values($this->expectedEntities);
$resultClassName = self::SOURCE_CLASS . ucfirst(array_shift($expectedEntities));
- $objectManagerMock = $this->createMock(ObjectManagerInterface::class);
+
$entityGeneratorMock = $this->getMockBuilder(EntityAbstract::class)
->disableOriginalConstructor()
->getMock();
- $objectManagerMock->expects($this->once())->method('create')->willReturn($entityGeneratorMock);
- $this->model->setObjectManager($objectManagerMock);
- $this->model->generateClass($resultClassName);
+ $this->objectManagerMock
+ ->expects($this->once())
+ ->method('create')
+ ->willReturn($entityGeneratorMock);
+
+ $this->objectManagerConfigMock
+ ->expects($this->once())
+ ->method('getVirtualTypes')
+ ->willReturn([]);
+ $this->objectManagerMock
+ ->expects($this->once())
+ ->method('get')
+ ->with(ConfigInterface::class)
+ ->willReturn($this->objectManagerConfigMock);
+ $this->model->setObjectManager($this->objectManagerMock);
+
+ $this->assertSame(
+ Generator::GENERATION_SUCCESS,
+ $this->model->generateClass($resultClassName)
+ );
}
/**
* @inheritdoc
*/
- public function testGenerateClassWithErrors()
+ public function testGenerateClassWithErrors(): void
{
$expectedEntities = array_values($this->expectedEntities);
$resultClassName = self::SOURCE_CLASS . ucfirst(array_shift($expectedEntities));
@@ -148,17 +230,15 @@ public function testGenerateClassWithErrors()
. 'directory permission is set to write --- the requested class did not generate properly, then '
. 'you must add the generated class object to the signature of the related construct method, only.';
$FinalErrorMessage = implode(PHP_EOL, $errorMessages) . "\n" . $mainErrorMessage;
- $this->expectException(\RuntimeException::class);
+ $this->expectException(RuntimeException::class);
$this->expectExceptionMessage($FinalErrorMessage);
- /** @var ObjectManagerInterface|Mock $objectManagerMock */
- $objectManagerMock = $this->createMock(ObjectManagerInterface::class);
/** @var EntityAbstract|Mock $entityGeneratorMock */
$entityGeneratorMock = $this->getMockBuilder(EntityAbstract::class)
->disableOriginalConstructor()
->getMock();
- $objectManagerMock->expects($this->once())
+ $this->objectManagerMock->expects($this->once())
->method('create')
->willReturn($entityGeneratorMock);
$entityGeneratorMock->expects($this->once())
@@ -177,26 +257,62 @@ public function testGenerateClassWithErrors()
$this->loggerMock->expects($this->once())
->method('critical')
->with($FinalErrorMessage);
- $this->model->setObjectManager($objectManagerMock);
- $this->model->generateClass($resultClassName);
+
+ $this->objectManagerConfigMock
+ ->expects($this->once())
+ ->method('getVirtualTypes')
+ ->willReturn([]);
+ $this->objectManagerMock
+ ->expects($this->once())
+ ->method('get')
+ ->with(ConfigInterface::class)
+ ->willReturn($this->objectManagerConfigMock);
+ $this->model->setObjectManager($this->objectManagerMock);
+
+ $this->assertSame(
+ Generator::GENERATION_SUCCESS,
+ $this->model->generateClass($resultClassName)
+ );
}
/**
* @dataProvider trueFalseDataProvider
+ * @param $fileExists
*/
- public function testGenerateClassWithExistName($fileExists)
+ public function testGenerateClassWithExistName($fileExists): void
{
$this->definedClassesMock->expects($this->any())
->method('isClassLoadableFromDisk')
->willReturn(true);
$resultClassFileName = '/Magento/Path/To/Class.php';
- $this->ioObjectMock->expects($this->once())->method('generateResultFileName')->willReturn($resultClassFileName);
- $this->ioObjectMock->expects($this->once())->method('fileExists')->willReturn($fileExists);
+
+ $this->objectManagerConfigMock
+ ->expects($this->once())
+ ->method('getVirtualTypes')
+ ->willReturn([]);
+ $this->objectManagerMock
+ ->expects($this->once())
+ ->method('get')
+ ->with(ConfigInterface::class)
+ ->willReturn($this->objectManagerConfigMock);
+ $this->model->setObjectManager($this->objectManagerMock);
+
+ $this->ioObjectMock
+ ->expects($this->once())
+ ->method('generateResultFileName')
+ ->willReturn($resultClassFileName);
+ $this->ioObjectMock
+ ->expects($this->once())
+ ->method('fileExists')
+ ->willReturn($fileExists);
+
$includeFileInvokeCount = $fileExists ? 1 : 0;
- $this->ioObjectMock->expects($this->exactly($includeFileInvokeCount))->method('includeFile');
+ $this->ioObjectMock
+ ->expects($this->exactly($includeFileInvokeCount))
+ ->method('includeFile');
- $this->assertEquals(
+ $this->assertSame(
Generator::GENERATION_SKIP,
$this->model->generateClass(GeneratedClassFactory::class)
);
@@ -205,7 +321,7 @@ public function testGenerateClassWithExistName($fileExists)
/**
* @return array
*/
- public function trueFalseDataProvider()
+ public function trueFalseDataProvider(): array
{
return [[true], [false]];
}
@@ -215,7 +331,7 @@ public function trueFalseDataProvider()
*
* @return array
*/
- public function generateValidClassDataProvider()
+ public function generateValidClassDataProvider(): array
{
$data = [];
foreach ($this->expectedEntities as $generatedEntity) {
diff --git a/lib/internal/Magento/Framework/Data/Form/Element/Date.php b/lib/internal/Magento/Framework/Data/Form/Element/Date.php
index 897617e560be5..6e4e97dbac79d 100644
--- a/lib/internal/Magento/Framework/Data/Form/Element/Date.php
+++ b/lib/internal/Magento/Framework/Data/Form/Element/Date.php
@@ -53,6 +53,19 @@ public function __construct(
}
}
+ /**
+ * Check if a string is a date value
+ *
+ * @param string $value
+ * @return bool
+ */
+ private function isDate(string $value): bool
+ {
+ $date = date_parse($value);
+
+ return !empty($date['year']) && !empty($date['month']) && !empty($date['day']);
+ }
+
/**
* If script executes on x64 system, converts large numeric values to timestamp limit
*
@@ -85,13 +98,13 @@ public function setValue($value)
$this->_value = $value;
return $this;
}
-
try {
if (preg_match('/^[0-9]+$/', $value)) {
$this->_value = (new \DateTime())->setTimestamp($this->_toTimestamp($value));
+ } elseif (is_string($value) && $this->isDate($value)) {
+ $this->_value = new \DateTime($value, new \DateTimeZone($this->localeDate->getConfigTimezone()));
} else {
- $this->_value = new \DateTime($value);
- $this->_value->setTimezone(new \DateTimeZone($this->localeDate->getConfigTimezone()));
+ $this->_value = '';
}
} catch (\Exception $e) {
$this->_value = '';
diff --git a/lib/internal/Magento/Framework/Setup/Test/Unit/Patch/PatchApplierTest.php b/lib/internal/Magento/Framework/Setup/Test/Unit/Patch/PatchApplierTest.php
index f89bdc9e137dd..cb40845bcc488 100644
--- a/lib/internal/Magento/Framework/Setup/Test/Unit/Patch/PatchApplierTest.php
+++ b/lib/internal/Magento/Framework/Setup/Test/Unit/Patch/PatchApplierTest.php
@@ -91,7 +91,7 @@ class PatchApplierTest extends \PHPUnit\Framework\TestCase
/**
* @var PatchBackwardCompatability |\PHPUnit_Framework_MockObject_MockObject
*/
- private $patchBacwardCompatability;
+ private $patchBackwardCompatability;
protected function setUp()
{
@@ -109,7 +109,7 @@ protected function setUp()
$this->moduleDataSetupMock->expects($this->any())->method('getConnection')->willReturn($this->connectionMock);
$objectManager = new ObjectManager($this);
- $this->patchBacwardCompatability = $objectManager->getObject(
+ $this->patchBackwardCompatability = $objectManager->getObject(
PatchBackwardCompatability::class,
[
'moduleResource' => $this->moduleResourceMock
@@ -128,7 +128,7 @@ protected function setUp()
'objectManager' => $this->objectManagerMock,
'schemaSetup' => $this->schemaSetupMock,
'moduleDataSetup' => $this->moduleDataSetupMock,
- 'patchBackwardCompatability' => $this->patchBacwardCompatability
+ 'patchBackwardCompatability' => $this->patchBackwardCompatability
]
);
require_once __DIR__ . '/../_files/data_patch_classes.php';
diff --git a/lib/internal/Magento/Framework/Validator/Factory.php b/lib/internal/Magento/Framework/Validator/Factory.php
index 87c29dd6681c3..2a296f7cdcb24 100644
--- a/lib/internal/Magento/Framework/Validator/Factory.php
+++ b/lib/internal/Magento/Framework/Validator/Factory.php
@@ -52,6 +52,7 @@ class Factory
* @param ObjectManagerInterface $objectManager
* @param Reader $moduleReader
* @param FrontendInterface $cache @deprecated
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function __construct(
ObjectManagerInterface $objectManager,
diff --git a/lib/web/mage/validation.js b/lib/web/mage/validation.js
index a57191fd4aff4..73c5ef4d4f02f 100644
--- a/lib/web/mage/validation.js
+++ b/lib/web/mage/validation.js
@@ -1958,7 +1958,7 @@
}
if (firstActive.length) {
- $('html, body').animate({
+ $('html, body').stop().animate({
scrollTop: firstActive.offset().top
});
firstActive.focus();
diff --git a/setup/performance-toolkit/benchmark.jmx b/setup/performance-toolkit/benchmark.jmx
index 7207dd53be92d..696b1964101a5 100644
--- a/setup/performance-toolkit/benchmark.jmx
+++ b/setup/performance-toolkit/benchmark.jmx
@@ -39225,7 +39225,7 @@ if (name == null) {
mpaf/tool/fragments/_system/thread_group.jmx
-
+
1
false
1
@@ -39250,7 +39250,7 @@ if (testLabel
- vars.put("testLabel", "Get List of Products by category_id");
+ vars.put("testLabel", "GraphQL Get List of Products by category_id");
true
@@ -39347,7 +39347,7 @@ vars.putObject("category", categories[number]);
-
+
1
false
1
@@ -39372,7 +39372,7 @@ if (testLabel
- vars.put("testLabel", "Get Simple Product Details by product_url_key");
+ vars.put("testLabel", "GraphQL Get Simple Product Details by product_url_key");
true
@@ -39471,7 +39471,7 @@ vars.put("product_sku", product.get("sku"));
-
+
1
false
1
@@ -39496,7 +39496,7 @@ if (testLabel
- vars.put("testLabel", "Get Simple Product Details by name");
+ vars.put("testLabel", "GraphQL Get Simple Product Details by name");
true
@@ -39595,7 +39595,7 @@ vars.put("product_sku", product.get("sku"));
-
+
1
false
1
@@ -39620,7 +39620,7 @@ if (testLabel
- vars.put("testLabel", "Get Configurable Product Detail by product_url_key");
+ vars.put("testLabel", "GraphQL Get Configurable Product Detail by product_url_key");
true
@@ -39719,7 +39719,7 @@ vars.put("product_sku", product.get("sku"));
-
+
1
false
1
@@ -39744,7 +39744,7 @@ if (testLabel
- vars.put("testLabel", "Get Configurable Product Detail by name");
+ vars.put("testLabel", "GraphQL Get Configurable Product Detail by name");
true
@@ -39843,7 +39843,7 @@ vars.put("product_sku", product.get("sku"));
-
+
1
false
1
@@ -39868,7 +39868,7 @@ if (testLabel
- vars.put("testLabel", "Get Product Search by text and category_id");
+ vars.put("testLabel", "GraphQL Get Product Search by text and category_id");
true
@@ -39986,7 +39986,7 @@ if (totalCount == null) {
-
+
1
false
1
@@ -40011,7 +40011,7 @@ if (testLabel
- vars.put("testLabel", "Get Category List by category_id");
+ vars.put("testLabel", "GraphQL Get Category List by category_id");
true
@@ -40134,7 +40134,7 @@ function assertCategoryChildren(category, response) {
-
+
1
false
1
@@ -40159,7 +40159,7 @@ if (testLabel
- vars.put("testLabel", "Get Url Info by url_key");
+ vars.put("testLabel", "GraphQL Get Url Info by url_key");
true
@@ -40257,7 +40257,7 @@ vars.putObject("category", categories[number]);
-
+
1
false
1
@@ -40282,7 +40282,7 @@ if (testLabel
- vars.put("testLabel", "Get Cms Page by id");
+ vars.put("testLabel", "GraphQL Get Cms Page by id");
true
@@ -40377,7 +40377,7 @@ vars.put("cms_page_id", cmsPages[number].id);
-
+
1
false
1
@@ -40402,7 +40402,7 @@ if (testLabel
- vars.put("testLabel", "Get Navigation Menu by category_id");
+ vars.put("testLabel", "GraphQL Get Navigation Menu by category_id");
true
@@ -40499,7 +40499,7 @@ vars.putObject("category", categories[number]);
-
+
1
false
1
@@ -40524,7 +40524,7 @@ if (testLabel
- vars.put("testLabel", "Create Empty Cart");
+ vars.put("testLabel", "GraphQL Create Empty Cart");
true
@@ -40611,7 +40611,7 @@ vars.putObject("randomIntGenerator", random);
-
+
1
false
1
@@ -40636,7 +40636,7 @@ if (testLabel
- vars.put("testLabel", "Get Empty Cart");
+ vars.put("testLabel", "GraphQL Get Empty Cart");
true
@@ -40762,7 +40762,7 @@ vars.putObject("randomIntGenerator", random);
-
+
1
false
1
@@ -40787,7 +40787,7 @@ if (testLabel
- vars.put("testLabel", "Set Shipping Address On Cart");
+ vars.put("testLabel", "GraphQL Set Shipping Address On Cart");
true
@@ -40952,7 +40952,7 @@ vars.putObject("randomIntGenerator", random);
-
+
1
false
1
@@ -40977,7 +40977,7 @@ if (testLabel
- vars.put("testLabel", "Set Billing Address On Cart");
+ vars.put("testLabel", "GraphQL Set Billing Address On Cart");
true
@@ -41142,7 +41142,7 @@ vars.putObject("randomIntGenerator", random);
-
+
1
false
1
@@ -41167,7 +41167,7 @@ if (testLabel
- vars.put("testLabel", "Add Simple Product To Cart");
+ vars.put("testLabel", "GraphQL Add Simple Product To Cart");
true
@@ -41314,7 +41314,7 @@ vars.put("product_sku", product.get("sku"));
-
+
1
false
1
@@ -41339,7 +41339,7 @@ if (testLabel
- vars.put("testLabel", "Add Configurable Product To Cart");
+ vars.put("testLabel", "GraphQL Add Configurable Product To Cart");
true
@@ -41534,7 +41534,7 @@ vars.put("product_sku", product.get("sku"));
-
+
1
false
1
@@ -41559,7 +41559,7 @@ if (testLabel
- vars.put("testLabel", "Update Simple Product Qty In Cart");
+ vars.put("testLabel", "GraphQL Update Simple Product Qty In Cart");
true
@@ -41792,7 +41792,7 @@ vars.put("product_sku", product.get("sku"));
-
+
1
false
1
@@ -41817,7 +41817,7 @@ if (testLabel
- vars.put("testLabel", "Update Configurable Product Qty In Cart");
+ vars.put("testLabel", "GraphQL Update Configurable Product Qty In Cart");
true
@@ -42098,7 +42098,7 @@ vars.put("product_sku", product.get("sku"));
-
+
1
false
1
@@ -42123,7 +42123,7 @@ if (testLabel
- vars.put("testLabel", "Remove Simple Product From Cart");
+ vars.put("testLabel", "GraphQL Remove Simple Product From Cart");
true
@@ -42356,7 +42356,7 @@ vars.put("product_sku", product.get("sku"));
-
+
1
false
1
@@ -42381,7 +42381,7 @@ if (testLabel
- vars.put("testLabel", "Remove Configurable Product From Cart");
+ vars.put("testLabel", "GraphQL Remove Configurable Product From Cart");
true
@@ -42662,7 +42662,7 @@ vars.put("product_sku", product.get("sku"));
-
+
1
false
1
@@ -42687,7 +42687,7 @@ if (testLabel
- vars.put("testLabel", "Checkout By Guest");
+ vars.put("testLabel", "GraphQL Checkout By Guest");
true