Skip to content

Commit

Permalink
[EngCom] Public Pull Requests - 2.3-develop
Browse files Browse the repository at this point in the history
 - merged latest code from mainline branch
  • Loading branch information
magento-engcom-team authored May 14, 2018
2 parents 03f33d5 + 08ccf75 commit 2466fae
Show file tree
Hide file tree
Showing 60 changed files with 2,490 additions and 149 deletions.
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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
<page name="AdminLogoutPage" url="admin/auth/logout/" area="admin" module="Magento_Backend">
<section name="removeAfterMqe-896"/>
</page>
</pages>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
<section name="AdminMainActionsSection">
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
<data key="optionInputType1">checkbox</data>
<data key="defaultQuantity">10</data>
<data key="status">1</data>
<data key="urlKey" unique="suffix">bundleproduct</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,17 @@
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../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="shipmentType" type="select" selector=".admin__control-select[name='product[shipment_type]']"/>
<element name="addOption" type="button" selector="button[data-index='add_button']"/>
<element name="firstOptionTitle" type="input" selector="[name='bundle_options[bundle_options][0][title]']"/>
<element name="firstInputType" type="select" selector="[name='bundle_options[bundle_options][0][type]']"/>
<element name="firstRequired" type="checkbox" selector="[name='bundle_options[bundle_options][0][required]']"/>
<element name="firstProductQuantity" type="input" selector="[name='bundle_options[bundle_options][0][bundle_selections][0][selection_qty]']"/>
<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="bundleOptionXRequired" type="checkbox" selector="[name='bundle_options[bundle_options][{{x}}][required]']" parameterized="true"/>
<element name="bundleOptionXProductYQuantity" type="input" selector="[name='bundle_options[bundle_options][{{x}}][bundle_selections][{{y}}][selection_qty]']" parameterized="true"/>
<element name="addProductsToOption" type="button" selector="[data-index='modal_set']" timeout="30"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?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="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
<test name="AdminAddRemoveProductImageBundleProductTest">
<annotations>
<features value="Bundle"/>
<stories value="Bundle Product Add/Remove Images"/>
<title value="Admin should be able to add/remove images for a Bundle Product"/>
<description value="Admin should be able to add/remove images for a Bundle Product"/>
<severity value="MAJOR"/>
<testCaseId value="MC-115"/>
<group value="Bundle"/>
</annotations>
<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct1"/>
<createData entity="SimpleProduct2" stepKey="simpleProduct2"/>
</before>
<after>
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
<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"/>
<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="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow"/>
<actionGroup ref="filterProductGridBySku" stepKey="filterBundleProductOptions2">
<argument name="product" value="$$simpleProduct2$$"/>
</actionGroup>
<checkOption selector="{{AdminAddProductsToOptionPanel.firstCheckbox}}" stepKey="selectFirstGridRow2"/>
<click selector="{{AdminAddProductsToOptionPanel.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"/>

<!-- Add image to product -->
<actionGroup ref="addProductImage" stepKey="addImageForProduct">
<argument name="image" value="MagentoLogo"/>
</actionGroup>

<!--Save product-->
<actionGroup ref="saveProductForm" stepKey="saveProduct"/>

<!-- Assert product image in admin product form -->
<actionGroup ref="assertProductImageAdminProductPage" stepKey="assertProductImageAdminProductPage"/>

<!-- Assert product in storefront product page -->
<actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPage">
<argument name="product" value="BundleProduct"/>
</actionGroup>

<!-- Assert product image in storefront product page -->
<actionGroup ref="assertProductImageStorefrontProductPage" stepKey="assertProductImageStorefrontProductPage">
<argument name="product" value="BundleProduct"/>
<argument name="image" value="MagentoLogo"/>
</actionGroup>

<!-- Remove image from product -->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="adminProductIndexPageRemove"/>
<waitForPageLoad stepKey="waitForProductIndexPageLoad2"/>
<actionGroup ref="filterProductGridBySku" stepKey="filterProductGridBySku">
<argument name="product" value="BundleProduct"/>
</actionGroup>
<actionGroup ref="openProducForEditByClickingRowXColumnYInProductGrid" stepKey="openProducForEditByClickingRow1Column2InProductGrid"/>
<actionGroup ref="removeProductImage" stepKey="removeProductImage"/>

