Skip to content

Commit

Permalink
Merge pull request #2817 from magento-tsg/2.2-develop-mftf-pr2
Browse files Browse the repository at this point in the history
[TSG] MFTF for 2.2 (pr2) (2.2.6)
  • Loading branch information
Alexander Akimov authored Jul 11, 2018
2 parents 856def3 + b4ddee9 commit 9d74001
Show file tree
Hide file tree
Showing 47 changed files with 1,205 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?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="AdminPromptModalSection">
<element name="promptField" type="input" selector="input[data-role='promptField']"/>
<element name="modalOk" type="button" selector="aside.prompt .modal-footer button.action-accept" timeout="30"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">

<!--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>

<!--Save product and see success message-->
<actionGroup name="saveProductForm">
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/>
<see selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product." stepKey="seeSaveConfirmation"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssignAttributeToGroup">
<arguments>
<argument name="group" type="string"/>
<argument name="attribute" type="string"/>
</arguments>
<conditionalClick selector="{{AdminProductAttributeSetEditSection.attributeGroupExtender(group)}}" dependentSelector="{{AdminProductAttributeSetEditSection.attributeGroupCollapsed(group)}}" visible="true" stepKey="extendGroup"/>
<waitForPageLoad stepKey="waitForPageLoad1"/>
<dragAndDrop selector1="{{AdminProductAttributeSetEditSection.unassignedAttribute(attribute)}}" selector2="{{AdminProductAttributeSetEditSection.lineItemAttributeGroup(group, '1')}}" stepKey="dragAndDropToGroupProductDetails"/>
<waitForPageLoad stepKey="waitForPageLoad2"/>
<see userInput="{{attribute}}" selector="{{AdminProductAttributeSetEditSection.groupTree}}" stepKey="seeAttributeInGroup"/>
</actionGroup>
<actionGroup name="UnassignAttributeFromGroup">
<arguments>
<argument name="group" type="string"/>
<argument name="attribute" type="string"/>
</arguments>
<conditionalClick selector="{{AdminProductAttributeSetEditSection.attributeGroupExtender(group)}}" dependentSelector="{{AdminProductAttributeSetEditSection.attributeGroupCollapsed(group)}}" visible="true" stepKey="extendGroup"/>
<waitForPageLoad stepKey="waitForPageLoad1"/>
<dragAndDrop selector1="{{AdminProductAttributeSetEditSection.assignedAttribute(attribute)}}" selector2="{{AdminProductAttributeSetEditSection.lineItemUnassignedAttribute('1')}}" stepKey="dragAndDropToUnassigned"/>
<waitForPageLoad stepKey="waitForPageLoad2"/>
<see userInput="{{attribute}}" selector="{{AdminProductAttributeSetEditSection.unassignedAttributesTree}}" stepKey="seeAttributeInUnassigned"/>
</actionGroup>
<actionGroup name="SaveAttributeSet">
<click selector="{{AdminProductAttributeSetActionSection.save}}" stepKey="clickSave"/>
<see userInput="You saved the attribute set" selector="{{AdminMessagesSection.success}}" stepKey="successMessage"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
<!--Reset the product grid to the default view-->
<actionGroup name="AdminResetProductGridToDefaultViewActionGroup">
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
<click selector="{{AdminProductGridFilterSection.viewDropdown}}" stepKey="openViewBookmarksTab"/>
<waitForElementVisible selector="{{AdminProductGridFilterSection.viewBookmark('Default View')}}" time="10" stepKey="waitForViewBookmarkElementVisible"/>
<click selector="{{AdminProductGridFilterSection.viewBookmark('Default View')}}" stepKey="resetToDefaultGridView"/>
<see selector="{{AdminProductGridFilterSection.viewDropdown}}" userInput="Default View" stepKey="seeDefaultViewSelected"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
<actionGroup name="CheckAttributeInAdditionalInformationTabActionGroup">
<arguments>
<argument name="attributeLabel" type="string"/>
<argument name="attributeValue" type="string"/>
</arguments>
<click selector="{{StorefrontProductAdditionalInformationSection.additionalInfoTab}}" stepKey="clickTab"/>
<see userInput="{{attributeLabel}}" selector=" {{StorefrontProductAdditionalInformationSection.attributeLabel}}" stepKey="seeAttributeLabel"/>
<see userInput="{{attributeValue}}" selector="{{StorefrontProductAdditionalInformationSection.attributeValue}}" stepKey="seeAttributeValue"/>
</actionGroup>
</actionGroups>
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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
<actionGroup name="CheckAttributeNotInAdditionalInformationTabActionGroup">
<arguments>
<argument name="attributeLabel" type="string"/>
</arguments>
<conditionalClick selector="{{StorefrontProductAdditionalInformationSection.additionalInfoTab}}" dependentSelector="{{StorefrontProductAdditionalInformationSection.additionalInfoTab}}" visible="true" stepKey="clickTab"/>
<dontSee userInput="{{attributeLabel}}" selector="{{StorefrontProductAdditionalInformationSection.additionalInfoContainer}}" stepKey="dontSeeAttributeLabel"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
<!-- Create a new attribute set -->
<actionGroup name="CreateAttributeSetActionGroup">
<arguments>
<argument name="nameLabel" type="string"/>
<argument name="basedOn" defaultValue="Default" type="string"/>
</arguments>
<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSets"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<click selector="{{AdminProductAttributeSetGridSection.addAttributeSetBtn}}" stepKey="clickAddAttributeSet"/>
<fillField selector="{{AdminProductAttributeSetSection.name}}" userInput="{{nameLabel}}" stepKey="fillName"/>
<selectOption selector="{{AdminProductAttributeSetSection.basedOn}}" userInput="{{basedOn}}" stepKey="selectDefaultSet"/>
<click selector="{{AdminProductAttributeSetSection.save}}" stepKey="clickSave"/>
<see userInput="You saved the attribute set." selector="{{AdminMessagesSection.success}}" stepKey="waitSuccessMessage"/>
</actionGroup>
</actionGroups>
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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
<actionGroup name="CreateNewGroupInAttributeSetActionGroup">
<arguments>
<argument name="groupName" type="string" defaultValue="TestGroupName"/>
</arguments>
<click selector="{{AdminProductAttributeSetSection.addNewGroupBtn}}" stepKey="clickAddNewGroup"/>
<waitForElementVisible selector="{{AdminPromptModalSection.promptField}}" stepKey="waitModalWindow"/>
<fillField selector="{{AdminPromptModalSection.promptField}}" userInput="{{groupName}}" stepKey="fillNewGroupName"/>
<click selector="{{AdminPromptModalSection.modalOk}}" stepKey="clickOkInModal"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?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="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
<!-- Delete attribute set -->
<actionGroup name="DeleteAttributeSetActionGroup">
<arguments>
<argument name="name" type="string"/>
</arguments>
<amOnPage url="{{AdminProductAttributeSetGridPage.url}}" stepKey="goToAttributeSets"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<fillField selector="{{AdminProductAttributeSetGridSection.attributeSetNameFilter}}" userInput="{{name}}" stepKey="filterByName"/>
<click selector="{{AdminProductAttributeSetGridSection.applyFilterButton}}" stepKey="clickSearch"/>
<click selector="{{AdminProductAttributeSetGridSection.attributeSetRowByIndex('1')}}" stepKey="clickFirstRow"/>
<waitForPageLoad stepKey="waitForPageLoad2"/>
<click selector="{{AdminProductAttributeSetSection.deleteBtn}}" stepKey="clickDelete"/>
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmDelete"/>
<waitForPageLoad stepKey="waitForPageLoad3"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<requiredEntity type="FrontendLabel">ProductAttributeFrontendLabel</requiredEntity>
</entity>
<entity name="productAttributeWithDropdownTwoOptions" type="ProductAttribute">
<data key="attribute_code">testattribute</data>
<data key="attribute_code" unique="suffix">testattribute</data>
<data key="frontend_input">select</data>
<data key="scope">global</data>
<data key="is_required">false</data>
Expand Down
25 changes: 14 additions & 11 deletions app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,6 @@
<data key="status">1</data>
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
</entity>
<entity name="VirtualProduct" type="product">
<data key="sku" unique="suffix">virtualproduct</data>
<data key="type_id">virtual</data>
<data key="attribute_set_id">4</data>
<data key="name" unique="suffix">VirtualProduct</data>
<data key="price">99.99</data>
<data key="quantity">250</data>
<data key="weight">0</data>
<data key="status">1</data>
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
</entity>
<entity name="SimpleProductWithNewFromDate" type="product">
<data key="sku" unique="suffix">SimpleProduct</data>
<data key="type_id">simple</data>
Expand Down Expand Up @@ -163,4 +152,18 @@
<requiredEntity type="media_gallery_entries">ProductAttributeMediaGalleryEntryMagentoLogo</requiredEntity>
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
</entity>
<entity name="ApiProductWithDescription" type="product">
<data key="sku" unique="suffix">api-simple-product</data>
<data key="type_id">simple</data>
<data key="attribute_set_id">4</data>
<data key="visibility">4</data>
<data key="name" unique="suffix">Api Simple Product</data>
<data key="price">123.00</data>
<data key="urlKey" unique="suffix">api-simple-product</data>
<data key="status">1</data>
<data key="quantity">100</data>
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
<requiredEntity type="custom_attribute_array">ApiProductDescription</requiredEntity>
<requiredEntity type="custom_attribute_array">ApiProductShortDescription</requiredEntity>
</entity>
</entities>
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="AdminProductAttributeSetEditPage" url="catalog/product_set/edit/id/{{var1}}" area="admin" module="Magento_Catalog" parameterized="true">
<section name="AdminProductAttributeSetEditSection"/>
<section name="AdminProductAttributeSetActionSection"/>
</page>
</pages>
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
<section name="AdminProductMessagesSection"/>
<section name="AdminMessagesSection"/>
<section name="AdminProductCustomizableOptionsSection" />
<section name="AdminProductFormAdvancedPricingSection"/>
</page>
</pages>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

