Skip to content

Commit ad6b38e

Browse files
committed
Merge branch 'MC-234' into RE-develop
2 parents af966c9 + 6f13e93 commit ad6b38e

File tree

7 files changed

+80
-59
lines changed

7 files changed

+80
-59
lines changed

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/ActionGroup/AdminCategoryActionGroup.xml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,23 +123,24 @@
123123
<actionGroup name="FillNewProductCategory" >
124124
<arguments>
125125
<argument name="categoryName" defaultValue="Test Category" type="string"/>
126+
<argument name="parentCategoryName" defaultValue="default" type="string"/>
126127
</arguments>
127128

128129
<!-- Click on new Category -->
129-
<click stepKey="clickNewCategory" selector="{{AdminProductCategoryCreationSection.newCategory}}" />
130+
<click stepKey="clickNewCategory" selector="{{AdminProductCategoryCreationSection.newCategory}}"/>
130131
<waitForPageLoad stepKey="waitForFieldSet"/>
131132

132-
<fillField stepKey="fillCategoryName" selector="{{AdminProductCategoryCreationSection.nameInput}}" userInput="{{categoryName}}" />
133+
<fillField stepKey="fillCategoryName" selector="{{AdminProductCategoryCreationSection.nameInput}}" userInput="{{categoryName}}"/>
133134

134-
<click stepKey="clickParentCategory" selector="{{AdminProductCategoryCreationSection.parentCategory}}" />
135+
<!-- Search and select a parent catagory for the product -->
136+
<click stepKey="clickParentCategory" selector="{{AdminProductCategoryCreationSection.parentCategory}}"/>
135137
<waitForPageLoad stepKey="waitForDropDownVisible"/>
138+
<fillField stepKey="searchForParent" userInput="{{parentCategoryName}}" selector="{{AdminProductCategoryCreationSection.parentSearch}}"/>
139+
<waitForPageLoad stepKey="waitForFieldResults"/>
140+
<click stepKey="clickParent" selector="{{AdminProductCategoryCreationSection.parentSearchResult}}"/>
136141

137-
<click stepKey="clickDefaultParentCategory" selector="{{AdminProductCategoryCreationSection.parentCategoryDropdownDefaultOption}}" />
138-
139-
<click stepKey="createCategory" selector="{{AdminProductCategoryCreationSection.createCategory}}" />
140-
142+
<click stepKey="createCategory" selector="{{AdminProductCategoryCreationSection.createCategory}}"/>
141143
<waitForPageLoad stepKey="waitForCategoryCreated"/>
142-
143144
</actionGroup>
144145

145146
<!-- Actions to delete the category last made -->

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/ActionGroup/CustomOptionsActionGroup.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
<argument name="productOption2"/>
2121
</arguments>
2222

23-
<!-- opens the custom option panel and clicks add options -->
24-
<click stepKey="openCustomizableOptions" selector="{{AdminProductCustomizableOptionsSection.customezableOptions}}"/>
2523
<click stepKey="clickAddOptions" selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}"/>
24+
<waitForPageLoad stepKey="waitForAddProductPageLoad"/>
2625

2726
<!-- Fill in the option and select the type of radio (once) -->
2827
<fillField stepKey="fillInOptionTitle" selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" userInput="{{customOptionName}}"/>
2928
<click stepKey="clickOptionTypeParent" selector="{{AdminProductCustomizableOptionsSection.lastOptionTypeParent}}"/>
29+
<waitForPageLoad stepKey="waitForDropdownOpen"/>
3030
<click stepKey="clickOptionType" selector="{{AdminProductCustomizableOptionsSection.optionType('Radio Buttons')}}"/>
3131

3232
<!-- Add three radio options based on the parameter -->
@@ -40,8 +40,6 @@
4040
<fillField stepKey="fillInValueTitle2" selector="{{AdminProductCustomizableOptionsSection.valueTitle}}" userInput="{{productOption2.title}}"/>
4141
<fillField stepKey="fillInValuePrice2" selector="{{AdminProductCustomizableOptionsSection.valuePrice}}" userInput="{{productOption2.price}}"/>
4242

