-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '2.4-develop' into Refactoring-AdminCreateSimpleProductZ…
…eroPriceTest
- Loading branch information
Showing
217 changed files
with
6,668 additions
and
46,254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
324 changes: 117 additions & 207 deletions
324
app/code/Magento/Backend/view/adminhtml/templates/store/switcher.phtml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127 changes: 127 additions & 0 deletions
127
app/code/Magento/Backend/view/adminhtml/web/js/store-switcher.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
define([ | ||
'jquery' | ||
], function ($) { | ||
'use strict'; | ||
|
||
/** | ||
* @param {Object} storeSwitchConfig | ||
*/ | ||
return function (storeSwitchConfig) { | ||
var scopeSwitcherHandler; | ||
|
||
(function () { | ||
var storesList = $('[data-role=stores-list]'); | ||
|
||
storesList.on('click', '[data-value]', function (event) { | ||
var val = $(event.target).data('value'), | ||
role = $(event.target).data('role'), | ||
switcher = $('[data-role=' + role + ']'); | ||
|
||
event.preventDefault(); | ||
|
||
if (!switcher.val() || val !== switcher.val()) { | ||
|
||
/* Set the value & trigger event */ | ||
switcher.val(val).trigger('change'); | ||
} | ||
}); | ||
})($); | ||
|
||
/** | ||
* Switch store scope | ||
* | ||
* @param {Object} obj | ||
* @return void | ||
*/ | ||
function switchScope(obj) { | ||
var switcher = $(obj), | ||
scopeId = switcher.val(), | ||
scopeParams = '', | ||
switcherParams = {}; | ||
|
||
if (scopeId) { | ||
scopeParams = switcher.data('param') + '/' + scopeId + '/'; | ||
} | ||
|
||
if (obj.switchParams) { | ||
scopeParams += obj.switchParams; | ||
} | ||
|
||
/** | ||
* Reload function for switcher | ||
*/ | ||
function reload() { | ||
var url; | ||
|
||
if (!storeSwitchConfig.isUsingIframe) { | ||
|
||
if (storeSwitchConfig.switchUrl && storeSwitchConfig.switchUrl.length > 0) { | ||
url = storeSwitchConfig.switchUrl + scopeParams; | ||
|
||
/* eslint-disable no-undef */ | ||
setLocation(url); | ||
} | ||
|
||
} else { | ||
$('#preview_selected_store').val(scopeId); | ||
$('#preview_form').submit(); | ||
|
||
$('.store-switcher .dropdown-menu li a').each(function () { | ||
var $this = $(this); | ||
|
||
if ($this.data('role') === 'store-view-id' && $this.data('value') === scopeId) { | ||
$('#store-change-button').html($this.text()); | ||
} | ||
}); | ||
|
||
$('#store-change-button').click(); | ||
} | ||
} | ||
|
||
if (typeof scopeSwitcherHandler !== 'undefined') { | ||
switcherParams = { | ||
scopeId: scopeId, | ||
scopeParams: scopeParams, | ||
useConfirm: storeSwitchConfig.useConfirm | ||
}; | ||
|
||
scopeSwitcherHandler(switcherParams); | ||
} else if (storeSwitchConfig.useConfirm) { | ||
require([ | ||
'Magento_Ui/js/modal/confirm', | ||
'mage/translate' | ||
], function (confirm, $t) { | ||
confirm({ | ||
content: $t('Please confirm scope switching. All data that hasn\'t been saved will be lost.'), | ||
actions: { | ||
|
||
/** | ||
* Confirm action | ||
*/ | ||
confirm: function () { | ||
reload(); | ||
}, | ||
|
||
/** | ||
* Cancel action | ||
*/ | ||
cancel: function () { | ||
obj.value = storeSwitchConfig.storeId ? storeSwitchConfig.storeId : ''; | ||
} | ||
} | ||
}); | ||
}); | ||
} else { | ||
reload(); | ||
} | ||
} | ||
|
||
window.scopeSwitcherHandler = scopeSwitcherHandler; | ||
window.switchScope = switchScope; | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...de/Magento/Captcha/Test/Mftf/Section/StorefrontCaptchaOnOnepageCheckoutPyamentSection.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> | ||
<section name="StorefrontCaptchaOnOnepageCheckoutPyamentSection"> | ||
<element name="captchaField" type="input" selector="#captcha_payment_processing_request"/> | ||
<element name="captchaImg" type="block" selector=".captcha-img"/> | ||
<element name="captchaReload" type="block" selector=".captcha-reload"/> | ||
</section> | ||
</sections> |
17 changes: 17 additions & 0 deletions
17
app/code/Magento/Captcha/Test/Mftf/Section/StorefrontCheckoutPaymentMethodsSection.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> | ||
<section name="StorefrontCheckoutPaymentMethodsSection"> | ||
<element name="purchaseOrder" type="radio" selector="#purchaseorder" timeout="30"/> | ||
<element name="purchaseOrderNumber" type="input" selector="#po_number" timeout="30"/> | ||
<element name="bankTransfer" type="radio" selector="#banktransfer" timeout="30"/> | ||
<element name="cashOnDelivery" type="radio" selector="#cashondelivery" timeout="30"/> | ||
</section> | ||
</sections> |
119 changes: 119 additions & 0 deletions
119
app/code/Magento/Captcha/Test/Mftf/Test/StorefrontCaptchaOnOnepageCheckoutPyamentTest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||
<test name="StorefrontCaptchaOnOnepageCheckoutPyamentTest"> | ||
<annotations> | ||
<features value="Captcha"/> | ||
<stories value="Place order on checkout page + Captcha"/> | ||
<title value="Captcha on checkout page test"/> | ||
<description value="Test creation of order on storefront checkout page with captcha."/> | ||
<severity value="AVERAGE"/> | ||
<testCaseId value="MC-41461"/> | ||
<useCaseId value="MC-41281"/> | ||
<group value="captcha"/> | ||
</annotations> | ||
<before> | ||
<!-- Create Simple Product --> | ||
<createData entity="SimpleProduct2" stepKey="createSimpleProduct"> | ||
<field key="price">20</field> | ||
</createData> | ||
|
||
<!-- Create customer --> | ||
<createData entity="Simple_Customer_Without_Address" stepKey="createCustomer"/> | ||
|
||
<!-- Enable payment method --> | ||
<magentoCLI command="config:set {{BankTransferEnableConfigData.path}} {{BankTransferEnableConfigData.value}}" stepKey="enableBankTransfer"/> | ||
|
||
<!-- Enable captcha for Checkout/Placing Order --> | ||
<magentoCLI command="config:set {{StorefrontCaptchaOnOnepageCheckoutConfigData.path}} {{StorefrontCaptchaOnOnepageCheckoutConfigData.value}}" stepKey="enableOnOpageCheckoutCaptcha" /> | ||
<magentoCLI command="config:set {{StorefrontCustomerCaptchaModeAlwaysConfigData.path}} {{StorefrontCustomerCaptchaModeAlwaysConfigData.value}}" stepKey="alwaysEnableCaptcha" /> | ||
<magentoCLI command="config:set {{StorefrontCustomerCaptchaLength3ConfigData.path}} {{StorefrontCustomerCaptchaLength3ConfigData.value}}" stepKey="setCaptchaLength" /> | ||
<magentoCLI command="config:set {{StorefrontCustomerCaptchaSymbols1ConfigData.path}} {{StorefrontCustomerCaptchaSymbols1ConfigData.value}}" stepKey="setCaptchaSymbols" /> | ||
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> | ||
<argument name="tags" value="config full_page"/> | ||
</actionGroup> | ||
</before> | ||
<after> | ||
<!-- Disabled payment method --> | ||
<magentoCLI command="config:set {{BankTransferDisabledConfigData.path}} {{BankTransferDisabledConfigData.value}}" stepKey="disabledBankTransfer"/> | ||
|
||
<!-- Set default configuration for captcha --> | ||
<magentoCLI command="config:set {{StorefrontCaptchaOnOnepageCheckoutConfigData.path}} {{StorefrontCaptchaOnOnepageCheckoutConfigData.value}},{{StorefrontCaptchaOnCustomerForgotPasswordConfigData.value}}" stepKey="enableCaptchaOnDefaultForms" /> | ||
<magentoCLI command="config:set {{StorefrontCustomerCaptchaModeAfterFailConfigData.path}} {{StorefrontCustomerCaptchaModeAfterFailConfigData.value}}" stepKey="defaultCaptchaMode" /> | ||
<magentoCLI command="config:set {{StorefrontCustomerCaptchaDefaultLengthConfigData.path}} {{StorefrontCustomerCaptchaDefaultLengthConfigData.value}}" stepKey="setDefaultCaptchaLength" /> | ||
<magentoCLI command="config:set {{StorefrontCustomerCaptchaDefaultSymbolsConfigData.path}} {{StorefrontCustomerCaptchaDefaultSymbolsConfigData.value}}" stepKey="setDefaultCaptchaSymbols" /> | ||
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches"> | ||
<argument name="tags" value="config full_page"/> | ||
</actionGroup> | ||
|
||
<!-- Customer logout --> | ||
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogout"/> | ||
|
||
<!-- Delete created products --> | ||
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> | ||
|
||
<!-- Delete customer --> | ||
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> | ||
</after> | ||
|
||
<!-- Reindex and flush cache --> | ||
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex"> | ||
<argument name="indices" value=""/> | ||
</actionGroup> | ||
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache"> | ||
<argument name="tags" value=""/> | ||
</actionGroup> | ||
|
||
<!-- Add Simple Product to cart --> | ||
<amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="navigateToSimpleProductPage"/> | ||
<waitForPageLoad stepKey="waitForSimpleProductPageLoad"/> | ||
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartSimpleProductFromStorefrontProductPage"> | ||
<argument name="productName" value="$$createSimpleProduct.name$$"/> | ||
</actionGroup> | ||
|
||
<!-- Go to shopping cart --> | ||
<actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="goToShoppingCartFromMinicart"/> | ||
<actionGroup ref="FillShippingZipForm" stepKey="fillShippingZipForm"> | ||
<argument name="address" value="US_Address_CA"/> | ||
</actionGroup> | ||
<actionGroup ref="StorefrontClickProceedToCheckoutActionGroup" stepKey="goToCheckout"/> | ||
|
||
<!-- Login as customer on checkout page --> | ||
<actionGroup ref="LoginAsCustomerOnCheckoutPageActionGroup" stepKey="customerLogin"> | ||
<argument name="customer" value="$$createCustomer$$"/> | ||
</actionGroup> | ||
|
||
<!-- Fill customer new shipping address --> | ||
<actionGroup ref="CustomerCheckoutFillNewShippingAddressActionGroup" stepKey="fillShippingAddress"> | ||
<argument name="address" value="US_Address_TX"/> | ||
</actionGroup> | ||
|
||
<!-- Click next button to open payment section --> | ||
<actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/> | ||
|
||
<!-- Select payment method --> | ||
<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> | ||
<click selector="{{StorefrontCheckoutPaymentMethodsSection.bankTransfer}}" stepKey="selectBankTransferMethod"/> | ||
|
||
<!-- Enter captcha value --> | ||
<fillField userInput="{{PreconfiguredCaptcha.value}}" selector="{{StorefrontCaptchaOnOnepageCheckoutPyamentSection.captchaField}}" stepKey="fillCaptchaField" /> | ||
|
||
<!-- Place Order --> | ||
<actionGroup ref="CheckoutPlaceOrderActionGroup" stepKey="customerPlaceOrder"> | ||
<argument name="orderNumberMessage" value="CONST.successCheckoutOrderNumberMessage"/> | ||
<argument name="emailYouMessage" value="CONST.successCheckoutEmailYouMessage"/> | ||
</actionGroup> | ||
|
||
<!-- Assert order grand total --> | ||
<amOnPage url="{{StorefrontCustomerDashboardPage.url}}" stepKey="navigateToCustomerDashboardPage"/> | ||
<waitForPageLoad stepKey="waitForCustomerDashboardPageLoad"/> | ||
<see selector="{{StorefrontCustomerRecentOrdersSection.orderTotal}}" userInput="$25.00" stepKey="checkOrderTotalInStorefront"/> | ||
</test> | ||
</tests> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.