Skip to content

Commit deb5586

Browse files
committed
MFTF test, covered change
1 parent 1486300 commit deb5586

6 files changed

+214
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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="StorefrontCheckNoAppearDefaultOptionConfigurableProductTest">
12+
<annotations>
13+
<stories value="Configurable Product"/>
14+
<title value="Check for Configurable Product the default option doesn't appear."/>
15+
<description value="Check for Configurable Product the default option doesn't appear on the list options product when an option use."/>
16+
</annotations>
17+
<before>
18+
<createData entity="ApiCategory" stepKey="createCategory"/>
19+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/>
20+
</before>
21+
<after>
22+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
23+
<actionGroup ref="AdminDeleteProductAttributeByLabelActionGroup" stepKey="deleteAttribute">
24+
<argument name="productAttributeLabel" value="{{colorProductAttribute.default_label}}" />
25+
</actionGroup>
26+
<actionGroup ref="AdminLogoutActionGroup" stepKey="adminLogout"/>
27+
</after>
28+
29+
<actionGroup ref="AdminFillBasicValueConfigurableProductActionGroup" stepKey="fillBasicValue">
30+
<argument name="product" value="_defaultProduct"/>
31+
<argument name="category" value="$$createCategory$$"/>
32+
</actionGroup>
33+
<actionGroup ref="AdminAddOptionsToAttributeWithDefaultLayeredNavigationActionGroup" stepKey="createOptions"/>
34+
<actionGroup ref="AdminGotoSelectValueAttributePageActionGroup" stepKey="gotoSelectValuePage">
35+
<argument name="defaultLabelAttribute" value="{{colorProductAttribute.default_label}}"/>
36+
</actionGroup>
37+
<actionGroup ref="AdminSelectValueFromAttributeActionGroup" stepKey="selectColorProductAttribute2">
38+
<argument name="option" value="colorProductAttribute2"/>
39+
</actionGroup>
40+
<actionGroup ref="AdminSelectValueFromAttributeActionGroup" stepKey="selectColorProductAttribute3">
41+
<argument name="option" value="colorProductAttribute3"/>
42+
</actionGroup>
43+
<actionGroup ref="AdminSetQuantityToEachSkusConfigurableProductActionGroup" stepKey="saveConfigurable"/>
44+
<grabValueFrom selector="{{NewProductPageSection.sku}}" stepKey="grabSkuProduct"/>
45+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
46+
47+
<actionGroup ref="SelectStorefrontSideBarAttributeOption" stepKey="expandOption">
48+
<argument name="categoryName" value="$$createCategory.name$$"/>
49+
<argument name="attributeDefaultLabel" value="{{colorProductAttribute.default_label}}"/>
50+
</actionGroup>
51+
<dontSeeElement selector="{{LayeredNavigationSection.filterOptionContent(colorProductAttribute.default_label,colorProductAttribute1.name)}}" stepKey="dontSeeCaptchaField"/>
52+
<actionGroup ref="DeleteProductBySkuActionGroup" stepKey="deleteConfigurableProduct">
53+
<argument name="sku" value="$grabSkuProduct"/>
54+
</actionGroup>
55+
</test>
56+
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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="AdminAddOptionsToAttributeWithDefaultLayeredNavigationActionGroup">
12+
<annotations>
13+
<description>Adds 3 provided Options to a new Attribute on the Configurable Product creation/edit page. Selected default first option. Set "Use in Layered Navigation" to "Yes".</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="label" defaultValue="colorProductAttribute" />
17+
<argument name="option1" defaultValue="colorProductAttribute1"/>
18+
<argument name="option2" defaultValue="colorProductAttribute2"/>
19+
<argument name="option3" defaultValue="colorProductAttribute3"/>
20+
</arguments>
21+
22+
<click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnCreateConfigurations"/>
23+
<click selector="{{AdminCreateProductConfigurationsPanel.createNewAttribute}}" stepKey="clickOnNewAttribute"/>
24+
<waitForPageLoad stepKey="waitForIFrame"/>
25+
<switchToIFrame selector="{{AdminNewAttributePanel.newAttributeIFrame}}" stepKey="switchToNewAttributeIFrame"/>
26+
<fillField selector="{{AdminNewAttributePanel.defaultLabel}}" userInput="{{label.default_label}}" stepKey="fillDefaultLabel"/>
27+
28+
<!--Add option 1 to attribute-->
29+
<click selector="{{AdminNewAttributePanel.addOption}}" stepKey="clickAddOption1"/>
30+
<waitForElementVisible selector="{{AdminNewAttributePanel.isDefault('1')}}" time="30" stepKey="waitForOptionRow1" after="clickAddOption1"/>
31+
<fillField selector="{{AdminNewAttributePanel.optionAdminValue('0')}}" userInput="{{option1.name}}" stepKey="fillAdminLabel1" after="waitForOptionRow1"/>
32+
<click selector="{{AdminNewAttributePanel.isDefault('1')}}" stepKey="selectDefault" after="fillAdminLabel1"/>
33+
34+
<!--Add option 2 to attribute-->
35+
<click selector="{{AdminNewAttributePanel.addOption}}" stepKey="clickAddOption2" after="selectDefault"/>
36+
<waitForElementVisible selector="{{AdminNewAttributePanel.isDefault('2')}}" time="30" stepKey="waitForOptionRow2" after="clickAddOption2"/>
37+
<fillField selector="{{AdminNewAttributePanel.optionAdminValue('1')}}" userInput="{{option2.name}}" stepKey="fillAdminLabel2" after="waitForOptionRow2"/>
38+
39+
<!--Add option 3 to attribute-->
40+
<click selector="{{AdminNewAttributePanel.addOption}}" stepKey="clickAddOption3" after="fillAdminLabel2"/>
41+
<waitForElementVisible selector="{{AdminNewAttributePanel.isDefault('3')}}" time="30" stepKey="waitForOptionRow3" after="clickAddOption3"/>
42+
<fillField selector="{{AdminNewAttributePanel.optionAdminValue('2')}}" userInput="{{option3.name}}" stepKey="fillAdminLabel3" after="waitForOptionRow3"/>
43+
44+
<!-- Set Use In Layered Navigation -->
45+
<click selector="{{AdminNewAttributePanel.storefrontPropertiesTab}}" stepKey="goToStorefrontPropertiesTab" after="fillAdminLabel3"/>
46+
<waitForElementVisible selector="{{AdminNewAttributePanel.storefrontPropertiesTitle}}" stepKey="waitTabLoad" after="goToStorefrontPropertiesTab"/>
47+
<selectOption selector="{{AdminNewAttributePanel.useInLayeredNavigation}}" stepKey="selectUseInLayer" userInput="Filterable (with results)" after="waitTabLoad"/>
48+
49+
<!--Save attribute-->
50+
<click selector="{{AdminNewAttributePanel.saveAttribute}}" stepKey="clickSaveAttribute"/>
51+
<waitForPageLoad stepKey="waitForSavingAttribute"/>
52+
</actionGroup>
53+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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="AdminFillBasicValueConfigurableProductActionGroup">
12+
<annotations>
13+
<description>Goes to the Admin Product grid page. Fill basic value for Configurable Product using the default Product Options.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="product" defaultValue="_defaultProduct"/>
17+
<argument name="category" defaultValue="_defaultCategory"/>
18+
</arguments>
19+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="amOnProductGridPage"/>
20+
<waitForPageLoad time="30" stepKey="wait1"/>
21+
<click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickOnAddProductToggle"/>
22+
<click selector="{{AdminProductGridActionSection.addConfigurableProduct}}" stepKey="clickOnAddConfigurableProduct"/>
23+
<fillField userInput="{{product.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillName"/>
24+
<fillField userInput="{{product.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillSKU"/>
25+
<fillField userInput="{{product.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillPrice"/>
26+
<fillField userInput="{{product.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillQuantity"/>
27+
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{category.name}}]" stepKey="fillCategory"/>
28+
<selectOption userInput="{{product.visibility}}" selector="{{AdminProductFormSection.visibility}}" stepKey="fillVisibility"/>
29+
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/>
30+
<fillField userInput="{{product.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/>
31+
</actionGroup>
32+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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="AdminGotoSelectValueAttributePageActionGroup">
12+
<annotations>
13+
<description>Goes to the select values page from each attribute to include in the product.</description>
14+
</annotations>
15+
16+
<arguments>
17+
<argument name="defaultLabelAttribute" type="string" defaultValue="{{colorProductAttribute.default_label}}"/>
18+
</arguments>
19+
20+
<click selector="{{AdminCreateProductConfigurationsPanel.filters}}" stepKey="clickOnFilters"/>
21+
<fillField selector="{{AdminCreateProductConfigurationsPanel.attributeCode}}" userInput="{{defaultLabelAttribute}}" stepKey="fillFilterAttributeCodeField"/>
22+
<click selector="{{AdminCreateProductConfigurationsPanel.applyFilters}}" stepKey="clickApplyFiltersButton"/>
23+
<click selector="{{AdminCreateProductConfigurationsPanel.firstCheckbox}}" stepKey="clickOnFirstCheckbox"/>
24+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton"/>
25+
26+
</actionGroup>
27+
</actionGroups>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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="AdminSelectValueFromAttributeActionGroup">
12+
<annotations>
13+
<description>Click to check option.</description>
14+
</annotations>
15+
16+
<arguments>
17+
<argument name="option" defaultValue="colorProductAttribute1"/>
18+
</arguments>
19+
<click selector="{{AdminCreateProductConfigurationsPanel.attributeOption(option.name)}}" stepKey="clickOnCreateNewValue2"/>
20+
</actionGroup>
21+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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="AdminSetQuantityToEachSkusConfigurableProductActionGroup">
12+
<annotations>
13+
<description>Set quantity 1 to all child skus for configurable product. Save a configurable product and confirm.</description>
14+
</annotations>
15+
16+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton2"/>
17+
<click selector="{{AdminCreateProductConfigurationsPanel.applySingleQuantityToEachSkus}}" stepKey="clickOnApplySingleQuantityToEachSku"/>
18+
<fillField selector="{{AdminCreateProductConfigurationsPanel.quantity}}" userInput="1" stepKey="enterAttributeQuantity"/>
19+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton3"/>
20+
<click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickOnNextButton4"/>
21+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/>
22+
<click selector="{{AdminChooseAffectedAttributeSetPopup.confirm}}" stepKey="clickOnConfirmInPopup"/>
23+
<seeElement selector="{{AdminProductMessagesSection.successMessage}}" stepKey="seeSaveProductMessage"/>
24+
</actionGroup>
25+
</actionGroups>

0 commit comments

Comments
 (0)