This repository has been archived by the owner on May 20, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
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 #8 from magento/2.2-develop
New pull request
- Loading branch information
Showing
103 changed files
with
2,683 additions
and
532 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
14 changes: 14 additions & 0 deletions
14
app/code/Magento/Bundle/Test/Mftf/Page/AdminProductCreatePage.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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd"> | ||
<page name="AdminProductCreatePage" url="catalog/product/new/set/{{set}}/type/{{type}}/" area="admin" module="Magento_Catalog" parameterized="true"> | ||
<section name="AdminProductFormBundleSection"/> | ||
</page> | ||
</pages> |
14 changes: 14 additions & 0 deletions
14
app/code/Magento/Bundle/Test/Mftf/Page/StorefrontProductPage.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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd"> | ||
<page name="StorefrontProductPage" url="/{{var1}}.html" area="storefront" module="Magento_Catalog" parameterized="true"> | ||
<section name="StorefrontBundledSection"/> | ||
</page> | ||
</pages> |
20 changes: 20 additions & 0 deletions
20
app/code/Magento/Bundle/Test/Mftf/Section/AdminProductFormBundleSection.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. | ||
*/ | ||
--> | ||
|
||
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> | ||
<section name="AdminProductFormBundleSection"> | ||
<element name="bundleItemsToggle" type="button" selector="//span[text()='Bundle Items']"/> | ||
<element name="addOption" type="button" selector="button[data-index='add_button']"/> | ||
<element name="bundleOptionXTitle" type="input" selector="[name='bundle_options[bundle_options][{{x}}][title]']" parameterized="true"/> | ||
<element name="bundleOptionXInputType" type="select" selector="[name='bundle_options[bundle_options][{{x}}][type]']" parameterized="true"/> | ||
<element name="addProductsToOption" type="button" selector="[data-index='modal_set']" timeout="30"/> | ||
<element name="bundleOptionXProductYQuantity" type="input" selector="[name='bundle_options[bundle_options][{{x}}][bundle_selections][{{y}}][selection_qty]']" parameterized="true"/> | ||
<element name="bundledItems" type="block" selector="[data-index=bundle-items]"/> | ||
</section> | ||
</sections> |
18 changes: 18 additions & 0 deletions
18
app/code/Magento/Bundle/Test/Mftf/Section/StorefrontBundledSection.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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd"> | ||
<section name="StorefrontBundledSection"> | ||
<element name="bundleOption" type="input" selector=".option:nth-of-type({{numOption}}) .choice:nth-of-type({{numOptionSelect}}) input" parameterized="true"/> | ||
<element name="addToCart" type="button" selector="#bundle-slide" timeout="30"/> | ||
<element name="addToCartConfigured" type="button" selector="#product-addtocart-button" timeout="30"/> | ||
<element name="updateCart" type="button" selector="#product-updatecart-button" timeout="30"/> | ||
<element name="configuredPrice" type="block" selector=".price-configured_price .price"/> | ||
</section> | ||
</sections> |
124 changes: 124 additions & 0 deletions
124
app/code/Magento/Bundle/Test/Mftf/Test/StorefrontEditBundleProductTest.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,124 @@ | ||
<?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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd"> | ||
<test name="StorefrontEditBundleProductTest"> | ||
<annotations> | ||
<features value="Bundle"/> | ||
<stories value="Bundle products list on Storefront"/> | ||
<title value="Customer should be able to change chosen options for Bundle Product when clicking Edit button in Shopping Cart page"/> | ||
<description value="Customer should be able to change chosen options for Bundle Product when clicking Edit button in Shopping Cart page"/> | ||
<severity value="MAJOR"/> | ||
<testCaseId value="MAGETWO-77523"/> | ||
<group value="bundle"/> | ||
</annotations> | ||
<before> | ||
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> | ||
<createData entity="SimpleProduct3" stepKey="simpleProduct1"/> | ||
<createData entity="SimpleProduct3" stepKey="simpleProduct2"/> | ||
</before> | ||
<after> | ||
<actionGroup ref="logout" stepKey="logoutFromAdmin"/> | ||
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> | ||
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/> | ||
</after> | ||
|
||
<!-- Create a bundle product --> | ||
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPageBundle"/> | ||
<waitForPageLoad stepKey="waitForProductPageLoadBundle"/> | ||
<actionGroup ref="goToCreateProductPage" stepKey="goToCreateBundleProduct"> | ||
<argument name="product" value="BundleProduct"/> | ||
</actionGroup> | ||
|
||
<actionGroup ref="fillProductNameAndSkuInProductForm" stepKey="fillBundleProductNameAndSku"> | ||
<argument name="product" value="BundleProduct"/> | ||
</actionGroup> | ||
|
||
<!-- Add two bundle items --> | ||
<conditionalClick selector="{{AdminProductFormBundleSection.bundleItemsToggle}}" dependentSelector="{{AdminProductFormBundleSection.bundleItemsToggle}}" visible="false" stepKey="conditionallyOpenSectionBundleItems"/> | ||
<scrollTo selector="{{AdminProductFormBundleSection.bundledItems}}" stepKey="scrollToBundleItems"/> | ||
<click selector="{{AdminProductFormBundleSection.addOption}}" stepKey="clickAddOption3"/> | ||
<waitForElementVisible selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" stepKey="waitForBundleOptions"/> | ||
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXTitle('0')}}" userInput="{{BundleProduct.optionTitle1}}" stepKey="fillOptionTitle"/> | ||
<selectOption selector="{{AdminProductFormBundleSection.bundleOptionXInputType('0')}}" userInput="{{BundleProduct.optionInputType1}}" stepKey="selectInputType"/> | ||
<waitForElementVisible selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="waitForAddProductsToBundle"/> | ||
<click selector="{{AdminProductFormBundleSection.addProductsToOption}}" stepKey="clickAddProductsToOption"/> | ||
<waitForPageLoad stepKey="waitForPageLoadAfterBundleProducts"/> | ||
<actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions"> | ||
<argument name="product" value="$$simpleProduct1$$"/> | ||
</actionGroup> | ||
<checkOption selector="{{AdminAddProductsToOptionPanelSection.firstCheckbox}}" stepKey="selectFirstGridRow"/> | ||
<actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2"> | ||
<argument name="product" value="$$simpleProduct2$$"/> | ||
</actionGroup> | ||
<checkOption selector="{{AdminAddProductsToOptionPanelSection.firstCheckbox}}" stepKey="selectFirstGridRow2"/> | ||
<click selector="{{AdminAddProductsToOptionPanelSection.addSelectedProducts}}" stepKey="clickAddSelectedBundleProducts"/> | ||
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty1"/> | ||
<fillField selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" userInput="{{BundleProduct.defaultQuantity}}" stepKey="fillProductDefaultQty2"/> | ||
|
||
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProductBundle"/> | ||
<see selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product." stepKey="assertSuccess"/> | ||
|
||
<!-- Go to the storefront bundled product page --> | ||
<amOnPage url="/{{BundleProduct.urlKey}}.html" stepKey="visitStoreFrontBundle"/> | ||
<waitForPageLoad stepKey="waitForStorefront"/> | ||
<click selector="{{StorefrontBundledSection.addToCart}}" stepKey="customizeAndAddToCart"/> | ||
<waitForPageLoad stepKey="waitCustomizableOptionsPopUp"/> | ||
|
||
<!-- add two products to the shopping cart, each with one different option --> | ||
<click selector="{{StorefrontBundledSection.bundleOption('1','1')}}" stepKey="selectFirstBundleOption"/> | ||
<waitForPageLoad stepKey="waitForPriceUpdate"/> | ||
<see selector="{{StorefrontBundledSection.configuredPrice}}" userInput="1,230.00" stepKey="seeSinglePrice"/> | ||
<click selector="{{StorefrontBundledSection.addToCartConfigured}}" stepKey="addFirstItemToCart"/> | ||
<waitForPageLoad stepKey="waitForElementAdded"/> | ||
|
||
<click selector="{{StorefrontBundledSection.bundleOption('1','1')}}" stepKey="unselectFirstBundleOption"/> | ||
<click selector="{{StorefrontBundledSection.bundleOption('1','2')}}" stepKey="selectSecondBundleOption"/> | ||
<waitForPageLoad stepKey="waitForPriceUpdate2"/> | ||
<see selector="{{StorefrontBundledSection.configuredPrice}}" userInput="1,230.00" stepKey="seeSinglePrice2"/> | ||
<click selector="{{StorefrontBundledSection.addToCartConfigured}}" stepKey="addSecondItemToCart"/> | ||
<waitForPageLoad stepKey="waitForElementAdded2"/> | ||
|
||
<!-- Go to the shopping cart page and edit the first product --> | ||
<amOnPage url="{{CheckoutCartPage.url}}" stepKey="onPageShoppingCart"/> | ||
<waitForPageLoad stepKey="waitForCartPageLoad"/> | ||
<waitForElementVisible selector="{{CheckoutCartSummarySection.total}}" stepKey="waitForInfoDropdown"/> | ||
<waitForPageLoad stepKey="waitForCartPageLoad3"/> | ||
<grabTextFrom selector="{{CheckoutCartSummarySection.total}}" stepKey="grabTotalBefore"/> | ||
<click selector="{{CheckoutCartProductSection.editItemParametersButton('1')}}" stepKey="clickEdit"/> | ||
<waitForPageLoad stepKey="waitForStorefront2"/> | ||
|
||
<!-- Choose both of the options on the storefront --> | ||
<click selector="{{StorefrontBundledSection.bundleOption('1','1')}}" stepKey="selectFirstBundleOption2"/> | ||
<click selector="{{StorefrontBundledSection.bundleOption('1','2')}}" stepKey="selectSecondBundleOption2"/> | ||
|
||
<waitForPageLoad stepKey="waitForPriceUpdate3"/> | ||
<see selector="{{StorefrontBundledSection.configuredPrice}}" userInput="2,460.00" stepKey="seeDoublePrice"/> | ||
|
||
<click selector="{{StorefrontBundledSection.updateCart}}" stepKey="addFirstItemToCart2"/> | ||
<waitForPageLoad stepKey="waitForElementAdded3"/> | ||
|
||
<!-- Go to the shopping cart page --> | ||
<amOnPage url="{{CheckoutCartPage.url}}" stepKey="onPageShoppingCart2"/> | ||
<waitForPageLoad stepKey="waitForCartPageLoad2"/> | ||
|
||
<!-- Assert that the options are both there and the proce no longer matches --> | ||
<see selector="{{CheckoutCartProductSection.itemOptionsBlock('2')}}" userInput="$$simpleProduct1.sku$$" stepKey="assertBothOptions"/> | ||
<see selector="{{CheckoutCartProductSection.itemOptionsBlock('2')}}" userInput="$$simpleProduct2.sku$$" stepKey="assertBothOptions2"/> | ||
<waitForElementVisible selector="{{CheckoutCartSummarySection.total}}" stepKey="waitForInfoDropdown2"/> | ||
<waitForPageLoad stepKey="waitForCartPageLoad4"/> | ||
<grabTextFrom selector="{{CheckoutCartSummarySection.total}}" stepKey="grabTotalAfter"/> | ||
<assertNotEquals expected="{$grabTotalBefore}" expectedType="string" actual="{$grabTotalAfter}" actualType="string" stepKey="assertNotEquals"/> | ||
|
||
<!-- Delete the bundled product --> | ||
<actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteBundle"> | ||
<argument name="product" value="BundleProduct"/> | ||
</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
Oops, something went wrong.