<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="Category" parameterized="true">
<page name="StorefrontProductPage" url="/{{var1}}.html" area="storefront" module="Magento_Category" parameterized="true">
<section name="StorefrontProductPageSection"/>
<section name="StorefrontProductAdditionalInformationSection"/>
</page>
</pages>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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="AdminProductAttributeSetActionSection">
<element name="save" type="button" selector="button[title='Save']" timeout="30"/>
<element name="reset" type="button" selector="button[title='Reset']" timeout="30"/>
<element name="back" type="button" selector="button[title='Back']" timeout="30"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?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="AdminProductAttributeSetEditSection">
<!-- Groups Column -->
<element name="groupTree" type="block" selector="#tree-div1"/>
<element name="attributeGroup" type="text" selector="//*[@id='tree-div1']//span[text()='{{groupName}}']" parameterized="true"/>
<element name="attributeGroupExtender" type="button" selector="//*[@id='tree-div1']//span[text()='{{groupName}}']" parameterized="true"/>
<element name="attributeGroupCollapsed" type="button" selector="//*[@id='tree-div1']//span[text()='{{groupName}}']/parent::*/parent::*[contains(@class, 'collapsed')]" parameterized="true"/>
<element name="assignedAttribute" type="text" selector="//*[@id='tree-div1']//span[text()='{{attributeName}}']" parameterized="true"/>
<element name="lineItemYthAttributeGroup" type="text" selector="//*[@id='tree-div1']/ul/div/li[{{y}}]//li[{{x}}]" parameterized="true"/>
<element name="lineItemAttributeGroup" type="text" selector="//*[@id='tree-div1']//span[text()='{{groupName}}']/parent::*/parent::*/parent::*//li[{{x}}]//a/span" parameterized="true"/>
<!-- Unassigned Attributes Column -->
<element name="unassignedAttributesTree" type="block" selector="#tree-div2"/>
<element name="unassignedAttribute" type="text" selector="//*[@id='tree-div2']//span[text()='{{attributeName}}']" parameterized="true"/>
<element name="lineItemUnassignedAttribute" type="text" selector="//*[@id='tree-div2']//li[{{x}}]//a/span" parameterized="true"/>
</section>
</sections>
Loading

0 comments on commit 9d74001

Please sign in to comment.