Skip to content

Commit 784c1e1

Browse files
committed
MC-248: Admin should be able to create simple product with two custom options
- Cleaned up naming
1 parent 7ee5a8b commit 784c1e1

File tree

3 files changed

+33
-34
lines changed

3 files changed

+33
-34
lines changed

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,33 @@
1515
<!-- ActionGroup will add a single custom option to a product -->
1616
<!-- You must already be on the product creation page -->
1717
<arguments>
18-
<argument name="categoryName"/>
18+
<argument name="customOptionName"/>
1919
<argument name="productOption"/>
2020
<argument name="productOption2"/>
2121
</arguments>
2222

2323
<!-- opens the custom option panel and clicks add options -->
24-
<click stepKey="openCustomizableOptions" selector="{{AdminProductCustomizableOptionsSection.customezableOptions}}" />
25-
<click stepKey="clickAddOptions" selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" />
24+
<click stepKey="openCustomizableOptions" selector="{{AdminProductCustomizableOptionsSection.customezableOptions}}"/>
25+
<click stepKey="clickAddOptions" selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}"/>
2626

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

3232
<!-- Add three radio options based on the parameter -->
33-
<click stepKey="clickAddValue" selector="{{AdminProductCustomizableOptionsSection.addValue}}" />
33+
<click stepKey="clickAddValue" selector="{{AdminProductCustomizableOptionsSection.addValue}}"/>
3434

35-
<fillField stepKey="fillInValueTitle" selector="{{AdminProductCustomizableOptionsSection.valueTitle}}" userInput="{{productOption.title}}" />
36-
<fillField stepKey="fillInValuePrice" selector="{{AdminProductCustomizableOptionsSection.valuePrice}}" userInput="{{productOption.price}}" />
35+
<fillField stepKey="fillInValueTitle" selector="{{AdminProductCustomizableOptionsSection.valueTitle}}" userInput="{{productOption.title}}"/>
36+
<fillField stepKey="fillInValuePrice" selector="{{AdminProductCustomizableOptionsSection.valuePrice}}" userInput="{{productOption.price}}"/>
3737

38-
<click stepKey="clickAddValue2" selector="{{AdminProductCustomizableOptionsSection.addValue}}" />
38+
<click stepKey="clickAddValue2" selector="{{AdminProductCustomizableOptionsSection.addValue}}"/>
3939

40-
<fillField stepKey="fillInValueTitle2" selector="{{AdminProductCustomizableOptionsSection.valueTitle}}" userInput="{{productOption2.title}}" />
41-
<fillField stepKey="fillInValuePrice2" selector="{{AdminProductCustomizableOptionsSection.valuePrice}}" userInput="{{productOption2.price}}" />
40+
<fillField stepKey="fillInValueTitle2" selector="{{AdminProductCustomizableOptionsSection.valueTitle}}" userInput="{{productOption2.title}}"/>
41+
<fillField stepKey="fillInValuePrice2" selector="{{AdminProductCustomizableOptionsSection.valuePrice}}" userInput="{{productOption2.price}}"/>
4242

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

4646
</actionGroup>
4747

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Data/ProductOptionData.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
<data key="price">20</data>
2828
<data key="price_type">fixed</data>
2929
<data key="max_characters">0</data>
30-
<data key="expected_value">153.00</data> <!-- tied to this price and ProductOptionField -->
3130
</entity>
3231
<entity name="ProductOptionArea" type="product_option">
3332
<var key="product_sku" entityType="product" entityKey="sku" />

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

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
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="SimpleProductTwoCustomOptions">
11+
<test name="SimpleProductTwoCustomOptionsTest">
1212
<annotations>
13-
<features value="CustomOptions" />
13+
<features value="Catalog"/>
1414
<stories value="Create simple product with two custom options" />
1515
<title value="Admin should be able to create simple product with two custom options"/>
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="Levi"/>
19+
<group value="Catalog"/>
2020
</annotations>
2121
<before>
2222
<!-- log in as admin -->
@@ -43,44 +43,44 @@
4343

4444
<!-- Create a custom option with 2 values -->
4545
<actionGroup ref="CreateCustomRadioOptions" stepKey="createCustomOption1">
46-
<argument name="categoryName" value="ProductOptionRadiobutton.title"/>
46+
<argument name="customOptionName" value="ProductOptionRadiobutton.title"/>
4747
<argument name="productOption" value="ProductOptionField"/>
4848
<argument name="productOption2" value="ProductOptionField2"/>
4949
</actionGroup>
5050

