Skip to content

Commit 0471e4e

Browse files
committed
add MFTF test
1 parent 75a5f25 commit 0471e4e

5 files changed

+192
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AddVisualSwatchToProductWithOutCreatedActionGroup">
12+
<annotations>
13+
<description>Does not create an attribute. Adds the provided Visual Swatch Attribute and Options (2) to a Product on the Admin Product creation/edit page. Clicks on Save. Validates that the Success Message is present. </description>
14+
</annotations>
15+
<arguments>
16+
<argument name="attribute" defaultValue="visualSwatchAttribute"/>
17+
</arguments>
18+
19+
<seeInCurrentUrl url="{{ProductCatalogPage.url}}" stepKey="seeOnProductEditPage"/>
20+
<conditionalClick selector="{{AdminProductFormConfigurationsSection.sectionHeader}}" dependentSelector="{{AdminProductFormConfigurationsSection.createConfigurations}}" visible="false" stepKey="openConfigurationSection"/>
21+
<click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="openConfigurationPanel"/>
22+
<waitForElementVisible selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="waitForSlideOut"/>
23+
24+
<!--Find attribute in grid and select-->
25+
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearExistingFilters"/>
26+
<click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="clickOnFilters"/>
27+
<fillField selector="{{AdminDataGridHeaderSection.attributeCodeFilterInput}}" userInput="{{attribute.default_label}}" stepKey="fillFilterAttributeCodeField"/>
28+
<click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickApplyFiltersButton"/>
29+
<click selector="{{AdminDataGridTableSection.rowCheckbox('1')}}" stepKey="clickOnFirstCheckbox"/>
30+
31+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextStep1"/>
32+
33+
<click selector="{{AdminCreateProductConfigurationsPanel.selectAllByAttribute(attribute.default_label)}}" stepKey="clickSelectAll"/>
34+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNextStep2"/>
35+
36+
<click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/>
37+
<fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="100" stepKey="enterAttributeQuantity"/>
38+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextStep3"/>
39+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="generateProducts"/>
40+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/>
41+
<seeElement selector="{{AdminMessagesSection.success}}" stepKey="seeSaveProductMessage"/>
42+
</actionGroup>
43+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<!--Click a swatch option on product page-->
12+
<actionGroup name="StorefrontSelectVisualSwatchOptionOnCategoryPageActionGroup">
13+
<arguments>
14+
<argument name="productId" type="string"/>
15+
<argument name="visualSwatchOptionLabel" type="string" />
16+
</arguments>
17+
<click selector="{{StorefrontCategoryPageProductInfoSection.visualSwatchOption(productId,visualSwatchOptionLabel)}}" stepKey="clickSwatchOption"/>
18+
</actionGroup>
19+
</actionGroups>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="StorefrontCategoryPageProductInfoSection">
12+
<element name="visualSwatchOption" type="button" selector="#product-item-info_{{var1}} .swatch-option[data-option-label='{{var2}}']" parameterized="true"/>
13+
<element name="productAddToWishlist" type="button" selector="#product-item-info_{{var1}} .action.towishlist" parameterized="true"/>
14+
</section>
15+
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontCustomerAddProductToWishlistCategoryPageActionGroup">
12+
<annotations>
13+
<description>Adds the provided Product to the Wish List from the Storefront Category page. Validates that the Success Message is present and correct.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="productVar"/>
17+
</arguments>
18+
19+
<click selector="{{StorefrontCategoryPageProductInfoSection.productAddToWishlist(productVar.id)}}" stepKey="addProductToWishlistClickAddToWishlist"/>
20+
<waitForElement selector="{{StorefrontCustomerWishlistSection.successMsg}}" time="30" stepKey="addProductToWishlistWaitForSuccessMessage"/>
21+
<see selector="{{StorefrontCustomerWishlistSection.successMsg}}" userInput="{{productVar.name}} has been added to your Wish List. Click here to continue shopping." stepKey="addProductToWishlistSeeProductNameAddedToWishlist"/>
22+
<seeCurrentUrlMatches regex="~/wishlist_id/\d+/$~" stepKey="seeCurrentUrlMatches"/>
23+
</actionGroup>
24+
</actionGroups>
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontCheckOptionsConfigurableProductInWishlistTest">
12+
<annotations>
13+
<stories value="Wishlist"/>
14+
<title value="Move first Configurable Product with selected optional from Category Page to Wishlist."/>
15+
<description value="Move first Configurable Product with selected optional from Category Page to Wishlist. On Page will be present minimum two Configurable Product"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="MC-14211"/>
18+
<group value="wishlist"/>
19+
</annotations>
20+
<before>
21+
<createData entity="ApiCategory" stepKey="createCategory"/>
22+
<createData entity="ApiConfigurableProduct" stepKey="createFirstConfigProduct">
23+
<requiredEntity createDataKey="createCategory"/>
24+
</createData>
25+
<createData entity="ApiConfigurableProduct" stepKey="createSecondConfigProduct">
26+
<requiredEntity createDataKey="createCategory"/>
27+
</createData>
28+
<createData entity="Simple_US_Customer" stepKey="customer"/>
29+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
30+
<argument name="indices" value=""/>
31+
</actionGroup>
32+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
33+
<argument name="tags" value=""/>
34+
</actionGroup>
35+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
36+
</before>
37+
<after>
38+
<deleteData createDataKey="customer" stepKey="deleteCustomer"/>
39+
<actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteFirstProducts">
40+
<argument name="sku" value="$$createFirstConfigProduct.sku$$"/>
41+
</actionGroup>
42+
<actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteSecondProducts">
43+
<argument name="sku" value="$$createSecondConfigProduct.sku$$"/>
44+
</actionGroup>
45+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
46+
<actionGroup ref="AdminDeleteProductAttributeByLabelActionGroup" stepKey="deleteAttribute" >
47+
<argument name="productAttributeLabel" value="{{visualSwatchAttribute.default_label}}"/>
48+
</actionGroup>
49+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
50+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
51+
<argument name="indices" value=""/>
52+
</actionGroup>
53+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
54+
<argument name="tags" value=""/>
55+
</actionGroup>
56+
</after>
57+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="navigateToFirstConfigProductPage">
58+
<argument name="productId" value="$$createFirstConfigProduct.id$$"/>
59+
</actionGroup>
60+
<waitForPageLoad stepKey="waitForFirstProductPageLoad"/>
61+
<actionGroup ref="AddVisualSwatchToProductWithStorefrontConfigActionGroup" stepKey="addSwatchToFirstProduct">
62+
<argument name="attribute" value="visualSwatchAttribute"/>
63+
<argument name="option1" value="visualSwatchOption1"/>
64+
<argument name="option2" value="visualSwatchOption2"/>
65+
</actionGroup>
66+
67+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="navigateToSecondConfigProductPage">
68+
<argument name="productId" value="$$createSecondConfigProduct.id$$"/>
69+
</actionGroup>
70+
<waitForPageLoad stepKey="waitForSecondProductPageLoad"/>
71+
<actionGroup ref="AddVisualSwatchToProductWithOutCreatedActionGroup" stepKey="addSwatchToSecondProduct">
72+
<argument name="attribute" value="visualSwatchAttribute"/>
73+
</actionGroup>
74+
75+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
76+
<argument name="Customer" value="$$customer$$"/>
77+
</actionGroup>
78+
<actionGroup ref="StorefrontGoToCategoryPageActionGroup" stepKey="openCategoryPage">
79+
<argument name="categoryName" value="$$createCategory.name$$"/>
80+
</actionGroup>
81+
<actionGroup ref="StorefrontSelectVisualSwatchOptionOnCategoryPageActionGroup" stepKey="selectVisualSwatch">
82+
<argument name="productId" value="$$createFirstConfigProduct.id$$" />
83+
<argument name="visualSwatchOptionLabel" value="{{visualSwatchOption1.default_label}}" />
84+
</actionGroup>
85+
<actionGroup ref="StorefrontCustomerAddProductToWishlistCategoryPageActionGroup" stepKey="addToWishlistProduct">
86+
<argument name="productVar" value="$$createFirstConfigProduct$$"/>
87+
</actionGroup>
88+
89+
<seeElement selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsByName($$createFirstConfigProduct.name$$)}}" stepKey="seeDetails"/>
90+
</test>
91+
</tests>

0 commit comments

Comments
 (0)