43-
<!-- close the custom option dropdown -->
44-
<click stepKey="closeCustomizableOptions" selector="{{AdminProductCustomizableOptionsSection.customezableOptions}}"/>
4543

4644
</actionGroup>
4745

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductAttributeSetSection.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
<element name="FolderName" type="text" selector="//span[text()='{{var1}}']" parameterized="true"/>
1919
</section>
2020
<section name="ModifyAttributes">
21-
<!-- Parameter is the order number of the attribute on the page (1 is the newest) -->
22-
<element name="nthExistingAttribute" type="block" selector=".admin__field:nth-of-type({{numElement}}) .admin__control-select" parameterized="true"/>
23-
<!-- First parameter is the order number of the attribute on the page, 2nd parameter is the number option in the dropdown (1 for blank) -->
24-
<element name="nthAttributeOption" type="block" selector=".admin__field:nth-of-type({{numElement}}) .admin__control-select option:nth-of-type({{numOption}})" parameterized="true"/>
21+
<!-- Parameter is the attribute name -->
22+
<element name="nthExistingAttribute" type="select" selector="//*[text()='{{attributeName}}']/../..//select" parameterized="true"/>
2523
</section>
2624
</sections>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminProductCategoryCreationSection.xml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
1111
<section name="AdminProductCategoryCreationSection">
12-
<element name="firstExampleProduct" type="button" selector=".data-row:nth-of-type(1)" />
13-
<element name="newCategory" type="button" selector="//button/span[text()='New Category']" />
14-
15-
<element name="nameInput" type="input" selector="input[name='name']" />
16-
17-
<element name="parentCategory" type="block" selector=".product_form_product_form_create_category_modal div[data-role='selected-option']" />
18-
<element name="parentCategoryDropdownDefaultOption" type="block" selector=".product_form_product_form_create_category_modal .action-menu-item._expended .admin__action-multiselect-label" />
19-
<element name="createCategory" type="button" selector="#save" />
12+
<element name="firstExampleProduct" type="button" selector=".data-row:nth-of-type(1)"/>
13+
<element name="newCategory" type="button" selector="//button/span[text()='New Category']"/>
2014

15+
<element name="nameInput" type="input" selector="input[name='name']"/>
2116

17+
<element name="parentCategory" type="block" selector=".product_form_product_form_create_category_modal div[data-role='selected-option']"/>
18+
<element name="parentSearch" type="input" selector="aside input[data-role='advanced-select-text']"/>
19+
<element name="parentSearchResult" type="block" selector="aside .admin__action-multiselect-menu-inner"/>
20+
<element name="createCategory" type="button" selector="#save"/>
2221
</section>
2322
</sections>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Test/AdminCreateCategoryFromProductPageTest.xml

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,47 @@
88