<!-- Skip success message check when saving product because of bug MAGETWO-91177 -->
<!-- actionGroup ref="saveProductForm" stepKey="saveProductFormAfterRemove"/-->
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProductFormAfterRemove"/>

<!-- Assert product image not in admin product form -->
<actionGroup ref="assertProductImageNotInAdminProductPage" stepKey="assertProductImageNotInAdminProductPage"/>

<!-- Assert product in storefront product page -->
<actionGroup ref="AssertProductNameAndSkuInStorefrontProductPage" stepKey="AssertProductInStorefrontProductPageAfterRemove">
<argument name="product" value="BundleProduct"/>
</actionGroup>
<!-- Assert product image not in storefront product page -->
<actionGroup ref="assertProductImageNotInStorefrontProductPage" stepKey="assertProductImageNotInStorefrontProductPage">
<argument name="product" value="BundleProduct"/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,41 @@
<arguments>
<argument name="product" defaultValue="_defaultProduct"/>
</arguments>
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductSku"/>
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductName"/>
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductName"/>
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductSku"/>
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="fillProductPrice"/>
<fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{product.quantity}}" stepKey="fillProductQty"/>
<selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{product.status}}" stepKey="selectStockStatus"/>
<selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="This item has weight" stepKey="selectWeight"/>
<fillField selector="{{AdminProductFormSection.productWeight}}" userInput="{{product.weight}}" stepKey="fillProductWeight"/>
</actionGroup>

<!--Fill main fields in create product form with no weight, useful for virtual and downloadable products -->
<actionGroup name="fillMainProductFormNoWeight">
<arguments>
<argument name="product" defaultValue="DownloadableProduct"/>
</arguments>
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductName"/>
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductSku"/>
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="{{product.price}}" stepKey="fillProductPrice"/>
<fillField selector="{{AdminProductFormSection.productQuantity}}" userInput="{{product.quantity}}" stepKey="fillProductQty"/>
<selectOption selector="{{AdminProductFormSection.productStockStatus}}" userInput="{{product.status}}" stepKey="selectStockStatus"/>
<selectOption selector="{{AdminProductFormSection.productWeightSelect}}" userInput="This item has no weight" stepKey="selectWeight"/>
</actionGroup>

<!--Fill main fields in create product form with name and sku -->
<actionGroup name="fillProductNameAndSkuInProductForm">
<arguments>
<argument name="product"/>
</arguments>
<fillField selector="{{AdminProductFormSection.productName}}" userInput="{{product.name}}" stepKey="fillProductName"/>
<fillField selector="{{AdminProductFormSection.productSku}}" userInput="{{product.sku}}" stepKey="fillProductSku"/>
</actionGroup>

<!--Check that required fields are actually required-->
<actionGroup name="checkRequiredFieldsInProductForm">
<clearField selector="{{AdminProductFormSection.productName}}" stepKey="clearProductSku"/>
<clearField selector="{{AdminProductFormSection.productSku}}" stepKey="clearProductName"/>
<clearField selector="{{AdminProductFormSection.productName}}" stepKey="clearProductName"/>
<clearField selector="{{AdminProductFormSection.productSku}}" stepKey="clearProductSku"/>
<clearField selector="{{AdminProductFormSection.productPrice}}" stepKey="clearProductPrice"/>
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveButton"/>
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Product" stepKey="seeStillOnEditPage"/>
Expand Down Expand Up @@ -64,6 +87,33 @@
<waitForLoadingMaskToDisappear stepKey="waitForLoading"/>
</actionGroup>

<!--Remove image for product-->
<actionGroup name="removeProductImage">
<conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSection"/>
<waitForPageLoad time="30" stepKey="waitForPageRefresh"/>
<click selector="{{AdminProductImagesSection.removeImageButton}}" stepKey="clickRemoveImage"/>
</actionGroup>