5151
<!-- Create another custom option with 2 values -->
5252
<actionGroup ref="CreateCustomRadioOptions" stepKey="createCustomOption2">
53-
<argument name="categoryName" value="ProductOptionRadiobutton.title"/>
53+
<argument name="customOptionName" value="ProductOptionRadiobutton.title"/>
5454
<argument name="productOption" value="ProductOptionField"/>
5555
<argument name="productOption2" value="ProductOptionField2"/>
5656
</actionGroup>
5757

5858
<!-- Save the product -->
59-
<click stepKey="saveProduct" selector="{{AdminProductFormActionSection.saveButton}}" />
60-
<waitForPageLoad stepKey="waitForProductSaved" />
59+
<click stepKey="saveProduct" selector="{{AdminProductFormActionSection.saveButton}}"/>
60+
<waitForPageLoad stepKey="waitForProductSaved"/>
6161
<seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccess"/>
6262

6363
<!-- navigate to the created product page -->
64-
<amOnPage url="/{{SimpleProduct3.name}}.html" stepKey="goToCreatedProduct" />
65-
<waitForPageLoad stepKey="waitForProductPageLoad" />
64+
<amOnPage url="/{{SimpleProduct3.name}}.html" stepKey="goToCreatedProduct"/>
65+
<waitForPageLoad stepKey="waitForProductPageLoad"/>
6666

6767
<!-- Check to make sure all of the created names are there -->
68-
<see stepKey="assertNameInFirstOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('1')}}" userInput="{{ProductOptionField.title}}" />
69-
<see stepKey="assertNameInSecondOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('2')}}" userInput="{{ProductOptionField.title}}" />
70-
<see stepKey="assertSecondNameInFirstOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('1')}}" userInput="{{ProductOptionField2.title}}" />
71-
<see stepKey="assertSecondNameInSecondOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('2')}}" userInput="{{ProductOptionField2.title}}" />
68+
<see stepKey="assertNameInFirstOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('1')}}" userInput="{{ProductOptionField.title}}"/>
69+
<see stepKey="assertNameInSecondOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('2')}}" userInput="{{ProductOptionField.title}}"/>
70+
<see stepKey="assertSecondNameInFirstOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('1')}}" userInput="{{ProductOptionField2.title}}"/>
71+
<see stepKey="assertSecondNameInSecondOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('2')}}" userInput="{{ProductOptionField2.title}}"/>
7272

7373
<!-- Check to see that all of the created prices are there -->
74-
<see stepKey="assertPriceInFirstOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('1')}}" userInput="{{ProductOptionField.price}}" />
75-
<see stepKey="assertPriceInSecondOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('2')}}" userInput="{{ProductOptionField.price}}" />
76-
<see stepKey="assertSecondPriceInFirstOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('1')}}" userInput="{{ProductOptionField2.price}}" />
77-
<see stepKey="assertSecondPriceInSecondOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('2')}}" userInput="{{ProductOptionField2.price}}" />
74+
<see stepKey="assertPriceInFirstOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('1')}}" userInput="{{ProductOptionField.price}}"/>
75+
<see stepKey="assertPriceInSecondOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('2')}}" userInput="{{ProductOptionField.price}}"/>
76+
<see stepKey="assertSecondPriceInFirstOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('1')}}" userInput="{{ProductOptionField2.price}}"/>
77+
<see stepKey="assertSecondPriceInSecondOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('2')}}" userInput="{{ProductOptionField2.price}}"/>
7878

7979
<!-- select two of the radio buttons -->
80-
<click stepKey="selectFirstCustomOption" selector="{{StorefrontProductInfoMainSection.nthCustomOptionInput('1','2')}}" />
81-
<click stepKey="selectSecondCustomOption" selector="{{StorefrontProductInfoMainSection.nthCustomOptionInput('2','1')}}" />
80+
<click stepKey="selectFirstCustomOption" selector="{{StorefrontProductInfoMainSection.nthCustomOptionInput('1','2')}}"/>
81+
<click stepKey="selectSecondCustomOption" selector="{{StorefrontProductInfoMainSection.nthCustomOptionInput('2','1')}}"/>
8282

8383
<!-- Check that the price has actually changed -->
84-
<see stepKey="assertPriceHasChanged" selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{ProductOptionField2.expected_value}}" />
84+
<see stepKey="assertPriceHasChanged" selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="153.00"/>
8585
</test>
8686
</tests>

0 commit comments

Comments
 (0)