99
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11-
<test name="AdminCreateCategoryFromProductPage">
11+
<test name="AdminCreateCategoryFromProductPageTest">
1212
<annotations>
13-
<features value="Category"/>
14-
<stories value="Admin should be able to create category from the product page"/>
13+
<features value="Catalog"/>
14+
<stories value="Create/Edit Category in Admin"/>
1515
<description value="Admin should be able to create category from the product page" />
16-
<severity value="AVERAGE" />
17-
<testCaseId value="MC-234" />
18-
<group value="Catalog" />
16+
<severity value="AVERAGE"/>
17+
<testCaseId value="MC-234"/>
18+
<group value="Catalog"/>
1919
</annotations>
2020
<before>
21-
<!-- Create new category in the product page with the category of AdminCreateCategoryFromProductPage -->
22-
<createData entity="SimpleTwo" stepKey="simpleProduct" />
21+
<!-- Login as admin -->
22+
<createData entity="SimpleTwo" stepKey="simpleProduct"/>
2323
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
24-
25-
<!--Navigate to product page -->
26-
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
27-
<waitForPageLoad stepKey="waitForProductIndexPage"/>
28-
29-
<!-- Click first example product -->
30-
<click stepKey="clickFirstExampleProduct" selector="{{AdminProductCategoryCreationSection.firstExampleProduct}}" />
31-
<waitForPageLoad stepKey="waitForSpecificProductPage"/>
32-
33-
<!-- Fill out the form for the new category -->
34-
<actionGroup ref="FillNewProductCategory" stepKey="FillNewProductCategory">
35-
<argument name="categoryName" value="{{_defaultCategory.name}}" />
36-
</actionGroup>
3724
</before>
25+
3826
<after>
3927
<!-- Delete the created category -->
40-
<actionGroup ref="DeleteMostRecentCategory" stepKey="getRidOfCreatedCategory" />
28+
<actionGroup ref="DeleteMostRecentCategory" stepKey="getRidOfCreatedCategory"/>
4129
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
4230
<deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/>
4331
</after>
4432

33+
<!-- Find the product that we just created using the product grid and go to its page-->
34+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/>
35+
<waitForPageLoad stepKey="waitForAdminProductGridLoad"/>
36+
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
37+
<actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct">
38+
<argument name="product" value="SimpleTwo"/>
39+
</actionGroup>
40+
<waitForPageLoad stepKey="waitForFiltersToBeApplied"/>
41+
<click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProductPage"/>
42+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
43+
44+
<!-- Fill out the form for the new category -->
45+
<actionGroup ref="FillNewProductCategory" stepKey="FillNewProductCategory">
46+
<argument name="categoryName" value="{{_defaultCategory.name}}"/>
47+
</actionGroup>
48+
4549
<!-- Check that category was created -->
4650
<actionGroup ref="CategoryPresent" stepKey="checkIfCategoryPresent">
47-
<argument name="categoryName" value="{{_defaultCategory.name}}" />
51+
<argument name="categoryName" value="{{_defaultCategory.name}}"/>
4852
</actionGroup>
4953

5054
</test>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Test/SimpleProductTwoCustomOptionsTest.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@
3939
</actionGroup>
4040
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
4141
</after>
42-
<!-- ADD TEST STEPS HERE -->
42+
43+
<!-- opens the custom option panel and clicks add options -->
44+
<click stepKey="openCustomizableOptions" selector="{{AdminProductCustomizableOptionsSection.customezableOptions}}"/>
45+
<waitForPageLoad stepKey="waitForCustomOptionsOpen"/>
4346

4447
<!-- Create a custom option with 2 values -->
4548
<actionGroup ref="CreateCustomRadioOptions" stepKey="createCustomOption1">

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProduct/Test/AdminConfigurableProductUpdateAttributeTest.xml

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,22 @@
2020
</annotations>
2121

2222
<before>
23+
<!-- Create the attribute we will be modifying -->
24+
<createData entity="productAttributeWithTwoOptions" stepKey="createModifiableProductAttribute"/>
25+
26+
<!-- Create the two attributes the product will have -->
27+
<createData entity="productAttributeOption1" stepKey="createModifiableProductAttributeOption1">
28+
<requiredEntity createDataKey="createModifiableProductAttribute"/>
29+
</createData>
30+
<createData entity="productAttributeOption2" stepKey="createModifiableProductAttributeOption2">
31+
<requiredEntity createDataKey="createModifiableProductAttribute"/>
32+
</createData>
33+
34+
<!-- Add the product to the default set -->
35+
<createData entity="AddToDefaultSet" stepKey="createModifiableAddToAttributeSet">
36+
<requiredEntity createDataKey="createModifiableProductAttribute"/>
37+
</createData>
38+
2339
<!-- TODO: This should be converted to an actionGroup once MQE-993 is fixed. -->
2440
<!-- Create the category the product will be a part of -->
2541
<createData entity="ApiCategory" stepKey="createCategory"/>
@@ -87,37 +103,39 @@
87103
<deleteData createDataKey="createConfigProduct" stepKey="deleteConfigProduct"/>
88104
<deleteData createDataKey="createConfigChildProduct1" stepKey="deleteConfigChildProduct1"/>
89105
<deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/>
106+
<deleteData createDataKey="createModifiableProductAttribute" stepKey="deleteModifiableProductAttribute"/>
90107
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/>
91108
</after>
92109

