-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d516e27
commit c5e4aa5
Showing
3 changed files
with
162 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
...oduct/Test/Mftf/ActionGroup/StrorefrontUpdateCartItemEditParametersProductActionGroup.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. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="StrorefrontUpdateCartItemEditParametersProductActionGroup"> | ||
<arguments> | ||
<argument name="rowNumber" type="string" defaultValue="1"/> | ||
</arguments> | ||
<click selector="{{CheckoutCartProductSection.nthEditButton(rowNumber)}}" stepKey="clickEditConfigurableProductButton"/> | ||
<waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> | ||
</actionGroup> | ||
</actionGroups> |
31 changes: 31 additions & 0 deletions
31
.../Test/Mftf/ActionGroup/StorefrontAddProductWithSwatchesTextOptionToTheCartActionGroup.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,31 @@ | ||
<?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"> | ||
<!-- Add Configurable Product with Swatch attribute to the cart --> | ||
<actionGroup name="StorefrontAddProductWithSwatchesTextOptionToTheCartActionGroup"> | ||
<annotations> | ||
<description>Select Product product option. Fills in the provided Product Quantity. Clicks on Add To Cart. Validates that the Success Message is present.</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="product"/> | ||
<argument name="productOption" type="string"/> | ||
<argument name="productQty" type="string" /> | ||
</arguments> | ||
|
||
<waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/> | ||
<click selector="{{StorefrontProductInfoMainSection.swatchOptionByLabel(productOption)}}" stepKey="clickSwatchOption"/> | ||
<fillField selector="{{StorefrontProductPageSection.qtyInput}}" userInput="{{productQty}}" stepKey="fillProduct1Quantity"/> | ||
<click selector="{{StorefrontProductPageSection.addToCartBtn}}" stepKey="clickOnAddToCartButton"/> | ||
<waitForPageLoad stepKey="waitForProductToAddInCart"/> | ||
<waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/> | ||
<seeElement selector="{{StorefrontProductPageSection.successMsg}}" stepKey="seeSuccessSaveMessage"/> | ||
|
||
</actionGroup> | ||
</actionGroups> |
113 changes: 113 additions & 0 deletions
113
...watches/Test/Mftf/Test/StorefrontConfigurableProductSwatchUpdateCartItemTierPriceTest.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,113 @@ | ||
<?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="StorefrontConfigurableProductSwatchUpdateCartItemTierPriceTest"> | ||
<annotations> | ||
<features value="Swatches"/> | ||
<stories value="Configurable product with swatch attribute"/> | ||
<title value="Swatch option should show the tier price on product page when Cart Item edited."/> | ||
<description value="Configurable product with swatch attribute should show the tier price on product page when added Cart Item."/> | ||
<severity value="CRITICAL"/> | ||
<group value="Swatches"/> | ||
</annotations> | ||
<before> | ||
<createData entity="ApiCategory" stepKey="createCategory"/> | ||
<createData entity="ApiConfigurableProduct" stepKey="createConfigurableProduct"> | ||
<requiredEntity createDataKey="createCategory"/> | ||
</createData> | ||
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> | ||
</before> | ||
<after> | ||
<deleteData createDataKey="createConfigurableProduct" stepKey="deleteConfigurableProduct"/> | ||
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/> | ||
<actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteColorAttribute"> | ||
<argument name="ProductAttribute" value="ProductColorAttribute"/> | ||
</actionGroup> | ||
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/> | ||
</after> | ||
|
||
<actionGroup ref="AddTextSwatchToProductActionGroup" stepKey="addColorAttribute"> | ||
<argument name="attributeName" value="{{ProductColorAttribute.frontend_label}}"/> | ||
<argument name="attributeCode" value="{{ProductColorAttribute.attribute_code}}"/> | ||
<argument name="option1" value="Black"/> | ||
<argument name="option2" value="White"/> | ||
<argument name="option3" value="Blue"/> | ||
</actionGroup> | ||
|
||
<amOnPage url="{{AdminProductEditPage.url($createConfigurableProduct.id$)}}" stepKey="goToConfigurableProduct"/> | ||
|
||
<actionGroup ref="GenerateConfigurationsByAttributeCodeActionGroup" stepKey="createProductConfigurations"> | ||
<argument name="attributeCode" value="{{ProductColorAttribute.attribute_code}}"/> | ||
</actionGroup> | ||
<actionGroup ref="SaveConfigurableProductAddToCurrentAttributeSetActionGroup" stepKey="saveConfigurableProduct"/> | ||
|
||
<actionGroup ref="FilterAndSelectProductActionGroup" stepKey="filterProduct"> | ||
<argument name="productSku" value="$$createConfigurableProduct.sku$$-White"/> | ||
</actionGroup> | ||
<actionGroup ref="ProductSetAdvancedPricingActionGroup" stepKey="addTierPriceToSimpleProduct"> | ||
<argument name="group" value="ALL GROUPS"/> | ||
<argument name="quantity" value="5"/> | ||
<argument name="price" value="Discount"/> | ||
<argument name="amount" value="50"/> | ||
</actionGroup> | ||
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveSimpleProduct"/> | ||
|
||
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openConfigurableProductPage"> | ||
<argument name="productUrl" value="$createConfigurableProduct.custom_attributes[url_key]$"/> | ||
</actionGroup> | ||
<waitForPageLoad stepKey="waitForConfigurableProductPage"/> | ||
|
||
<actionGroup ref="StorefrontSelectSwatchOptionOnProductPageActionGroup" stepKey="selectWhiteOption"> | ||
<argument name="optionName" value="White"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="AssertStorefrontProductDetailPageTierPriceActionGroup" stepKey="assertProductTierPriceText"> | ||
<argument name="tierProductPriceDiscountQuantity" value="5"/> | ||
<argument name="productPriceWithAppliedTierPriceDiscount" value="61.50"/> | ||
<argument name="productSavedPricePercent" value="50"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="StorefrontAddProductWithSwatchesTextOptionToTheCartActionGroup" stepKey="addConfigurableProductToTheCart"> | ||
<argument name="productQty" value="1"/> | ||
<argument name="product" value="ApiConfigurableProduct"/> | ||
<argument name="productOption" value="Blue"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="openShoppingCartPage"/> | ||
|
||
<actionGroup ref="StorefrontUpdateCartItemEditParametersProductActionGroup" stepKey="updateCartItem"> | ||
<argument name="rowNumber" value="1"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="StorefrontSelectSwatchOptionOnProductPageActionGroup" stepKey="selectWhiteOption2"> | ||
<argument name="optionName" value="White"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="AssertStorefrontProductDetailPageTierPriceActionGroup" stepKey="assertProductTierPriceText2"> | ||
<argument name="tierProductPriceDiscountQuantity" value="5"/> | ||
<argument name="productPriceWithAppliedTierPriceDiscount" value="61.50"/> | ||
<argument name="productSavedPricePercent" value="50"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="StorefrontSelectSwatchOptionOnProductPageActionGroup" stepKey="selectWhiteOption3"> | ||
<argument name="optionName" value="Blue"/> | ||
</actionGroup> | ||
|
||
<dontSee selector="{{StorefrontProductInfoMainSection.tierPriceText}}" stepKey="dontSeeTierPriceForOption"/> | ||
|
||
<actionGroup ref="StorefrontAddProductWithSwatchesTextOptionToTheCartActionGroup" stepKey="addUpdatedConfigurableProductToTheCart"> | ||
<argument name="productQty" value="10"/> | ||
<argument name="product" value="ApiConfigurableProduct"/> | ||
<argument name="productOption" value="White"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="openShoppingCartPage2"/> | ||
|
||
</test> | ||
</tests> |