-
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 #176 from magento-pangolin/MC-17552
MC-17552 Backport for MC-13641
- Loading branch information
Showing
10 changed files
with
250 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminDeleteProductBySkuActionGroup.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,30 @@ | ||
<?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"> | ||
<!-- Delete a product by filtering grid and using delete action--> | ||
<actionGroup name="AdminDeleteProductBySkuActionGroup"> | ||
<arguments> | ||
<argument name="sku" type="string"/> | ||
</arguments> | ||
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/> | ||
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.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"/> | ||
<see selector="{{AdminProductGridSection.productGridCell('1', 'SKU')}}" userInput="{{sku}}" stepKey="seeProductSkuInGrid"/> | ||
<click selector="{{AdminProductGridSection.multicheckDropdown}}" stepKey="openMulticheckDropdown"/> | ||
<click selector="{{AdminProductGridSection.multicheckOption('Select All')}}" stepKey="selectAllProductInFilteredGrid"/> | ||
<click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/> | ||
<click selector="{{AdminProductGridSection.bulkActionOption('Delete')}}" stepKey="clickDeleteAction"/> | ||
<waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForConfirmModal"/> | ||
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmProductDelete"/> | ||
<see selector="{{AdminMessagesSection.success}}" userInput="record(s) have been deleted." stepKey="seeSuccessMessage"/> | ||
</actionGroup> | ||
</actionGroups> |
28 changes: 28 additions & 0 deletions
28
...og/Test/Mftf/ActionGroup/AdminGenerateProductConfigurationsByAttributeCodeActionGroup.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,28 @@ | ||
<?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="AdminGenerateProductConfigurationsByAttributeCodeActionGroup"> | ||
<arguments> | ||
<argument name="attributeCode" type="string" defaultValue="SomeString"/> | ||
</arguments> | ||
<click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickCreateConfigurations"/> | ||
<click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickFilters"/> | ||
<fillField selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" userInput="{{attributeCode}}" stepKey="fillFilterAttributeCodeField"/> | ||
<click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/> | ||
<click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/> | ||
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton1"/> | ||
<click selector="{{AdminCreateProductConfigurationsPanel.selectAll}}" stepKey="clickOnSelectAll"/> | ||
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton2"/> | ||
<click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/> | ||
<fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="99" stepKey="enterAttributeQuantity"/> | ||
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton3"/> | ||
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton4"/> | ||
</actionGroup> | ||
</actionGroups> |
17 changes: 17 additions & 0 deletions
17
app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminOpenAttributeSetByNameActionGroup.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="AdminOpenAttributeSetByNameActionGroup"> | ||
<arguments> | ||
<argument name="attributeSetName" type="string" defaultValue="Default"/> | ||
</arguments> | ||
<click selector="{{AdminProductAttributeSetGridSection.attributeSetName(attributeSetName)}}" stepKey="chooseAttributeSet"/> | ||
<waitForPageLoad stepKey="waitForAttributeSetPageLoad"/> | ||
</actionGroup> | ||
</actionGroups> |
14 changes: 14 additions & 0 deletions
14
app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminOpenAttributeSetGridPageActionGroup.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. | ||
*/ | ||
--> | ||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminOpenAttributeSetGridPageActionGroup"> | ||
<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSetPage"/> | ||
<waitForPageLoad stepKey="waitForAttributeSetPageLoad"/> | ||
</actionGroup> | ||
</actionGroups> |
14 changes: 14 additions & 0 deletions
14
app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminOpenProductIndexPageActionGroup.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. | ||
*/ | ||
--> | ||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminOpenProductIndexPageActionGroup"> | ||
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndexPage"/> | ||
<waitForPageLoad stepKey="waitForProductIndexPageLoad"/> | ||
</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
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
120 changes: 120 additions & 0 deletions
120
...atalog/Test/Mftf/Test/AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest.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,120 @@ | ||
<?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="AdminSaveConfigurableProductWithAttributesImagesAndSwatchesTest"> | ||
<annotations> | ||
<features value="Catalog"/> | ||
<stories value="Product attributes"/> | ||
<title value="Saving configurable product with custom product attribute (images as swatches)"/> | ||
<description value="Saving configurable product with custom product attribute (images as swatches)"/> | ||
<severity value="CRITICAL"/> | ||
<testCaseId value="MC-17552"/> | ||
<group value="catalog"/> | ||
</annotations> | ||
<before> | ||
<!-- Login as admin --> | ||
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/> | ||
</before> | ||
<after> | ||
<!-- Admin logout --> | ||
<actionGroup ref="logout" stepKey="adminLogout"/> | ||
</after> | ||
|
||
<!-- Create a new product attribute: set Catalog Input Type for Store Owner: Visual Swatch --> | ||
<actionGroup ref="AdminFillProductAttributePropertiesActionGroup" stepKey="fillAttributeProperties"> | ||
<argument name="attributeCode" value="{{productVisualSwatchAttribute.attribute_code}}"/> | ||
<argument name="attributeType" value="{{productVisualSwatchAttribute.frontend_input}}"/> | ||
</actionGroup> | ||
|
||
<!-- Add a few Swatches and add images to Manage Swatch (Values of Your Attribute) | ||
1. Set swatch #1 using the color picker --> | ||
<click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddFirstSwatch"/> | ||
<actionGroup ref="openSwatchMenuByIndex" stepKey="clickFirstSwatch"> | ||
<argument name="index" value="0"/> | ||
</actionGroup> | ||
<click selector="{{AdminManageSwatchSection.chooseColorRow('1')}}" stepKey="clickChooseFirstColor"/> | ||
<actionGroup ref="setColorPickerValueByHex" stepKey="fillFirstHex"> | ||
<argument name="nthColorPicker" value="1"/> | ||
<argument name="hexColor" value="e74c3c"/> | ||
</actionGroup> | ||
<fillField selector="{{AdminManageSwatchSection.adminInputByIndex('0')}}" userInput="red" stepKey="fillFirstAdminField"/> | ||
|
||
<!-- 2. Set swatch #2 using the color picker --> | ||
<click selector="{{AdminManageSwatchSection.addSwatch}}" stepKey="clickAddSecondSwatch"/> | ||
<actionGroup ref="openSwatchMenuByIndex" stepKey="clickSecondSwatch"> | ||
<argument name="index" value="1"/> | ||
</actionGroup> | ||
<click selector="{{AdminManageSwatchSection.chooseColorRow('2')}}" stepKey="clickChooseSecondColor"/> | ||
<actionGroup ref="setColorPickerValueByHex" stepKey="fillSecondHex"> | ||
<argument name="nthColorPicker" value="2"/> | ||
<argument name="hexColor" value="3498db"/> | ||
</actionGroup> | ||
<fillField selector="{{AdminManageSwatchSection.adminInputByIndex('1')}}" userInput="blue" stepKey="fillSecondAdminField"/> | ||
|
||
<!-- Set Scope: Global in Advanced Attribute Properties --> | ||
<click selector="{{AttributePropertiesSection.AdvancedProperties}}" stepKey="expandAdvancedProperties"/> | ||
<selectOption selector="{{AttributePropertiesSection.scope}}" userInput="1" stepKey="selectGlobalScope"/> | ||
|
||
<!-- Click "Save Attribute" button --> | ||
<click selector="{{AttributePropertiesSection.saveAndEdit}}" stepKey="clickSaveAndEdit"/> | ||
<waitForElementVisible selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccessMessage"/> | ||
|
||
<!-- Add created product attribute to the Default set --> | ||
<actionGroup ref="AdminOpenAttributeSetGridPageActionGroup" stepKey="openAttributeSetPage"/> | ||
<actionGroup ref="AdminOpenAttributeSetByNameActionGroup" stepKey="openDefaultAttributeSet"/> | ||
<actionGroup ref="AssignAttributeToGroup" stepKey="assignAttributeToGroup"> | ||
<argument name="group" value="Product Details"/> | ||
<argument name="attribute" value="productVisualSwatchAttribute.attribute_code"/> | ||
</actionGroup> | ||
<actionGroup ref="SaveAttributeSet" stepKey="saveAttributeSet"/> | ||
|
||
<!-- Create configurable product --> | ||
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openOpenProductIndexPage"/> | ||
<actionGroup ref="goToCreateProductPage" stepKey="goToCreateConfigurableProduct"> | ||
<argument name="product" value="BaseConfigurableProduct"/> | ||
</actionGroup> | ||
|
||
<!-- Select Attribute Set --> | ||
<actionGroup ref="AssignProductToAttributeSet" stepKey="selectAttributeSet"> | ||
<argument name="attributeSetName" value="Default"/> | ||
</actionGroup> | ||
|
||
<!-- Fill all the necessary information such as weight, name, SKU etc --> | ||
<actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> | ||
<argument name="product" value="BaseConfigurableProduct"/> | ||
</actionGroup> | ||
|
||
<!-- Click "Create Configurations" button, select created product attribute using the same Quantity for all products. Click "Generate products" button --> | ||
<actionGroup ref="AdminGenerateProductConfigurationsByAttributeCodeActionGroup" stepKey="addAttributeToProduct"> | ||
<argument name="attributeCode" value="{{productVisualSwatchAttribute.attribute_code}}"/> | ||
</actionGroup> | ||
|
||
<!-- Using this action to concatenate 2 strings to have unique identifier for grid --> | ||
<executeJS function="return '{{productVisualSwatchAttribute.attribute_code}}: red'" stepKey="attributeCodeRed"/> | ||
<executeJS function="return '{{productVisualSwatchAttribute.attribute_code}}: blue'" stepKey="attributeCodeBlue"/> | ||
|
||
<!-- Add images for the products --> | ||
<attachFile selector="{{AdminDataGridTableSection.rowTemplate({$attributeCodeRed})}}{{AdminProductFormConfigurationsSection.fileUploaderInput}}" userInput="{{MagentoLogo.file}}" stepKey="uploadImageForFirstProduct"/> | ||
<attachFile selector="{{AdminDataGridTableSection.rowTemplate({$attributeCodeBlue})}}{{AdminProductFormConfigurationsSection.fileUploaderInput}}" userInput="{{ProductImage.file}}" stepKey="uploadImageForSecondProduct"/> | ||
|
||
<!-- Click "Save" button --> | ||
<actionGroup ref="saveProductForm" stepKey="clickSaveButton"/> | ||
|
||
<!-- Delete all created product --> | ||
<actionGroup ref="AdminDeleteProductBySkuActionGroup" stepKey="deleteCreatedProducts"> | ||
<argument name="sku" value="{{BaseConfigurableProduct.sku}}"/> | ||
</actionGroup> | ||
|
||
<!-- Delete product attribute --> | ||
<actionGroup ref="deleteProductAttribute" stepKey="deleteProductAttribute"> | ||
<argument name="ProductAttribute" value="productVisualSwatchAttribute"/> | ||
</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
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