<!-- Assert product image in Admin Product page -->
<actionGroup name="assertProductImageAdminProductPage">
<arguments>
<argument name="image" defaultValue="MagentoLogo"/>
</arguments>
<conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSection"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<seeElement selector="{{AdminProductImagesSection.imageFile(image.filename)}}" stepKey="seeImage"/>
</actionGroup>

<!-- Assert no product image in Admin Product page -->
<actionGroup name="assertProductImageNotInAdminProductPage">
<arguments>
<argument name="image" defaultValue="MagentoLogo"/>
</arguments>
<conditionalClick selector="{{AdminProductImagesSection.productImagesToggle}}" dependentSelector="{{AdminProductImagesSection.imageUploadButton}}" visible="false" stepKey="openProductImagesSection"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<dontSeeElement selector="{{AdminProductImagesSection.imageFile(image.filename)}}" stepKey="seeImage"/>
</actionGroup>

<!--Fill fields for simple product in a category in Admin-->
<actionGroup name="FillAdminSimpleProductForm">
<arguments>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/>
</actionGroup>

<!--Filter the product grid by the SKU string -->
<actionGroup name="filterProductGridBySku2">
<arguments>
<argument name="sku" type="string"/>
</arguments>
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
<click selector="{{AdminProductGridFilterSection.filters}}" stepKey="openProductFilters"/>
<fillField selector="{{AdminProductGridFilterSection.skuFilter}}" userInput="{{sku}}" stepKey="fillProductSkuFilter"/>
<click selector="{{AdminProductGridFilterSection.applyFilters}}" stepKey="clickApplyFilters"/>
<waitForElementNotVisible selector="{{AdminProductGridSection.loadingMask}}" stepKey="waitForFilteredGridLoad" time="30"/>
</actionGroup>

<!--Filter the product grid by the Name field-->
<actionGroup name="filterProductGridByName">
<arguments>
Expand Down Expand Up @@ -82,6 +94,17 @@
<click selector="{{AdminProductGridFilterSection.keywordSearchButton}}" stepKey="clickKeywordSearch"/>
</actionGroup>

<!--Search product grid with keyword search-->
<!-- Argument type: string (see more in MQE-965) -->
<actionGroup name="searchProductGridByKeyword2">
<arguments>
<argument name="keyword" type="string"/>
</arguments>
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
<fillField selector="{{AdminProductGridFilterSection.keywordSearch}}" userInput="{{keyword}}" stepKey="fillKeywordSearchField"/>
<click selector="{{AdminProductGridFilterSection.keywordSearchButton}}" stepKey="clickKeywordSearch"/>
</actionGroup>

<!--Filter product grid by name, sku, and type; and see expected product-->
<actionGroup name="viewProductInAdminGrid">
<arguments>
Expand Down Expand Up @@ -121,4 +144,24 @@
<click selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="confirmProductDelete"/>
</actionGroup>

<!--Open product for edit by clicking row X and column Y in product grid-->
<actionGroup name="openProducForEditByClickingRowXColumnYInProductGrid">
<arguments>
<argument name="X" type="string" defaultValue="1"/>
<argument name="Y" type="string" defaultValue="2"/>
</arguments>
<click selector="{{AdminProductGridSection.productGridXRowYColumnButton(X, Y)}}" stepKey="openProductForEdit"/>
</actionGroup>

<!-- Sort products by ID descending -->
<actionGroup name="sortProductsByIdDescending">
<conditionalClick selector="{{AdminProductGridTableHeaderSection.id('ascend')}}" dependentSelector="{{AdminProductGridTableHeaderSection.id('descend')}}" visible="false" stepKey="sortById"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
</actionGroup>

<!-- Sort products by ID ascending -->
<actionGroup name="sortProductsByIdAscending">
<conditionalClick selector="{{AdminProductGridTableHeaderSection.id('descend')}}" dependentSelector="{{AdminProductGridTableHeaderSection.id('ascend')}}" visible="false" stepKey="sortById"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
</actionGroup>
</actionGroups>
Loading

0 comments on commit 2466fae

Please sign in to comment.