93110
<!-- Get the current option of the attribute before it was changed -->
94111
<amOnPage url="/{{ApiConfigurableProduct.urlKey}}2.html" stepKey="goToConfigProductPage"/>
95-
<waitForPageLoad stepKey="waitForStoreFrontProductPageLoad" />
96-
<grabTextFrom stepKey="getBeforeOption" selector="{{StorefrontProductInfoMainSection.nthAttributeOnPage('1')}}" />
112+
<waitForPageLoad stepKey="waitForStoreFrontProductPageLoad"/>
113+
114+
<grabTextFrom stepKey="getBeforeOption" selector="{{StorefrontProductInfoMainSection.nthAttributeOnPage('1')}}"/>
97115

98116
<!-- Find the product that we just created using the product grid -->
99117
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="visitAdminProductPage"/>
118+
<waitForPageLoad stepKey="waitForAdminProductPageLoad"/>
100119
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}" dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
101120
<actionGroup ref="filterProductGridBySku" stepKey="findCreatedProduct">
102-
<argument name="product" value="ApiConfigurableProduct" />
121+
<argument name="product" value="ApiConfigurableProduct"/>
103122
</actionGroup>
123+
<waitForPageLoad stepKey="waitForProductFilterLoad"/>
104124

105125
<click selector="{{AdminProductGridSection.firstRow}}" stepKey="clickOnProductPage"/>
106-
<waitForPageLoad stepKey="waitForProductPageLoad" />
126+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
107127

108128
<!-- change the option on the first attribute -->
109-
<click stepKey="clickFirstAttribute" selector="{{ModifyAttributes.nthExistingAttribute('1')}}" />
110-
<click stepKey="clickSecondAttributeOption" selector="{{ModifyAttributes.nthAttributeOption('1', '2')}}" />
129+
<selectOption stepKey="clickFirstAttribute" selector="{{ModifyAttributes.nthExistingAttribute($$createModifiableProductAttribute.default_frontend_label$$)}}" userInput="option1"/>
111130

112131
<!-- Save the product -->
113-
<click stepKey="saveProductAttribute" selector="{{AdminProductFormActionSection.saveButton}}" />
114-
<waitForPageLoad stepKey="waitForProductSaved" />
115-
<see stepKey="assertSuccess" selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product." />
132+
<click stepKey="saveProductAttribute" selector="{{AdminProductFormActionSection.saveButton}}"/>
133+
<see stepKey="assertSuccess" selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product."/>
116134

117135
<!-- Go back to the configurable product page and check to see if it has changed -->
118136
<amOnPage url="/{{ApiConfigurableProduct.urlKey}}2.html" stepKey="goToConfigProductPage2"/>
119-
<waitForPageLoad stepKey="waitForStoreFrontProductPageLoad2" />
120-
<grabTextFrom stepKey="getCurrentOption" selector="{{StorefrontProductInfoMainSection.nthAttributeOnPage('1')}}" />
137+
<waitForPageLoad stepKey="waitForStoreFrontProductPageLoad2"/>
138+
<grabTextFrom stepKey="getCurrentOption" selector="{{StorefrontProductInfoMainSection.nthAttributeOnPage('1')}}"/>
121139
<assertNotEquals expected="{$getBeforeOption}" expectedType="string" actual="{$getCurrentOption}" actualType="string" stepKey="assertNotEquals"/>
122140

123141
</test>

0 commit comments

Comments
 (0)