-
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 pull request #166 from magento-pangolin/MC-8893
MC-8893 Backport for MC-12599
- Loading branch information
Showing
12 changed files
with
223 additions
and
6 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
25 changes: 25 additions & 0 deletions
25
...Magento/Checkout/Test/Mftf/ActionGroup/GuestCheckoutFillNewShippingAddressActionGroup.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,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="GuestCheckoutFillNewShippingAddressActionGroup"> | ||
<arguments> | ||
<argument name="customer" type="entity"/> | ||
<argument name="address" type="entity"/> | ||
</arguments> | ||
<fillField selector="{{CheckoutShippingSection.email}}" userInput="{{customer.email}}" stepKey="fillEmailField"/> | ||
<fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customer.firstName}}" stepKey="fillFirstName"/> | ||
<fillField selector="{{CheckoutShippingSection.lastName}}" userInput="{{customer.lastName}}" stepKey="fillLastName"/> | ||
<fillField selector="{{CheckoutShippingSection.street}}" userInput="{{address.street}}" stepKey="fillStreet"/> | ||
<fillField selector="{{CheckoutShippingSection.city}}" userInput="{{address.city}}" stepKey="fillCity"/> | ||
<selectOption selector="{{CheckoutShippingSection.region}}" userInput="{{address.state}}" stepKey="selectRegion"/> | ||
<fillField selector="{{CheckoutShippingSection.postcode}}" userInput="{{address.postcode}}" stepKey="fillZipCode"/> | ||
<fillField selector="{{CheckoutShippingSection.telephone}}" userInput="{{address.telephone}}" stepKey="fillPhone"/> | ||
</actionGroup> | ||
</actionGroups> |
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,42 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd"> | ||
<!-- Free shipping --> | ||
<entity name="EnableFreeShippingConfigData"> | ||
<data key="path">carriers/freeshipping/active</data> | ||
<data key="scope">carriers</data> | ||
<data key="scope_id">1</data> | ||
<data key="label">Yes</data> | ||
<data key="value">1</data> | ||
</entity> | ||
<entity name="DisableFreeShippingConfigData"> | ||
<data key="path">carriers/freeshipping/active</data> | ||
<data key="scope">carriers</data> | ||
<data key="scope_id">1</data> | ||
<data key="label">No</data> | ||
<data key="value">0</data> | ||
</entity> | ||
|
||
<!-- Flat Rate shipping --> | ||
<entity name="EnableFlatRateConfigData"> | ||
<data key="path">carriers/flatrate/active</data> | ||
<data key="scope">carriers</data> | ||
<data key="scope_id">1</data> | ||
<data key="label">Yes</data> | ||
<data key="value">1</data> | ||
</entity> | ||
<entity name="DisableFlatRateConfigData"> | ||
<data key="path">carriers/flatrate/active</data> | ||
<data key="scope">carriers</data> | ||
<data key="scope_id">1</data> | ||
<data key="label">No</data> | ||
<data key="value">0</data> | ||
</entity> | ||
</entities> |
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
102 changes: 102 additions & 0 deletions
102
...eckout/Test/Mftf/Test/AdminCheckConfigsChangesIsNotAffectedStartedCheckoutProcessTest.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,102 @@ | ||
<?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="AdminCheckConfigsChangesAreNotAffectedStartedCheckoutProcessTest"> | ||
<annotations> | ||
<features value="Checkout"/> | ||
<stories value="Changes in configs are not affecting checkout process"/> | ||
<title value="Admin check configs changes are not affected started checkout process test"/> | ||
<description value="Changes in admin for shipping rates are not affecting checkout process that has been started"/> | ||
<severity value="CRITICAL"/> | ||
<testCaseId value="MC-8893"/> | ||
<group value="checkout"/> | ||
</annotations> | ||
<before> | ||
<!-- Create simple product --> | ||
<createData entity="SimpleProduct3" stepKey="createProduct"/> | ||
|
||
<!-- Enable free shipping method --> | ||
<magentoCLI command="config:set {{EnableFreeShippingConfigData.path}} {{EnableFreeShippingConfigData.value}}" stepKey="enableFreeShipping"/> | ||
|
||
<!-- Disable flat rate method --> | ||
<magentoCLI command="config:set {{DisableFlatRateConfigData.path}} {{DisableFlatRateConfigData.value}}" stepKey="disableFlatRate"/> | ||
</before> | ||
<after> | ||
<!-- Roll back configuration --> | ||
<magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/> | ||
<magentoCLI command="config:set {{DisableFreeShippingConfigData.path}} {{DisableFreeShippingConfigData.value}}" stepKey="disableFreeShipping"/> | ||
|
||
<!-- Delete simple product --> | ||
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/> | ||
|
||
<!-- Log out --> | ||
<actionGroup ref="logout" stepKey="logout"/> | ||
</after> | ||
|
||
<!-- Add product to cart --> | ||
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductPage"> | ||
<argument name="productUrlKey" value="$$createProduct.custom_attributes[url_key]$$"/> | ||
</actionGroup> | ||
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> | ||
<argument name="product" value="$$createProduct$$"/> | ||
<argument name="productCount" value="1"/> | ||
</actionGroup> | ||
|
||
<!-- Proceed to Checkout from mini shopping cart --> | ||
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckout"/> | ||
|
||
<!-- Fill all required fields --> | ||
<actionGroup ref="GuestCheckoutFillNewShippingAddressActionGroup" stepKey="fillNewShippingAddress"> | ||
<argument name="customer" value="Simple_Customer_Without_Address"/> | ||
<argument name="address" value="US_Address_TX"/> | ||
</actionGroup> | ||
|
||
<!-- Assert Free Shipping checkbox --> | ||
<seeCheckboxIsChecked selector="{{CheckoutShippingMethodsSection.shippingMethodFreeShipping}}" stepKey="freeShippingMethodCheckboxIsChecked"/> | ||
|
||
<!-- Click Next button --> | ||
<click selector="{{GuestCheckoutShippingSection.next}}" stepKey="clickNext"/> | ||
<waitForPageLoad stepKey="waitForShipmentPageLoad"/> | ||
|
||
<!-- Payment step is opened --> | ||
<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/> | ||
|
||
<!-- Order Summary block contains information about shipping --> | ||
<actionGroup ref="CheckShippingMethodInCheckoutActionGroup" stepKey="guestCheckoutCheckShippingMethod"> | ||
<argument name="shippingMethod" value="freeTitleDefault.value"/> | ||
</actionGroup> | ||
|
||
<!-- Open new browser's window and login as Admin --> | ||
<openNewTab stepKey="openNewTab"/> | ||
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> | ||
|
||
<!-- Go to Store > Configuration > Sales > Shipping Methods --> | ||
<actionGroup ref="AdminOpenShippingMethodsConfigPageActionGroup" stepKey="openShippingMethodConfigPage"/> | ||
|
||
<!-- Enable "Flat Rate" --> | ||
<actionGroup ref="AdminChangeFlatRateShippingMethodStatusActionGroup" stepKey="enableFlatRateShippingStatus"/> | ||
|
||
<!-- Flush cache --> | ||
<magentoCLI command="cache:flush" stepKey="cacheFlush"/> | ||
|
||
<!-- Back to the Checkout and refresh the page --> | ||
<switchToPreviousTab stepKey="switchToPreviousTab"/> | ||
<reloadPage stepKey="refreshPage"/> | ||
<waitForPageLoad stepKey="waitPageReload"/> | ||
|
||
<!-- Payment step is opened after refreshing --> | ||
<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSection"/> | ||
|
||
<!-- Order Summary block contains information about free shipping --> | ||
<actionGroup ref="CheckShippingMethodInCheckoutActionGroup" stepKey="guestCheckoutCheckFreeShippingMethod"> | ||
<argument name="shippingMethod" value="freeTitleDefault.value"/> | ||
</actionGroup> | ||
</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
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
21 changes: 21 additions & 0 deletions
21
...nto/Shipping/Test/Mftf/ActionGroup/AdminChangeFlatRateShippingMethodStatusActionGroup.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,21 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminChangeFlatRateShippingMethodStatusActionGroup"> | ||
<arguments> | ||
<argument name="status" type="string" defaultValue="1"/> | ||
</arguments> | ||
<conditionalClick selector="{{AdminShippingMethodFlatRateSection.carriersFlatRateTab}}" dependentSelector="{{AdminShippingMethodFlatRateSection.carriersFlatRateActive}}" visible="false" stepKey="expandTab"/> | ||
<selectOption selector="{{AdminShippingMethodFlatRateSection.carriersFlatRateActive}}" userInput="{{status}}" stepKey="changeFlatRateMethodStatus"/> | ||
<click selector="{{AdminConfigSection.saveButton}}" stepKey="saveConfigs"/> | ||
<waitForPageLoad stepKey="waitForPageLoad"/> | ||
<see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration." stepKey="seeSuccessMessage"/> | ||
</actionGroup> | ||
</actionGroups> |
15 changes: 15 additions & 0 deletions
15
app/code/Magento/Shipping/Test/Mftf/Section/AdminShippingMethodFlatRateSection.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,15 @@ | ||
<?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="AdminShippingMethodFlatRateSection"> | ||
<element name="carriersFlatRateTab" type="button" selector="#carriers_flatrate-head"/> | ||
<element name="carriersFlatRateActive" type="select" selector="#carriers_flatrate_active"/> | ||
</section> | ||
</sections> |