-
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.
ENGCOM-6914: #26583 Tier pricing save percent showing logic updated i…
…n product detail page #26584
- Loading branch information
Showing
6 changed files
with
144 additions
and
8 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
.../Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductDetailPageFinalPriceActionGroup.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"> | ||
<actionGroup name="AssertStorefrontProductDetailPageFinalPriceActionGroup"> | ||
<arguments> | ||
<argument name="finalProductPrice" type="string"/> | ||
</arguments> | ||
<grabTextFrom selector="{{StorefrontProductInfoMainSection.price}}" stepKey="productPriceText"/> | ||
<assertEquals stepKey="assertProductPriceOnProductPage"> | ||
<expectedResult type="string">${{finalProductPrice}}</expectedResult> | ||
<actualResult type="variable">productPriceText</actualResult> | ||
</assertEquals> | ||
</actionGroup> | ||
</actionGroups> |
20 changes: 20 additions & 0 deletions
20
...agento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductDetailPageNameActionGroup.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"> | ||
<actionGroup name="AssertStorefrontProductDetailPageNameActionGroup"> | ||
<arguments> | ||
<argument name="productName" type="string"/> | ||
</arguments> | ||
<grabTextFrom selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="productNameText"/> | ||
<assertEquals stepKey="assertProductNameOnProductPage"> | ||
<expectedResult type="string">{{productName}}</expectedResult> | ||
<actualResult type="variable">productNameText</actualResult> | ||
</assertEquals> | ||
</actionGroup> | ||
</actionGroups> |
22 changes: 22 additions & 0 deletions
22
...o/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductDetailPageTierPriceActionGroup.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="AssertStorefrontProductDetailPageTierPriceActionGroup"> | ||
<arguments> | ||
<argument name="tierProductPriceDiscountQuantity" type="string"/> | ||
<argument name="productPriceWithAppliedTierPriceDiscount" type="string"/> | ||
<argument name="productSavedPricePercent" type="string"/> | ||
</arguments> | ||
<grabTextFrom selector="{{StorefrontProductInfoMainSection.tierPriceText}}" stepKey="tierPriceText"/> | ||
<assertEquals stepKey="assertTierPriceTextOnProductPage"> | ||
<expectedResult type="string">Buy {{tierProductPriceDiscountQuantity}} for ${{productPriceWithAppliedTierPriceDiscount}} each and save {{productSavedPricePercent}}%</expectedResult> | ||
<actualResult type="variable">tierPriceText</actualResult> | ||
</assertEquals> | ||
</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
65 changes: 65 additions & 0 deletions
65
...nto/Catalog/Test/Mftf/Test/StoreFrontSimpleProductWithSpecialAndTierDiscountPriceTest.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,65 @@ | ||
<?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="StoreFrontSimpleProductWithSpecialAndTierDiscountPriceTest"> | ||
<annotations> | ||
<features value="Catalog"/> | ||
<title value="Apply discount tier price and custom price values for simple product"/> | ||
<description value="Apply discount tier price and custom price values for simple product"/> | ||
<severity value="MAJOR"/> | ||
<group value="Catalog"/> | ||
</annotations> | ||
<before> | ||
<createData entity="_defaultCategory" stepKey="createCategory"/> | ||
|
||
<createData entity="ApiSimpleProduct" stepKey="createProduct"> | ||
<requiredEntity createDataKey="createCategory"/> | ||
<field key="price">100.00</field> | ||
</createData> | ||
|
||
<createData entity="tierProductPriceDiscount" stepKey="addTierPrice"> | ||
<requiredEntity createDataKey="createProduct"/> | ||
</createData> | ||
</before> | ||
<after> | ||
<deleteData createDataKey="createProduct" stepKey="deleteSimpleProduct"/> | ||
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/> | ||
</after> | ||
|
||
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> | ||
|
||
<actionGroup ref="GoToProductPageViaIDActionGroup" stepKey="openAdminProductEditPage"> | ||
<argument name="productId" value="$createProduct.id$"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="AddSpecialPriceToProductActionGroup" stepKey="addSpecialPriceToProduct"> | ||
<argument name="price" value="65.00"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> | ||
|
||
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> | ||
<argument name="productUrl" value="$createProduct.custom_attributes[url_key]$"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="AssertStorefrontProductDetailPageNameActionGroup" stepKey="assertProductNameText"> | ||
<argument name="productName" value="$createProduct.name$"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="AssertStorefrontProductDetailPageTierPriceActionGroup" stepKey="assertProductTierPriceText"> | ||
<argument name="tierProductPriceDiscountQuantity" value="{{tierProductPriceDiscount.quantity}}"/> | ||
<argument name="productPriceWithAppliedTierPriceDiscount" value="64.00"/> | ||
<argument name="productSavedPricePercent" value="2"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="AssertStorefrontProductDetailPageFinalPriceActionGroup" stepKey="assertProductFinalPriceText"> | ||
<argument name="finalProductPrice" value="65.00"/> | ||
</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