-
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 #160 from magento-pangolin/MC-7438
MC-7438 Backport for MC-13581
- Loading branch information
Showing
13 changed files
with
302 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
app/code/Magento/Catalog/Test/Mftf/ActionGroup/OpenStoreFrontProductPageActionGroup.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. | ||
*/ | ||
--> | ||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="OpenStoreFrontProductPageActionGroup"> | ||
<arguments> | ||
<argument name="productUrlKey" type="string"/> | ||
</arguments> | ||
<amOnPage url="{{StorefrontProductPage.url(productUrlKey)}}" stepKey="amOnProductPage"/> | ||
<waitForPageLoad stepKey="waitForProductPageLoad"/> | ||
</actionGroup> | ||
</actionGroups> |
20 changes: 20 additions & 0 deletions
20
...og/Test/Mftf/ActionGroup/StorefrontAssertShippingMethodOptionPresentInCartActionGroup.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,20 @@ | ||
<?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"> | ||
<!-- Assert shipping method name and price are present in cart --> | ||
<actionGroup name="StorefrontAssertShippingMethodOptionPresentInCartActionGroup"> | ||
<arguments> | ||
<argument name="methodName" type="string"/> | ||
<argument name="price" type="string"/> | ||
</arguments> | ||
<see selector="{{StorefrontCheckoutCartSummarySection.methodName}}" userInput="{{methodName}}" stepKey="seeShippingName"/> | ||
<see selector="{{StorefrontCheckoutCartSummarySection.shippingPrice}}" userInput="{{price}}" stepKey="seeShippingPrice"/> | ||
</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
16 changes: 16 additions & 0 deletions
16
app/code/Magento/Config/Test/Mftf/ActionGroup/AdminSaveConfigActionGroup.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. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminSaveConfigActionGroup"> | ||
<click selector="{{AdminConfigSection.saveButton}}" stepKey="clickSaveConfigBtn"/> | ||
<waitForPageLoad stepKey="waitForPageLoad"/> | ||
<see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the configuration." stepKey="seeSuccessMessage"/> | ||
</actionGroup> | ||
</actionGroups> |
22 changes: 22 additions & 0 deletions
22
app/code/Magento/Customer/Test/Mftf/ActionGroup/LoginToStorefrontActionGroup.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,22 @@ | ||
<?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="LoginToStorefrontActionGroup"> | ||
<arguments> | ||
<argument name="Customer"/> | ||
</arguments> | ||
<amOnPage url="{{StorefrontCustomerSignInPage.url}}" stepKey="amOnSignInPage"/> | ||
<waitForPageLoad stepKey="waitPageFullyLoaded"/> | ||
<waitForElementVisible selector="{{StorefrontCustomerSignInFormSection.emailField}}" stepKey="waitFormAppears"/> | ||
<fillField userInput="{{Customer.email}}" selector="{{StorefrontCustomerSignInFormSection.emailField}}" stepKey="fillEmail"/> | ||
<fillField userInput="{{Customer.password}}" selector="{{StorefrontCustomerSignInFormSection.passwordField}}" stepKey="fillPassword"/> | ||
<click selector="{{StorefrontCustomerSignInFormSection.signInAccountButton}}" stepKey="clickSignInAccountButton"/> | ||
<waitForPageLoad stepKey="waitForCustomerLoggedIn" /> | ||
</actionGroup> | ||
</actionGroups> |
20 changes: 20 additions & 0 deletions
20
...o/Shipping/Test/Mftf/ActionGroup/AdminChangeTableRatesShippingMethodStatusActionGroup.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,20 @@ | ||
<?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"> | ||
<!-- Enable/Disable Table Rates shipping method --> | ||
<actionGroup name="AdminChangeTableRatesShippingMethodStatusActionGroup"> | ||
<arguments> | ||
<argument name="status" type="string" defaultValue="1"/> | ||
</arguments> | ||
<conditionalClick selector="{{AdminShippingMethodTableRatesSection.carriersTableRateTab}}" dependentSelector="{{AdminShippingMethodTableRatesSection.carriersTableRateActive}}" visible="false" stepKey="expandTab"/> | ||
<uncheckOption selector="{{AdminShippingMethodTableRatesSection.enabledUseSystemValue}}" stepKey="uncheckUseSystemValue"/> | ||
<selectOption selector="{{AdminShippingMethodTableRatesSection.carriersTableRateActive}}" userInput="{{status}}" stepKey="changeTableRatesMethodStatus"/> | ||
</actionGroup> | ||
</actionGroups> |
15 changes: 15 additions & 0 deletions
15
.../Magento/Shipping/Test/Mftf/ActionGroup/AdminOpenShippingMethodsConfigPageActionGroup.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. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminOpenShippingMethodsConfigPageActionGroup"> | ||
<amOnPage url="{{AdminShippingMethodsConfigPage.url}}" stepKey="navigateToAdminShippingMethodsPage"/> | ||
<waitForPageLoad stepKey="waitForAdminShippingMethodsPageToLoad"/> | ||
</actionGroup> | ||
</actionGroups> |
19 changes: 19 additions & 0 deletions
19
app/code/Magento/Shipping/Test/Mftf/Data/TableRatesShippingMethodData.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,19 @@ | ||
<?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"> | ||
<!-- Prices from file "table_rate_30895.csv" --> | ||
<entity name="TableRatesWeightVSDestination" type="shipping_method"> | ||
<data key="condition">Weight vs. Destination</data> | ||
<data key="priceCA">5.00</data> | ||
<data key="price">10.00</data> | ||
<data key="title">Best Way</data> | ||
<data key="methodName">Table Rate</data> | ||
</entity> | ||
</entities> |
18 changes: 18 additions & 0 deletions
18
app/code/Magento/Shipping/Test/Mftf/Section/AdminShippingMethodTableRatesSection.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,18 @@ | ||
<?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="AdminShippingMethodTableRatesSection"> | ||
<element name="carriersTableRateTab" type="button" selector="#carriers_tablerate-head"/> | ||
<element name="enabledUseSystemValue" type="checkbox" selector="#carriers_tablerate_active_inherit"/> | ||
<element name="carriersTableRateActive" type="select" selector="#carriers_tablerate_active"/> | ||
<element name="condition" type="select" selector="#carriers_tablerate_condition_name"/> | ||
<element name="importFile" type="input" selector="#carriers_tablerate_import"/> | ||
</section> | ||
</sections> |
114 changes: 114 additions & 0 deletions
114
app/code/Magento/Shipping/Test/Mftf/Test/TableRatesShippingMethodForDifferentStatesTest.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,114 @@ | ||
<?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="TableRatesShippingMethodForDifferentStatesTest"> | ||
<annotations> | ||
<features value="Shipping"/> | ||
<stories value="Table Rates"/> | ||
<title value="Table rates shipping method for different states test"/> | ||
<description value="Checkout with Table Rates for different states of the USA"/> | ||
<severity value="CRITICAL"/> | ||
<testCaseId value="MC-7438"/> | ||
<group value="shipping"/> | ||
</annotations> | ||
<before> | ||
<!-- Create product --> | ||
<createData entity="SimpleProduct3" stepKey="createProduct"/> | ||
|
||
<!-- Create customer --> | ||
<createData entity="Simple_US_CA_Customer" stepKey="createCustomer"/> | ||
|
||
<!-- Login as admin --> | ||
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> | ||
</before> | ||
<after> | ||
<!-- Delete product --> | ||
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/> | ||
|
||
<!-- Delete customer --> | ||
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> | ||
|
||
<!-- Rollback config --> | ||
<actionGroup ref="AdminOpenShippingMethodsConfigPageActionGroup" stepKey="openShippingMethodSystemConfigPage"/> | ||
<actionGroup ref="AdminSwitchWebsiteByNameActionGroup" stepKey="AdminSwitchStoreViewToMainWebsite"> | ||
<argument name="website" value="_defaultWebsite"/> | ||
</actionGroup> | ||
<actionGroup ref="AdminChangeTableRatesShippingMethodStatusActionGroup" stepKey="disableTableRatesShippingMethod"> | ||
<argument name="status" value="0"/> | ||
</actionGroup> | ||
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveSystemConfig"/> | ||
|
||
<!-- Log out --> | ||
<actionGroup ref="logout" stepKey="logout"/> | ||
</after> | ||
|
||
<!-- Go to Stores > Configuration > Sales > Shipping Methods --> | ||
<actionGroup ref="AdminOpenShippingMethodsConfigPageActionGroup" stepKey="openShippingMethodConfigPage"/> | ||
|
||
<!-- Switch to Website scope --> | ||
<actionGroup ref="AdminSwitchWebsiteByNameActionGroup" stepKey="AdminSwitchStoreView"> | ||
<argument name="website" value="_defaultWebsite"/> | ||
</actionGroup> | ||
|
||
<!-- Enable Table Rate method and save config --> | ||
<actionGroup ref="AdminChangeTableRatesShippingMethodStatusActionGroup" stepKey="enableTableRatesShippingMethod"/> | ||
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfig"/> | ||
|
||
<!-- Make sure you have Condition Weight vs. Destination --> | ||
<see selector="{{AdminShippingMethodTableRatesSection.condition}}" userInput="{{TableRatesWeightVSDestination.condition}}" stepKey="seeDefaultCondition"/> | ||
|
||
<!-- Import file and save config --> | ||
<attachFile selector="{{AdminShippingMethodTableRatesSection.importFile}}" userInput="table_rate_30895.csv" stepKey="attachFileForImport"/> | ||
<actionGroup ref="AdminSaveConfigActionGroup" stepKey="saveConfigs"/> | ||
|
||
<!-- Login as customer --> | ||
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer"> | ||
<argument name="Customer" value="$$createCustomer$$"/> | ||
</actionGroup> | ||
|
||
<!-- Add product to the shopping 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> | ||
|
||
<!-- Open the shopping cart page --> | ||
<actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openShoppingCart"/> | ||
|
||
<!-- Expand Estimate Shipping and Tax section in Summary --> | ||
<conditionalClick selector="{{StorefrontCheckoutCartSummarySection.estimateShippingAndTax}}" dependentSelector="{{StorefrontCheckoutCartSummarySection.country}}" visible="false" stepKey="expandEstimateShippingAndTax"/> | ||
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMask"/> | ||
|
||
<!-- See available Table Rate option --> | ||
<actionGroup ref="StorefrontAssertShippingMethodPresentInCartActionGroup" stepKey="assertShippingMethodLabel"> | ||
<argument name="shippingMethod" value="{{TableRatesWeightVSDestination.title}}"/> | ||
</actionGroup> | ||
<actionGroup ref="StorefrontAssertShippingMethodOptionPresentInCartActionGroup" stepKey="assertShippingMethodOption"> | ||
<argument name="methodName" value="{{TableRatesWeightVSDestination.methodName}}"/> | ||
<argument name="price" value="{{TableRatesWeightVSDestination.priceCA}}"/> | ||
</actionGroup> | ||
|
||
<!-- Change State to New York --> | ||
<selectOption selector="{{StorefrontCheckoutCartSummarySection.region}}" userInput="{{US_Address_NY.state}}" stepKey="selectAnotherState"/> | ||
<waitForPageLoad stepKey="waitForShippingMethodLoad"/> | ||
|
||
<!-- See available Table Rate option for another state --> | ||
<actionGroup ref="StorefrontAssertShippingMethodPresentInCartActionGroup" stepKey="assertShippingMethodLabelForAnotherState"> | ||
<argument name="shippingMethod" value="{{TableRatesWeightVSDestination.title}}"/> | ||
</actionGroup> | ||
<actionGroup ref="StorefrontAssertShippingMethodOptionPresentInCartActionGroup" stepKey="assertShippingMethodOptionForAnotherState"> | ||
<argument name="methodName" value="{{TableRatesWeightVSDestination.methodName}}"/> | ||
<argument name="price" value="{{TableRatesWeightVSDestination.price}}"/> | ||
</actionGroup> | ||
</test> | ||
</tests> |
22 changes: 22 additions & 0 deletions
22
app/code/Magento/Store/Test/Mftf/ActionGroup/AdminSwitchWebsiteByNameActionGroup.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,22 @@ | ||
<?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="AdminSwitchWebsiteByNameActionGroup"> | ||
<arguments> | ||
<argument name="website"/> | ||
</arguments> | ||
<scrollToTopOfPage stepKey="scrollToTop"/> | ||
<click selector="{{AdminMainActionsSection.storeViewDropdown}}" stepKey="clickWebsiteSwitchDropdown"/> | ||
<waitForElementVisible selector="{{AdminMainActionsSection.websiteByName('Main Website')}}" stepKey="waitForWebsiteAreVisible"/> | ||
<click selector="{{AdminMainActionsSection.websiteByName(website.name)}}" stepKey="clickWebsiteByName"/> | ||
<waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitingForInformationModal"/> | ||
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmStoreSwitch"/> | ||
<see userInput="{{website.name}}" selector="{{AdminMainActionsSection.storeSwitcher}}" stepKey="seeNewWebsiteName"/> | ||
</actionGroup> | ||
</actionGroups> |
14 changes: 14 additions & 0 deletions
14
app/code/Magento/Ups/Test/Mftf/Page/AdminShippingMethodsConfigPage.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,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> | ||
<page name="AdminShippingMethodsConfigPage" url="admin/system_config/edit/section/carriers/" area="admin" module="Magento_Ups"> | ||
<section name="AdminShippingMethodsUpsSection"/> | ||
</page> | ||
</pages> |
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,3 @@ | ||
Country,Region/State,Zip/Postal Code,Weight (and above),Shipping Price | ||
US,CA,*,0,5 | ||
US,*,*,0,10 |