Skip to content

Commit 11ce389

Browse files
committed
MC-234: Admin should be able to create category from the product page
- Fix errors encountered when running tests on Jenkins
1 parent 6f4bcfa commit 11ce389

File tree

5 files changed

+29
-32
lines changed

5 files changed

+29
-32
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: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +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}}"/>
25-
<waitForPageLoad stepKey="waitForCustomOptionsOpen"/>
26-
2723
<click stepKey="clickAddOptions" selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}"/>
2824
<waitForPageLoad stepKey="waitForAddProductPageLoad"/>
2925

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

3532
<!-- Add three radio options based on the parameter -->
@@ -43,9 +40,6 @@
4340
<fillField stepKey="fillInValueTitle2" selector="{{AdminProductCustomizableOptionsSection.valueTitle}}" userInput="{{productOption2.title}}"/>
4441
<fillField stepKey="fillInValuePrice2" selector="{{AdminProductCustomizableOptionsSection.valuePrice}}" userInput="{{productOption2.price}}"/>
4542

46-
<!-- close the custom option dropdown -->
47-
<click stepKey="closeCustomizableOptions" selector="{{AdminProductCustomizableOptionsSection.customezableOptions}}"/>
48-
<waitForPageLoad stepKey="waitForCustomOptionsClose"/>
4943

5044
</actionGroup>
5145

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: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@
1313
<features value="Catalog"/>
1414
<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="Levi"/>
1919
</annotations>
2020
<before>
2121
<!-- Login as admin -->
22-
<createData entity="SimpleTwo" stepKey="simpleProduct" />
22+
<createData entity="SimpleTwo" stepKey="simpleProduct"/>
2323
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
2424
</before>
2525

2626
<after>
2727
<!-- Delete the created category -->
28-
<actionGroup ref="DeleteMostRecentCategory" stepKey="getRidOfCreatedCategory" />
28+
<actionGroup ref="DeleteMostRecentCategory" stepKey="getRidOfCreatedCategory"/>
2929
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
3030
<deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/>
3131
</after>
@@ -43,12 +43,12 @@
4343

4444
<!-- Fill out the form for the new category -->
4545
<actionGroup ref="FillNewProductCategory" stepKey="FillNewProductCategory">
46-
<argument name="categoryName" value="{{_defaultCategory.name}}" />
46+
<argument name="categoryName" value="{{_defaultCategory.name}}"/>
4747
</actionGroup>
4848

4949
<!-- Check that category was created -->
5050
<actionGroup ref="CategoryPresent" stepKey="checkIfCategoryPresent">
51-
<argument name="categoryName" value="{{_defaultCategory.name}}" />
51+
<argument name="categoryName" value="{{_defaultCategory.name}}"/>
5252
</actionGroup>
5353

5454
</test>

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<description value="Admin should be able to create simple product with two custom options"/>
1717
<severity value="AVERAGE"/>
1818
<testCaseId value="MC-248"/>
19-
<group value="Catalog"/>
19+
<group value="Levi"/>
2020
</annotations>
2121
<before>
2222
<!-- log in as admin -->
@@ -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">

0 commit comments

Comments
 (0)